This patch describes the changes made in ActivePerl build 822 over the official Perl v5.8.x@31223 sources. Summary of changes in build 822: * Make "perl -V" output reflect ActiveState build. * Add Win32::BuildNumber() for compatibility. * Add resources to perl.exe and perl58.dll. The ActivePerl Release Notes contain an informal summary of these changes. These can be viewed at: http://www.ActiveState.com/ActivePerl/docs/CHANGES.html The included patch may be applied to Perl v5.8.x@31223 sources using the GNU patch utility. e.g: % cd perl-5.8.x@31223 % patch -lNp1 < this_file --------------------------------------------------------------------------- diff -ruN perl-5.8.x/.patch AP822_source/.patch --- perl-5.8.x/.patch 2007-05-15 11:19:59.000000000 -0700 +++ AP822_source/.patch 1969-12-31 16:00:00.000000000 -0800 @@ -1 +0,0 @@ -31223 diff -ruN perl-5.8.x/BuildInfo.h AP822_source/BuildInfo.h --- perl-5.8.x/BuildInfo.h 1969-12-31 16:00:00.000000000 -0800 +++ AP822_source/BuildInfo.h 2007-08-01 10:17:38.779428666 -0700 @@ -0,0 +1,38 @@ +/* BuildInfo.h + * + * Copyright (C) 1998-2007 ActiveState Corp. All rights reserved. + * + */ + +#ifndef ___BuildInfo__h___ +#define ___BuildInfo__h___ + +#define ACTIVEPERL_PRODUCT "ActivePerl" +#define ACTIVEPERL_VERSION 822 +#define ACTIVEPERL_SUBVERSION 0 +#define ACTIVEPERL_CHANGELIST "" + +#define PERL_VENDORLIB_NAME "ActiveState" + +#ifndef STRINGIFY +# include "config.h" +#endif + +/* Derived values and legacy */ +#if ACTIVEPERL_SUBVERSION > 0 +# define PRODUCT_BUILD_NUMBER STRINGIFY(ACTIVEPERL_VERSION) "." STRINGIFY(ACTIVEPERL_SUBVERSION) +#else +# define PRODUCT_BUILD_NUMBER STRINGIFY(ACTIVEPERL_VERSION) +#endif +#define PERLFILEVERSION "5,8,8," STRINGIFY(ACTIVEPERL_VERSION) "\0" +#define PERLRC_VERSION 5,8,8,ACTIVEPERL_VERSION +#define PERLPRODUCTVERSION "Build " PRODUCT_BUILD_NUMBER ACTIVEPERL_CHANGELIST "\0" +#define PERLPRODUCTNAME ACTIVEPERL_PRODUCT "\0" +#define ACTIVEPERL_LOCAL_PATCHES_ENTRY ACTIVEPERL_PRODUCT " Build " PRODUCT_BUILD_NUMBER ACTIVEPERL_CHANGELIST +#ifdef BUILT_BY_ACTIVESTATE +#define BINARY_BUILD_NOTICE PerlIO_printf(PerlIO_stdout(), "\n\ +Binary build " PRODUCT_BUILD_NUMBER ACTIVEPERL_CHANGELIST " provided by ActiveState http://www.ActiveState.com\n\ +Built " __DATE__ " " __TIME__ "\n"); +#endif + +#endif /* ___BuildInfo__h___ */ diff -ruN perl-5.8.x/Changes AP822_source/Changes --- perl-5.8.x/Changes 2007-04-21 06:18:34.000000000 -0700 +++ AP822_source/Changes 2007-08-01 10:17:38.853415749 -0700 @@ -24,10 +24,884 @@ to the perl5-porters mailing list. You can retrieve the messages for example from http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/ +-------------------- +ActivePerl build 822 Additional core patches in ActivePerl build 822 +-------------------- +____________________________________________________________________________ +[ 31570] By: steveh on 2007/07/09 13:15:05 + Log: Don't install static library files of statically linked extensions + when using a shared perl library. The files are not needed, and this + fixes a problem building PAR-Packer on Win32 with a debug build of + perl. (If Win32CORE.lib gets installed then PAR-Packer wants to link + against it and its PDB file, vc60.pdb, but the latter is not installed.) + Also skip installing a few other unnecessary files. + + Subject: Re: Problem in Win32CORE when building PAR-Packer-0.975 with bleadperl on Win32 + From: Steve Hay + Date: Fri, 06 Jul 2007 12:20:06 +0100 + Message-ID: <468E2566.8090504@uk.radan.com> + Branch: perl + ! installperl +____________________________________________________________________________ +[ 31569] By: steveh on 2007/07/09 11:43:09 + Log: Some Win32 Config fixes for patchlevel and perl_patchlevel: + - Set $Config{patchlevel} to PERL_VERSION (it was previously blank + because it was wrongly being set from PATCHLEVEL, which was blank) + - Set $Config{perl_patchlevel} and $Config{PERL_PATCHLEVEL} to the + value in the top-level ".patch" file if it exists (the former was + previously not set, while the latter was previously wrongly set to + PERL_VERSION) + Branch: perl + ! win32/config.bc win32/config.ce win32/config.gc + ! win32/config.vc win32/config.vc64 win32/config_sh.PL +____________________________________________________________________________ +[ 31567] By: rgs on 2007/07/09 08:00:17 + Log: Subject: [PATCH] Update Filter::Call::Util version + From: "Paul Marquess" + Date: Sat, 7 Jul 2007 20:24:21 +0100 + Message-ID: <007e01c7c0cc$6d07af30$6801a8c0@myopwv.com> + Branch: perl + ! ext/Filter/Util/Call/Call.pm +____________________________________________________________________________ +[ 31546] By: rgs on 2007/07/07 06:52:39 + Log: Subject: [PATCH] Fix commented out function names in proto.h + From: "Jan Dubois" + Date: Fri, 6 Jul 2007 17:59:38 -0700 + Message-ID: <058b01c7c032$18a6a260$49f3e720$@com> + Branch: perl + ! embed.h embed.pl proto.h +____________________________________________________________________________ +[ 31542] By: rgs on 2007/07/06 16:00:57 + Log: Add test preambles + Branch: perl + ! lib/base/t/base.t lib/base/t/fields-base.t lib/base/t/fields.t + ! lib/base/t/warnings.t +____________________________________________________________________________ +[ 31541] By: rgs on 2007/07/06 15:52:40 + Log: Make this new test be skipped with 5.8.x + Branch: perl + ! lib/base/t/fields-base.t +____________________________________________________________________________ +[ 31540] By: rgs on 2007/07/06 13:58:58 + Log: Upgrade to base and fields 2.12, mostly by Michael G Schwern + Branch: perl + + lib/base/Changes lib/base/t/sigdie.t lib/base/t/version.t + + lib/base/t/warnings.t t/lib/Dummy.pm t/lib/HasSigDie.pm + ! MANIFEST lib/base.pm lib/base/t/base.t + ! lib/base/t/fields-base.t lib/base/t/fields.t lib/fields.pm +____________________________________________________________________________ +[ 31523] By: steveh on 2007/07/03 14:16:23 + Log: $Config{useshrplib} should be 'true' rather than 'yes' when using + a shared perl library + Branch: perl + ! NetWare/config.wc win32/config.bc win32/config.ce + ! win32/config.gc win32/config.vc win32/config.vc64 +____________________________________________________________________________ +[ 31516] By: rgs on 2007/07/02 13:17:26 + Log: Subject: [PATCH] Fixes to threads tests + From: "Jerry D. Hedden" + Date: Sun, 1 Jul 2007 15:03:41 -0400 + Message-ID: <1ff86f510707011203qc90c31he6f6b86d08d34e39@mail.gmail.com> + Branch: perl + ! ext/threads/Changes ext/threads/t/stack.t + ! ext/threads/t/stack_env.t ext/threads/t/stress_cv.t + ! ext/threads/t/stress_re.t ext/threads/t/stress_string.t +____________________________________________________________________________ +[ 31490] By: steveh on 2007/06/28 10:11:15 + Log: Subject: RE: Problem in Win32CORE when building PAR-Packer-0.975 with bleadperl on Win32 + From: "Jan Dubois" + Date: Wed, 27 Jun 2007 15:34:12 -0700 + Message-ID: <02bd01c7b90b$49863720$dc92a560$@com> + + Rearranges the initialization of Win32CORE. The Perl interpreter isn't + fully initialized when Perl_init_os_extras() in win32/win32.c is called, + so it is not safe to use the Perl calling mechanism yet. Fixes a problem + building PAR-Packer on Win32. + Branch: perl + ! cygwin/cygwin.c ext/Win32CORE/Win32CORE.c + ! ext/Win32CORE/Win32CORE.pm makedef.pl win32/win32.c +____________________________________________________________________________ +[ 31477] By: rgs on 2007/06/27 09:59:11 + Log: Subject: [PATCH-revised] threads 1.63 + From: "Jerry D. Hedden" + Date: Tue, 26 Jun 2007 21:17:52 -0400 + Message-ID: <1ff86f510706261817o52ad2e23kbd4efb16b5bed98b@mail.gmail.com> + Branch: perl + ! ext/threads/Changes ext/threads/README ext/threads/t/exit.t + ! ext/threads/t/thread.t ext/threads/threads.pm +____________________________________________________________________________ +[ 31470] By: steveh on 2007/06/26 09:10:24 + Log: Upgrade to Win32-0.30 + Branch: perl + + ext/Win32/t/GetShortPathName.t + ! MANIFEST ext/Win32/Makefile.PL ext/Win32/Win32.pm + ! ext/Win32/Win32.xs ext/Win32/t/Unicode.t +____________________________________________________________________________ +[ 31420] By: rgs on 2007/06/19 12:13:20 + Log: Subject: [perl #43242] "use base" breaks code containing peculiarly named constant + From: Martin Becker (via RT) + Date: Mon, 18 Jun 2007 09:48:54 -0700 + Message-ID: + + plus a test case + Branch: perl + ! lib/base.pm lib/base/t/base.t +____________________________________________________________________________ +[ 31419] By: rgs on 2007/06/19 09:43:21 + Log: Update list of files that need crlf line endings + Branch: perl + ! Porting/curliff.pl +____________________________________________________________________________ +[ 31382] By: rgs on 2007/06/14 14:12:35 + Log: Upgrade to PathTools 3.25 + Branch: perl + ! ext/Cwd/Changes ext/Cwd/Cwd.xs ext/Cwd/Makefile.PL lib/Cwd.pm + ! lib/File/Spec.pm lib/File/Spec/OS2.pm lib/File/Spec/t/tmpdir.t +____________________________________________________________________________ +[ 31324] By: steveh on 2007/06/01 07:32:52 + Log: Subject: [PATCH] Fix DynaLoader::dl_findfile() to locate .so files again + From: "Jan Dubois" + Date: Thu, 31 May 2007 13:17:22 -0700 + Message-ID: <00a501c7a3c0$b2d880d0$18898270$@com> + Branch: perl + ! ext/DynaLoader/DynaLoader_pm.PL +____________________________________________________________________________ +[ 31310] By: rgs on 2007/05/30 10:45:08 + Log: Upgrade to Encode 2.23 + Branch: perl + ! ext/Encode/Changes ext/Encode/Encode.pm ext/Encode/Encode.xs + ! ext/Encode/Makefile.PL ext/Encode/Unicode/Unicode.pm +____________________________________________________________________________ +[ 31307] By: rgs on 2007/05/29 15:48:27 + Log: Plug a memory leak in Encode + Branch: perl + ! ext/Encode/Encode.xs +____________________________________________________________________________ +[ 31306] By: stevep on 2007/05/29 14:42:24 + Log: Upgrade to CPAN-1.9102 + Branch: perl + ! lib/CPAN.pm lib/CPAN/Kwalify.pm lib/CPAN/t/10version.t +____________________________________________________________________________ +[ 31305] By: rgs on 2007/05/29 09:33:52 + Log: Upgrade to Encode 2.22 + Branch: perl + ! ext/Encode/Changes ext/Encode/Encode.pm ext/Encode/Encode.xs + ! ext/Encode/t/fallback.t ext/Encode/t/mime-name.t +____________________________________________________________________________ +[ 31304] By: rgs on 2007/05/29 08:59:05 + Log: Revert change #30530, following Jan's advice + Branch: perl + ! Makefile.SH +____________________________________________________________________________ +[ 31262] By: rgs on 2007/05/24 08:18:31 + Log: Subject: [PATCH revised] threads::shared 1.12 + From: "Jerry D. Hedden" + Date: Wed, 23 May 2007 09:28:28 -0400 + Message-ID: <1ff86f510705230628n73c16e2gc67a3ec05d57c5f3@mail.gmail.com> + Branch: perl + ! ext/threads/shared/Changes ext/threads/shared/README + ! ext/threads/shared/shared.pm ext/threads/shared/t/wait.t + ! ext/threads/shared/t/waithires.t +____________________________________________________________________________ +[ 31259] By: steveh on 2007/05/23 08:12:14 + Log: Subject: RE: [PATCH] Skip ext/Win32/t/Unicode.t under Cygwin + From: "Jan Dubois" + Date: Tue, 22 May 2007 16:35:27 -0700 + Message-ID: <06dd01c79cc9$e101ce60$a3056b20$@com> + + Reinstates the test under Cygwin and fixes it. + Branch: perl + ! ext/Win32/t/Unicode.t +____________________________________________________________________________ +[ 31258] By: stevep on 2007/05/23 01:58:07 + Log: Subject: [PATCH] Forgotten Cygwin patch + From: "Jerry D. Hedden" + Date: Tue, 22 May 2007 20:58:04 -0400 + Message-ID: <1ff86f510705221758p71418517ncb89fac289d74c35@mail.gmail.com> + Branch: perl + ! cygwin/perlld.in +____________________________________________________________________________ +[ 31250] By: rgs on 2007/05/21 14:29:02 + Log: Subject: [PATCH] Skip ext/Win32/t/Unicode.t under Cygwin + From: "Jerry D. Hedden" + Date: Sat, 19 May 2007 11:56:40 -0400 + Message-ID: <1ff86f510705190856o2a98f1a5sd6f316f863e60c87@mail.gmail.com> + Branch: perl + ! ext/Win32/t/Unicode.t +____________________________________________________________________________ +[ 31249] By: rgs on 2007/05/21 14:27:03 + Log: Subject: [PATCH] Skip win32core.t under Cygwin + From: "Jerry D. Hedden" + Date: Sat, 19 May 2007 08:43:47 -0400 + Message-ID: <1ff86f510705190543r505cfc2fua18e87cd665b8f6e@mail.gmail.com> + Branch: perl + ! ext/Win32CORE/t/win32core.t +____________________________________________________________________________ +[ 31242] By: rgs on 2007/05/20 12:50:02 + Log: Subject: RE: When is -DPERL_CORE required? + From: "Jan Dubois" + Date: Fri, 18 May 2007 10:57:35 -0700 + Message-ID: <044601c79976$046691d0$0d33b570$@com> + Branch: perl + ! win32/win32.h +____________________________________________________________________________ +[ 31235] By: steveh on 2007/05/18 10:46:57 + Log: Upgrade to Win32-0.29 + Branch: perl + + ext/Win32/longpath.inc ext/Win32/t/CreateFile.t + + ext/Win32/t/GetCurrentThreadId.t ext/Win32/t/Unicode.t + ! MANIFEST ext/Win32/Makefile.PL ext/Win32/Win32.pm + ! ext/Win32/Win32.xs ext/Win32/t/GetFileVersion.t +____________________________________________________________________________ +[ 31233] By: merijn on 2007/05/16 21:32:56 + Log: Subject: [PATCH] Re: Thread fail/hang on HP-UX 10.20 + From: "Jerry D. Hedden" + Date: Wed, 16 May 2007 14:18:05 -0400 + Message-ID: <1ff86f510705161118x55e9d18crdf376ca469f97dc7@mail.gmail.com> + Branch: perl + ! ext/threads/shared/Changes ext/threads/shared/shared.pm + ! ext/threads/shared/t/stress.t +____________________________________________________________________________ +[ 31229] By: steveh on 2007/05/16 08:26:09 + Log: A more general fix to non-threaded static extension build problems + than #31220 was. + Branch: perl + ! ext/Win32CORE/Makefile.PL lib/ExtUtils/MM_Win32.pm +____________________________________________________________________________ +[ 31221] By: steveh on 2007/05/15 15:45:50 + Log: Subject: [PATCH] Win32CORE.c needed windows.h + From: "Jerry D. Hedden" + Date: Tue, 15 May 2007 09:10:00 -0400 + Message-ID: <1ff86f510705150609l1c178629i97091adbd02b6463@mail.gmail.com> + + (plus a #define to save windows.h pulling in so much stuff.) + + Fixes a build error on Cygwin caused by #31214. + Branch: perl + ! ext/Win32CORE/Win32CORE.c +____________________________________________________________________________ +[ 31220] By: steveh on 2007/05/15 08:19:56 + Log: Subject: RE: Smoke summary results for maint and current on Win32 + From: "Jan Dubois" + Date: Mon, 14 May 2007 14:58:19 -0700 + Message-ID: <013401c79672$fbbdb320$f3391960$@com> + + Fixes non-threaded builds on Win32 (which had warnings with VC and + errors with GCC) by compiling the statically linked extension + Win32CORE with -DPERLDLL. + + The same fix should be applied more generally to all statically + linked extensions so a further change may be forthcoming, but this + at least gets the standard non-threaded build working again. + Branch: perl + ! ext/Win32CORE/Makefile.PL +____________________________________________________________________________ +[ 31219] By: steveh on 2007/05/15 08:15:32 + Log: Subject: RE: [perl #42925] Win32::GetLastError fails when first called + From: "Jan Dubois" + Date: Mon, 14 May 2007 15:18:22 -0700 + Message-ID: <014e01c79675$c8bfc6e0$5a3f54a0$@com> + + Improved test: make sure that Win32 isn't already loaded when you call + Win32::GetLastError() + Branch: perl + ! ext/Win32CORE/t/win32core.t +____________________________________________________________________________ +[ 31215] By: steveh on 2007/05/14 16:56:22 + Log: Test for [perl #42925], which was fixed by #31214 + Branch: perl + ! ext/Win32CORE/t/win32core.t +____________________________________________________________________________ +[ 31214] By: steveh on 2007/05/14 16:54:30 + Log: Subject: RE: [perl #42925] Win32::GetLastError fails when first called + From: "Jan Dubois" + Date: Fri, 11 May 2007 16:55:17 -0700 + Message-ID: <02bd01c79427$d36140b0$7a23c210$@com> + Branch: perl + ! ext/Win32CORE/Win32CORE.c +____________________________________________________________________________ +[ 31212] By: stevep on 2007/05/13 16:47:40 + Log: Upgrade to Encode-2.21 + Branch: perl + + ext/Encode/lib/Encode/MIME/Name.pm ext/Encode/t/mime-name.t + ! MANIFEST ext/Encode/Encode.pm ext/Encode/Encode.xs + ! ext/Encode/Unicode/Unicode.pm ext/Encode/encoding.pm + ! ext/Encode/lib/Encode/Encoding.pm +____________________________________________________________________________ +[ 31211] By: stevep on 2007/05/13 16:35:02 + Log: Subject: [PATCH] Restore Windows NT support + From: "Jan Dubois" + Date: Fri, 11 May 2007 18:25:39 -0700 + Message-ID: <02d101c79434$743be100$5cb3a300$@com> + Branch: perl + ! win32/perllib.c win32/vdir.h win32/win32.c +____________________________________________________________________________ +[ 31195] By: rgs on 2007/05/10 13:12:38 + Log: Replace a call to utf8::encode by a pack/unpack combination, + so that code runs under 5.6 too + Branch: perl + ! lib/CGI/Util.pm +____________________________________________________________________________ +[ 31188] By: steveh on 2007/05/10 08:09:18 + Log: Subject: Re: [perl #42869] Problem killing a pseudo-forked child on Win32 + From: Dave Mitchell + Date: Thu, 3 May 2007 22:39:23 +0100 + Message-ID: <20070503213923.GH24804@iabyn.com> + + Fixes the failure to kill a pseudo-forked child on Win32 described in + [perl #42869], but the "Free to wrong pool" error remains + Branch: perl + ! win32/win32.c +____________________________________________________________________________ +[ 31170] By: stevep on 2007/05/08 15:09:20 + Log: Upgrade to CGI.pm-3.29 + Branch: perl + ! lib/CGI.pm lib/CGI/Changes +____________________________________________________________________________ +[ 31166] By: rgs on 2007/05/07 15:39:49 + Log: Subject: Sync Tie::RefHash with CPAN (1.37) + From: Yuval Kogman + Date: Mon, 7 May 2007 18:35:08 +0300 + Message-ID: <20070507153508.GZ17982@woobling.org> + Branch: perl + ! lib/Tie/RefHash.pm lib/Tie/RefHash/threaded.t +____________________________________________________________________________ +[ 31163] By: rgs on 2007/05/07 13:38:24 + Log: Fix [perl #42163] "use base" masks $SIG{__DIE__} + adapted from a patch by Michael G Schwern + Branch: perl + ! lib/base.pm +____________________________________________________________________________ +[ 31036] By: rgs on 2007/04/23 15:07:52 + Log: Upgrade to Term::ANSIColor 1.12. + Branch: perl + ! lib/Term/ANSIColor.pm lib/Term/ANSIColor/ChangeLog + ! lib/Term/ANSIColor/README lib/Term/ANSIColor/t/basic.t +____________________________________________________________________________ +[ 30878] By: stevep on 2007/04/10 02:30:38 + Log: Subject: [PATCH] Restore Win64 compilation with the Windows Platform SDK + From: Jan Dubois + Date: Mon, 09 Apr 2007 17:27:17 -0700 + Message-ID: <4kll13df3tndn8alp54gi9ur9jmq063aij@4ax.com> + Branch: perl + ! lib/ExtUtils/MM_Win32.pm win32/win32.c +____________________________________________________________________________ +[ 30718] By: rgs on 2007/03/23 11:59:55 + Log: Subject: [PATCH] Cwd doesn't need ppport.h in core + From: "Jerry D. Hedden" + Date: Tue, 20 Mar 2007 13:16:46 -0700 (PDT) + Message-ID: <196803.14702.qm@web30215.mail.mud.yahoo.com> + Branch: perl + ! ext/Cwd/Cwd.xs ext/Cwd/Makefile.PL lib/Cwd.pm mkppport.lst +____________________________________________________________________________ +[ 30684] By: rgs on 2007/03/22 14:25:54 + Log: Fix internal POD link + Branch: perl + ! lib/Term/ANSIColor.pm +____________________________________________________________________________ +[ 30516] By: steveh on 2007/03/08 14:13:11 + Log: Subject: RE: $Win32::VERSION problem + From: "Jan Dubois" + Date: Wed, 7 Mar 2007 12:26:01 -0800 + Message-ID: <00b301c760f6$d28129d0$77837d70$@com> + + Adds the tests from the dual-lived CPAN distribution Win32-0.27 + and removes two old t/win32 tests which are now redundant + Branch: perl + + ext/Win32/t/ExpandEnvironmentStrings.t + + ext/Win32/t/GetFileVersion.t ext/Win32/t/GetFolderPath.t + + ext/Win32/t/GetFullPathName.t ext/Win32/t/GetLongPathName.t + + ext/Win32/t/GetOSVersion.t ext/Win32/t/GuidGen.t + - t/win32/getosversion.t t/win32/longpath.t + ! MANIFEST +____________________________________________________________________________ +[ 30425] By: steveh on 2007/02/28 09:11:19 + Log: Subject: Re: [PATCH] Re: Math::BigInt and Win32API::File whines a lot during make test... + From: "Jerry D. Hedden" + Date: Tue, 27 Feb 2007 10:33:36 -0800 (PST) + Message-ID: <738238.57355.qm@web30201.mail.mud.yahoo.com> + + (Silences warnings about math lib(s), avoids using Math::BigInt + when using 64-bit ints and changes "new" to "->new()") + Branch: perl + ! ext/Win32API/File/File.pm +____________________________________________________________________________ +[ 29868] By: steveh on 2007/01/18 11:36:05 + Log: Subject: Re: [PATCH] win32_async_check() can still loop indefinitely + From: Jan Dubois + Date: Mon, 15 Jan 2007 19:25:11 -0800 + Message-ID: + Branch: perl + ! win32/win32.c +____________________________________________________________________________ +[ 29732] By: steveh on 2007/01/09 10:40:23 + Log: Subject: Re: [PATCH] ANSIfy the PATH environment variable on Windows + From: Jan Dubois + Date: Mon, 08 Jan 2007 14:58:12 -0800 + Message-ID: + + Fixes the Borland build, in which the PATH was getting corrupted + when the variable that was just putenv()'d got free()'d + Branch: perl + ! win32/win32.c +____________________________________________________________________________ +[ 29419] By: stevep on 2006/11/29 15:24:21 + Log: Upgrade to Tie-RefHash-1.35_01, which is just a version change for + bleadperl. + Branch: perl + ! lib/Tie/RefHash.pm +____________________________________________________________________________ +[ 28185] By: nicholas on 2006/05/13 10:36:18 + Log: Can't do require Foo if $tainted; because taint tunnels. + (Documented, but I regard this as a serious practical deficiency in + tainting) + Branch: perl + ! lib/Tie/RefHash.pm +____________________________________________________________________________ +[ 27527] By: stevep on 2006/03/17 04:19:01 + Log: Subject: [PATCH] win32_async_check() can loop indefinitely; 5.8.8 regression + From: Jan Dubois + Date: Thu, 16 Mar 2006 16:11:48 -0800 + Message-ID: <02ab01c64957$62142e70$6062a8c0@candy> + Branch: perl + ! win32/win32.c +____________________________________________________________________________ +[ 26970] By: gisle on 2006/01/27 19:48:28 + Log: Subject: Re: Make Passive mode the default for Net::FTP + From: Gisle Aas + Date: 27 Jan 2006 07:21:16 -0800 + Message-ID: + Branch: perl + ! lib/Net/Config.pm lib/Net/FTP.pm +____________________________________________________________________________ +[ 26637] By: steveh on 2006/01/04 11:10:36 + Log: Make Borland and MinGW happy with change 26379 + + (They both complain "invalid conversion from `void*' to `HWND__*'" + otherwise) + Branch: perl + ! win32/perlhost.h +____________________________________________________________________________ +[ 26379] By: rgs on 2005/12/16 21:13:37 + Log: Subject: [PATCH] RE: PeekMessage() call in win32\win32.c win32_async_check + From: Jan Dubois + Date: Dec 16, 2005 7:12 AM + Message-ID: <015901c60207$abd64210$d563a8c0@candy> + + (Without the proposed alarm.t test) + Branch: perl + ! t/op/fork.t win32/perlhost.h win32/win32.c win32/win32.h +____________________________________________________________________________ +[ 24699] By: rgs on 2005/06/03 21:07:03 + Log: Subject: Re: [PATCH] Improved ICMP_UNREACHABLE handling in Net::Ping + From: Gisle Aas + Date: 03 Jun 2005 09:17:44 -0700 + Message-ID: + Branch: perl + ! lib/Net/Ping.pm +____________________________________________________________________________ + -------------- Version v5.8.9 Maintenance release working toward v5.8.9 -------------- ____________________________________________________________________________ +____________________________________________________________________________ +[ 31223] By: nicholas on 2007/05/15 18:19:27 + Log: Integrate: + [ 30978] + Subject: [PATCH - again] Re: [perl #41574] cond_wait hang ups under MSWin32 + From: "Jerry D. Hedden" + Date: Wed, 18 Apr 2007 14:32:16 -0400 + Message-ID: <1ff86f510704181132qf94b413mfda6aaa0f347df28@mail.gmail.com> + + Makes the test "TODO" on Win32, where it is not reliable, and turns + the 50 separate tests in one single test for less line noise + + [ 31079] + Subject: [PATCH] Safely store user locks in threads::shared + From: "Jerry D. Hedden" + Date: Mon, 23 Apr 2007 13:21:11 -0400 + Message-ID: <1ff86f510704231021l6989ee0bkd68ab89e99bf8c6b@mail.gmail.com> + + [ 31216] + Subject: [PATCH] threads::shared 1.11 + From: "Jerry D. Hedden" + Message-ID: <1ff86f510705140517n1c140d96nca36667bcbbc27f@mail.gmail.com> + Date: Mon, 14 May 2007 08:17:51 -0400 + Branch: maint-5.8/perl + !> ext/threads/shared/Changes ext/threads/shared/README + !> ext/threads/shared/shared.pm ext/threads/shared/shared.xs + !> ext/threads/shared/t/stress.t +____________________________________________________________________________ +[ 31210] By: nicholas on 2007/05/13 10:56:13 + Log: Integrate: + [ 30918] + Subject: [PATCH] g++ in Tru64: align sockaddr and sockaddr_in defs + From: Jarkko Hietaniemi + Date: Thu, 12 Apr 2007 05:19:30 +0300 (EEST) + Message-Id: <200704120219.l3C2JUGZ294947@kosh.hut.fi> + Branch: maint-5.8/perl + !> hints/dec_osf.sh +____________________________________________________________________________ +[ 31162] By: nicholas on 2007/05/07 11:15:06 + Log: Integrate: + [ 31019] + Move Module::Pluggable tests up under main test directory. + Branch: maint-5.8/perl + +> (branch 50 files) + - lib/Module/Pluggable/t/01use.t + - lib/Module/Pluggable/t/02alsoworks.t + - lib/Module/Pluggable/t/02works.t + - lib/Module/Pluggable/t/02works_taint.t + - lib/Module/Pluggable/t/03diffname.t + - lib/Module/Pluggable/t/04acmedir.t + - lib/Module/Pluggable/t/04acmedir_single.t + - lib/Module/Pluggable/t/04acmepath.t + - lib/Module/Pluggable/t/04acmepath_single.t + - lib/Module/Pluggable/t/05postpath.t + - lib/Module/Pluggable/t/06multipath.t + - lib/Module/Pluggable/t/07instantiate.t + - lib/Module/Pluggable/t/08nothing.t + - lib/Module/Pluggable/t/09require.t + - lib/Module/Pluggable/t/10innerpack.t + - lib/Module/Pluggable/t/10innerpack_inner.t + - lib/Module/Pluggable/t/10innerpack_noinner.t + - lib/Module/Pluggable/t/10innerpack_override.t + - lib/Module/Pluggable/t/11usetwice.t + - lib/Module/Pluggable/t/12only.t + - lib/Module/Pluggable/t/12onlyarray.t + - lib/Module/Pluggable/t/12onlyregex.t + - lib/Module/Pluggable/t/13except.t + - lib/Module/Pluggable/t/13exceptarray.t + - lib/Module/Pluggable/t/13exceptregex.t + - lib/Module/Pluggable/t/14package.t + - lib/Module/Pluggable/t/15topicsafe.t + - lib/Module/Pluggable/t/16different_extension.t + - lib/Module/Pluggable/t/17devel_inner_package.t + - lib/Module/Pluggable/t/18skipped_package.t + - lib/Module/Pluggable/t/19can_ok_clobber.t + - lib/Module/Pluggable/t/20dodgy_files.t + - lib/Module/Pluggable/t/acme/Acme/MyTest/Plugin/Foo.pm + - lib/Module/Pluggable/t/lib/Acme/MyTest/Plugin/Foo.pm + - lib/Module/Pluggable/t/lib/ExtTest/Plugin/Bar.plugin + - lib/Module/Pluggable/t/lib/ExtTest/Plugin/Foo.plugin + - lib/Module/Pluggable/t/lib/ExtTest/Plugin/Quux/Foo.plugin + - lib/Module/Pluggable/t/lib/InnerTest/Plugin/Foo.pm + - lib/Module/Pluggable/t/lib/MyOtherTest/Plugin/Bar.pm + - lib/Module/Pluggable/t/lib/MyOtherTest/Plugin/Foo.pm + - lib/Module/Pluggable/t/lib/MyOtherTest/Plugin/Quux.pm + - lib/Module/Pluggable/t/lib/MyOtherTest/Plugin/Quux/Foo.pm + - lib/Module/Pluggable/t/lib/MyTest/Extend/Plugin/Bar.pm + - lib/Module/Pluggable/t/lib/MyTest/Plugin/Bar.pm + - lib/Module/Pluggable/t/lib/MyTest/Plugin/Foo.pm + - lib/Module/Pluggable/t/lib/MyTest/Plugin/Quux/Foo.pm + - lib/Module/Pluggable/t/lib/No/Middle.pm + - lib/Module/Pluggable/t/lib/OddTest/Plugin/-Dodgy.pm + - lib/Module/Pluggable/t/lib/OddTest/Plugin/Foo.pm + - lib/Module/Pluggable/t/lib/TA/C/A/I.pm + !> MANIFEST t/TEST t/harness +____________________________________________________________________________ +[ 31161] By: nicholas on 2007/05/07 10:47:46 + Log: Integrate all the B changes from: + [ 30841] + Subject: Re: pmdynflags and thread safety + From: demerphq + Date: Wed, 4 Apr 2007 01:46:26 +0200 + Message-ID: <9b18b3110704031646p7ac8dbearf9e41397a5f884d8@mail.gmail.com> + + [ 30853] + Remove op_pmnext from PMOPs, and instead store the list for reset as + an array hanging from the mg_ptr of the symbol table magic. + (Previously the linked list head was in the mg_obj member) + + [ 30860] + Merge op_pmreplstart and op_pmstash/op_pmstashpv into a union in + PMOP, as both pointers never need to be set at the same time. + + [ 30865] + Turn op_pmreplroot in struct pmop into a real union. + + [ 30980] + Subject: Re: new C3 MRO patch + From: "Brandon Black" + Date: Tue, 17 Apr 2007 13:14:36 -0500 + Message-ID: <84621a60704171114k29b0460el5b08ce5185d55ed5@mail.gmail.com> + + [ 31053] + Adjust test count. + + [ 31153] + Tweak change 30841 so that B works on maint too. + Branch: maint-5.8/perl + !> ext/B/B.pm ext/B/B.xs ext/B/B/Deparse.pm ext/B/defsubs_h.PL + !> ext/B/t/b.t ext/B/t/concise-xs.t +____________________________________________________________________________ +[ 31155] By: nicholas on 2007/05/05 22:00:24 + Log: Change 31133 should have added pop_return, not push_return. + So much for my memory. + Branch: maint-5.8/perl + ! embed.fnc embed.h global.sym +____________________________________________________________________________ +[ 31151] By: nicholas on 2007/05/05 10:43:04 + Log: Naff orf. + Branch: maint-5.8/perl + - perly.act perly.tab +____________________________________________________________________________ +[ 31150] By: nicholas on 2007/05/05 10:42:36 + Log: Integrate: + [ 30675] + Silence a couple of warnings caused by change #30672. + + [ 30830] + The op slab allocator can call calloc() instead of malloc(), and save + a Zero(). Also, argument m is unused. + + [ 30858] + Add editor block. + + [ 30861] + Re-ordering OP_STUB in the switch statement in Perl_peep saves a goto. + + [ 30879] + Subject: [PATCH] Cast markstack values to I32 + From: Jan Dubois + Date: Mon, 09 Apr 2007 18:11:32 -0700 + Message-ID: + + [ 30900] + Silence the g++ warnings "right-hand operand of comma has no effect" + + [ 30903] + Work round what appears to be a bug in Sun C++ 5.8 2005/10/13 + If we just cast GvSVn(gv) to void, it ignores evaluating it for + its side effect. + + [ 30931] + Change 18797 (Patch for [perl #9402], known also as "glibc _moddi3 bug + with negative quads", or also as RedHat bug #65612.) was a bit brute + force. In reality, we don't need to have an auto-detecting pp_i_modulo + unless we're compiled with 64 bit IVs and on glibc. + + [ 30964] + get rid of warning due to empty dangling else in malloc.c + + [ 30965] + fix casting warning in pp_ord() + + [ 30966] + Subject: [PATCH] sv.c: %d ne size_t + From: Jarkko Hietaniemi + Date: Mon, 16 Apr 2007 14:31:42 +0300 (EEST) + Message-Id: <200704161131.l3GBVg3n104476@kosh.hut.fi> + + [ 31010] + Where possible, use SvIV instead of SvIVX, SvNV instead of SvNVX, + SvUV instead of SvUVX, and SvPV* variants instead of SvPVX*. + Document that the non-x variants are preferable whenever the expression + has no side effects. (Compilers perform common subexression + elimination). Likewise SvREFCNT_inc simple variants are valid for all + cases apart from expressions with side effects. + + [ 31032] + A safer version of CopFILE, by Jarkko + + [ 31038] + Remove the unnecessary allocation of and assignment to hunk[3], as the + perl API functions called don't need a NUL terminated string. + Branch: maint-5.8/perl + +> perly.act perly.tab + !> XSUB.h cop.h doio.c gv.c malloc.c op.c op.h perl.c + !> pod/perlapi.pod pp.c pp.h pp_ctl.c pp_pack.c pp_sys.c sv.c + !> sv.h +____________________________________________________________________________ +[ 31149] By: nicholas on 2007/05/05 09:32:31 + Log: Integrate: + [ 30847] + C++ compilation fix by Steve Peters + + [ 30848] + g++ on NetBSD needs to have environ declared as well. + Branch: maint-5.8/perl + !> perl.h +____________________________________________________________________________ +[ 31146] By: nicholas on 2007/05/04 22:15:30 + Log: Integrate: + [ 30897] + Make the don't-use-nm symbol table probes work under C++. + + [ 30904] + If the test programs for strtoul(), strtoull() or strtouq() fail, don't + assume that the functions work. + + [ 30919] + When removing the test program source, also remove the compiled + executable. + + [ 30977] + 1. Move #30327 to the generation location + 2. Regen after backports + 3. Include Jarkko's $run and \n patch + + [ 31040] + Major *try* cleanup: introduce $rm_try; Some whitespace cleanups; + Small textual nit from Jarkko + + [ 31043] + Missed quotes in protocheck for rm_try + + [ 31066] + Leave try.c and include files where they are if we need them later + Branch: maint-5.8/perl + !> Configure Porting/config_h.pl config_h.SH +____________________________________________________________________________ +[ 31145] By: nicholas on 2007/05/04 21:08:19 + Log: Integrate: + [ 30562] + Subject: [PATCH] DB_File with g++ and db v1 + From: Jarkko Hietaniemi + Date: Mon, 12 Mar 2007 22:01:34 -0400 + Message-ID: <45F605FE.1090606@iki.fi> + + [ 30852] + Subject: [PATCH] Allow any *DBM_File to work for DynaLoader testing + From: "Jerry D. Hedden" + Date: Wed, 4 Apr 2007 09:57:16 -0400 + Message-ID: <1ff86f510704040657t732af552jbcbdb8804d134ff7@mail.gmail.com> + + [ 30898] + Cast needed to get POSIX compiling with g++ on FreeBSD. + + [ 31080] + Subject: [PATCH] fixed Fcntl::S_IFMT() breakage introduced by change 30674 (blead 26701) + From: Alexey Tourbin + Date: Wed, 25 Apr 2007 18:12:22 +0400 + Message-ID: <20070425141222.GA24828@solemn.turbinal> + + [ 31117] + Upgrade to XSLoader 0.08 + + [ 31138] + Subject: [perl #42844] careless use of gethostbyname() in Socket.xs + From: kan@dcit.cz (via RT) + Date: Tue, 01 May 2007 09:17:22 -0700 + Message-ID: + Branch: maint-5.8/perl + +> ext/Fcntl/t/mode.t + !> MANIFEST ext/DB_File/DB_File.xs ext/DynaLoader/XSLoader_pm.PL + !> ext/DynaLoader/t/DynaLoader.t ext/DynaLoader/t/XSLoader.t + !> ext/Fcntl/Fcntl.pm ext/POSIX/POSIX.xs ext/Socket/Socket.pm + !> ext/Socket/Socket.xs +____________________________________________________________________________ +[ 31144] By: nicholas on 2007/05/04 20:20:33 + Log: Integrate: + [ 29176] + Don't run ext/Sys/Syslog/t/constants.t with taint mode, so it's + not systematically skipped + Branch: maint-5.8/perl + !> ext/Sys/Syslog/t/constants.t +____________________________________________________________________________ +[ 31143] By: nicholas on 2007/05/04 19:37:09 + Log: Integrate: + [ 30972] + Sys::Syslog was missing from Maintainers.pl + + [ 31022] + Reflect change of path for Module::Pluggable's tests in Maintainers.pl + + [ 31096] + More up-to-date info about the metaunits + + [ 31126] + Subject: [PATCH] Add John Peacock as maintainer of version.pm + From: Gerard Goossen + Date: Thu, 3 May 2007 16:23:58 +0200 + Message-ID: <20070503142358.GE27210@ostwald> + + [ 31142] + Add a few manpages to Maintainers.pl + Branch: maint-5.8/perl + !> Porting/Maintainers.pl Porting/pumpkin.pod +____________________________________________________________________________ +[ 31133] By: nicholas on 2007/05/03 23:37:24 + Log: Add push_return to the CORE/EXT export list, as Data::Alias needs it. + Branch: maint-5.8/perl + ! embed.fnc embed.h global.sym +____________________________________________________________________________ +[ 31129] By: nicholas on 2007/05/03 16:01:36 + Log: Integrate: + [ 30716] + Subject: symbol-exports needed for Data::Alias + From: Matthijs van Duin + Date: Tue, 20 Mar 2007 14:59:15 +0100 + Message-ID: <20070320135915.GA25192@cds.nl> + Branch: maint-5.8/perl + !> embed.fnc embed.h global.sym +____________________________________________________________________________ +[ 31128] By: nicholas on 2007/05/03 15:34:16 + Log: Integrate: + [ 31072] + Upgrade to CPAN-1.9101 + Branch: maint-5.8/perl + !> lib/CPAN.pm lib/CPAN/Kwalify/distroprefs.dd +____________________________________________________________________________ +[ 31100] By: nicholas on 2007/04/27 11:06:42 + Log: Integrate: + [ 30601] + Patch by Abigail to avoid using $& in diagnostics.pm. + + [ 30654] + Subject: [PATCH] Remove unneeded pragma line from B/t/OptreeCheck.pm + From: "Jerry D. Hedden" + Date: Tue, 20 Mar 2007 16:43:02 -0700 (PDT) + Message-ID: <376615.72521.qm@web30204.mail.mud.yahoo.com> + Branch: maint-5.8/perl + !> ext/B/t/OptreeCheck.pm lib/diagnostics.pm +____________________________________________________________________________ +[ 31099] By: nicholas on 2007/04/27 10:45:45 + Log: Integrate: + [ 30387] + C should not warn. Don't make scan_ident test for + ambiguous unary ops when the following token is a hash identifier. + (like with scalars and arrays) + Branch: maint-5.8/perl + !> t/lib/warnings/toke toke.c +____________________________________________________________________________ +[ 31071] By: nicholas on 2007/04/25 10:26:42 + Log: Integrate: + [ 30989] + Upgrade to CPAN-1.91 + Branch: maint-5.8/perl + !> lib/CPAN.pm lib/CPAN/HandleConfig.pm lib/CPAN/Tarzip.pm + !> lib/CPAN/t/10version.t +____________________________________________________________________________ +[ 31070] By: nicholas on 2007/04/25 10:13:37 + Log: Integrate: + [ 31061] + Upgrade to Encode-2.20 + Branch: maint-5.8/perl + +> ext/Encode/lib/Encode/GSM0338.pm + !> MANIFEST ext/Encode/Byte/Byte.pm ext/Encode/Changes + !> ext/Encode/Encode.pm ext/Encode/Encode.xs + !> ext/Encode/Makefile.PL ext/Encode/bin/piconv + !> ext/Encode/encoding.pm ext/Encode/lib/Encode/Config.pm + !> ext/Encode/lib/Encode/Supported.pod ext/Encode/t/gsm0338.t + !> ext/Encode/t/mime-header.t +____________________________________________________________________________ +[ 31035] By: nicholas on 2007/04/23 14:40:27 + Log: Integrate: + [ 28934] + Fixes to compile Perl with g++ and DEBUGGING. + + [ 30660] + Pod fix to h2ph from John Morrissey on the Debian bug list. + Branch: maint-5.8/perl + !> utils/h2ph.PL x2p/a2p.c +____________________________________________________________________________ +[ 31011] By: nicholas on 2007/04/21 13:13:43 + Log: Update Changes. + Branch: maint-5.8/perl + ! Changes patchlevel.h +____________________________________________________________________________ [ 30961] By: nicholas on 2007/04/15 13:14:52 Log: Integrate: [ 30770] diff -ruN perl-5.8.x/Configure AP822_source/Configure --- perl-5.8.x/Configure 2007-05-04 15:17:55.000000000 -0700 +++ AP822_source/Configure 2007-08-01 10:17:39.883235959 -0700 @@ -207,6 +207,7 @@ to='' usecrosscompile='' mistrustnm='' +config_heavy='' perllibs='' dynamic_ext='' extensions='' @@ -3975,6 +3976,11 @@ esac EOSC +: default Config_heavy.pl +case "$config_heavy" in +'') config_heavy=Config_heavy.pl;; +esac + : function used to set $1 to $val setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; case "$val$was" in @@ -6926,6 +6932,11 @@ esac prefixvar=vendorarch . ./installprefix +if $test X"$vendorarch" = X"$vendorlib"; then + d_vendorarch="$undef" +else + d_vendorarch="$define" +fi : Final catch-all directories to search $cat <>Makefile <<'!NO!SUBS!' + rm -f $@ $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) !NO!SUBS! case "$osname" in @@ -838,7 +838,7 @@ $(LDLIBPTH) ./miniperl$(EXE_EXT) -Ilib mkppport lib/Config.pod: config.sh miniperl$(EXE_EXT) configpm Porting/Glossary - $(LDLIBPTH) ./miniperl -Ilib configpm --heavy=lib/Config_heavy.pl lib/Config.pm + $(LDLIBPTH) ./miniperl -Ilib configpm --heavy=lib/$(CONFIG_HEAVY) lib/Config.pm $(CONFIGPM): lib/Config.pod diff -ruN perl-5.8.x/NetWare/config.wc AP822_source/NetWare/config.wc --- perl-5.8.x/NetWare/config.wc 2007-04-13 01:30:00.000000000 -0700 +++ AP822_source/NetWare/config.wc 2007-08-01 10:17:40.040208554 -0700 @@ -964,7 +964,7 @@ usereentrant='undef' userelocatableinc='undef' usesfio='false' -useshrplib='yes' +useshrplib='true' usesitecustomize='undef' usesocks='undef' usethreads='undef' diff -ruN perl-5.8.x/Porting/curliff.pl AP822_source/Porting/curliff.pl --- perl-5.8.x/Porting/curliff.pl 2006-06-13 12:30:48.000000000 -0700 +++ AP822_source/Porting/curliff.pl 2007-08-01 10:17:40.174185164 -0700 @@ -17,9 +17,10 @@ README.win32 win32/Makefile win32/makefile.mk - wince/compile-all.bat - wince/README.perlce - wince/registry.bat + win32/Makefile.ce + win32/ce-helpers/compile-all.bat + win32/ce-helpers/compile.bat + win32/ce-helpers/registry.bat ); { diff -ruN perl-5.8.x/activeperl.c AP822_source/activeperl.c --- perl-5.8.x/activeperl.c 1969-12-31 16:00:00.000000000 -0800 +++ AP822_source/activeperl.c 2007-08-01 10:17:40.322159330 -0700 @@ -0,0 +1,90 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +static +XS(ActivePerl_PRODUCT) +{ + dXSARGS; + if (items != 0) + Perl_croak(aTHX_ "Usage: ActivePerl::PRODUCT()"); + XSRETURN_PV(ACTIVEPERL_PRODUCT); +} + +static +XS(ActivePerl_BUILD) +{ + dXSARGS; + if (items != 0) + Perl_croak(aTHX_ "Usage: ActivePerl::BUILD()"); + XSRETURN_PV(PRODUCT_BUILD_NUMBER); +} + +static +XS(ActivePerl_CHANGELIST) +{ + dXSARGS; + char *str = ACTIVEPERL_CHANGELIST; + if (items != 0) + Perl_croak(aTHX_ "Usage: ActivePerl::CHANGELIST()"); + + while (*str && !isDIGIT(*str)) + str++; + + if (isDIGIT(*str)) { + char *end = str + 1; + while (isDIGIT(*end)) + end++; + XSRETURN_PVN(str, end - str); + } + else { + XSRETURN_UNDEF; + } +} + +#ifdef CONFIG_HEAVY +static +XS(ActivePerl_CONFIG_HEAVY) +{ + dXSARGS; + if (items != 0) + Perl_croak(aTHX_ "Usage: ActivePerl::_CONFIG_HEAVY()"); + XSRETURN_PV(STRINGIFY(CONFIG_HEAVY)); +} +#endif + +void +Perl_boot_core_ActivePerl(pTHX) +{ + char *file = __FILE__; + SV *version_sv = get_sv("ActivePerl::VERSION", TRUE); +#if ACTIVEPERL_SUBVERSION > 0 + Perl_sv_setpvf(aTHX_ version_sv, "%d.%02d", ACTIVEPERL_VERSION, ACTIVEPERL_SUBVERSION); +#else + sv_setiv(version_sv, ACTIVEPERL_VERSION); +#endif + newXS("ActivePerl::PRODUCT", ActivePerl_PRODUCT, file); + newXS("ActivePerl::BUILD", ActivePerl_BUILD, file); + newXS("ActivePerl::CHANGELIST", ActivePerl_CHANGELIST, file); +#ifdef CONFIG_HEAVY + newXS("ActivePerl::_CONFIG_HEAVY", ActivePerl_CONFIG_HEAVY, file); +#endif +} + + +/* compatibility wrappers */ + +/* XXX Perl_new_vstring */ +/* XXX Perl_pad_allocmy */ + +EXTERN_C runops_proc_t* Perl_Grunops_dbg_ptr(pTHX) { return &PL_runops_dbg; } +EXTERN_C runops_proc_t* Perl_Grunops_std_ptr(pTHX) { return &PL_runops_std; } +EXTERN_C thrhook_proc_t* Perl_Gthreadhook_ptr(pTHX) { return &PL_threadhook; } +EXTERN_C share_proc_t* Perl_Gsharehook_ptr(pTHX) { return &PL_sharehook; } +EXTERN_C share_proc_t* Perl_Glockhook_ptr(pTHX) { return &PL_lockhook; } +EXTERN_C share_proc_t* Perl_Gunlockhook_ptr(pTHX) { return &PL_unlockhook; } + +EXTERN_C AV** Perl_Icomppad_ptr(pTHX) { return &PL_comppad; } +EXTERN_C const char** Perl_Ish_path_ptr(pTHX) { return &PL_sh_path; } +/* XXX Is this really the right thing to do? */ +EXTERN_C bool* Perl_Iwantutf8_ptr(pTHX) { return &PL_utf8locale; } diff -ruN perl-5.8.x/cflags.SH AP822_source/cflags.SH --- perl-5.8.x/cflags.SH 2007-03-30 16:16:08.000000000 -0700 +++ AP822_source/cflags.SH 2007-08-01 10:17:40.372150602 -0700 @@ -248,6 +248,9 @@ ODBM_File) ;; POSIX) ;; SDBM_File) ;; + activeperl) + ccflags="$ccflags -DCONFIG_HEAVY=$config_heavy" + ;; av) ;; byterun) ;; deb) ;; diff -ruN perl-5.8.x/configpm AP822_source/configpm --- perl-5.8.x/configpm 2007-02-05 09:38:44.000000000 -0800 +++ AP822_source/configpm 2007-08-01 10:17:40.387147984 -0700 @@ -44,9 +44,9 @@ # commonly used names to precache (and hence lookup fastest) my %Common; -while ($how_many_common--) { - $_ = ; - chomp; +while () { + next if /^\s*#/; + last unless $how_many_common--; /^(\S+):\s*(\d+)$/ or die "Malformed line '$_'"; $Common{$1} = $1; } @@ -118,6 +118,14 @@ use strict; # use warnings; Pulls in Carp # use vars pulls in Carp +BEGIN { + unless ($ENV{ACTIVEPERL_CONFIG_DISABLE}) { + eval { + require ActivePerl::Config; + }; + die $@ if $@ && $@ !~ /^Can't locate ActivePerl\/Config\.pm/; + } +} ENDOFBEG my $myver = sprintf "v%vd", $^V; @@ -239,6 +247,16 @@ # Search for it in the big string sub fetch_string { my($self, $key) = @_; + # Let ActivePerl::Config override if it wants + my $value; + $value = _fetch_string(@_) + unless defined(&ActivePerl::Config::override) && + ActivePerl::Config::override($key, $value); + return $self->{$key} = $value; # cache it +} + +sub _fetch_string { + my($self, $key) = @_; EOT @@ -297,7 +315,7 @@ $fetch_string .= <<'EOT'; # So we can say "if $Config{'foo'}". $value = undef if $value eq 'undef'; - $self->{$key} = $value; # cache it + return $value; } EOT @@ -701,16 +719,26 @@ # Sanity check needed to stop an infite loop if Config_heavy.pl fails to define # &launcher for some reason (eg it got truncated) -$config_txt .= sprintf <<'ENDOFTIE', $fast_config; +$Config_heavy =~ m,([^/\\]+)$,; # basename +$config_txt .= sprintf <<'ENDOFTIE', $1, $1, $fast_config; sub DESTROY { } sub AUTOLOAD { - require 'Config_heavy.pl'; + my $config_heavy = '%s'; + if (defined &ActivePerl::_CONFIG_HEAVY) { + $config_heavy = ActivePerl::_CONFIG_HEAVY(); + } + require $config_heavy; goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/; die "&Config::AUTOLOAD failed on $Config::AUTOLOAD"; } +sub __unused { + # XXX Keep PerlApp happy + require '%s'; +} + # tie returns the object, so the value returned to require will be true. tie %%Config, 'Config', { %s}; @@ -1002,7 +1030,7 @@ sitelibexp: 4305 privlibexp: 4163 ldlibpthname: 4041 -libpth: 2134 +#libpth: 2134 archname: 1591 exe_ext: 1256 scriptdir: 1155 @@ -1015,18 +1043,18 @@ intsize: 759 usevendorprefix: 642 dlsrc: 624 -cc: 541 -lib_ext: 520 +#cc: 541 +#lib_ext: 520 so: 512 -ld: 501 -ccdlflags: 500 -ldflags: 495 -obj_ext: 495 -cccdlflags: 493 -lddlflags: 493 -ar: 492 +#ld: 501 +#ccdlflags: 500 +#ldflags: 495 +#obj_ext: 495 +#cccdlflags: 493 +#lddlflags: 493 +#ar: 492 dlext: 492 -libc: 492 +#libc: 492 ranlib: 492 full_ar: 491 vendorarchexp: 491 @@ -1058,20 +1086,20 @@ siteprefixexp: 336 installbin: 335 usedl: 332 -ccflags: 285 +#ccflags: 285 startperl: 232 -optimize: 231 +#optimize: 231 usemymalloc: 229 -cpprun: 228 +#cpprun: 228 sharpbang: 228 -perllibs: 225 +#perllibs: 225 usesfio: 224 usethreads: 220 perlpath: 218 extensions: 217 usesocks: 208 shellflags: 198 -make: 191 +#make: 191 d_pwage: 189 d_pwchange: 189 d_pwclass: 189 @@ -1080,10 +1108,10 @@ d_pwgecos: 189 d_pwpasswd: 189 d_pwquota: 189 -gccversion: 189 -libs: 186 +#gccversion: 189 +#libs: 186 useshrplib: 186 -cppflags: 185 +#cppflags: 185 ptrsize: 185 shrpenv: 185 static_ext: 185 @@ -1091,6 +1119,6 @@ uselargefiles: 185 alignbytes: 184 byteorder: 184 -ccversion: 184 +#ccversion: 184 config_args: 184 -cppminus: 184 +#cppminus: 184 diff -ruN perl-5.8.x/cygwin/cygwin.c AP822_source/cygwin/cygwin.c --- perl-5.8.x/cygwin/cygwin.c 2007-03-23 16:20:28.000000000 -0700 +++ AP822_source/cygwin/cygwin.c 2007-08-01 10:17:40.435139605 -0700 @@ -11,6 +11,7 @@ #include #include #include +#include /* * pp_system() implemented via spawn() @@ -196,17 +197,21 @@ void init_os_extras(void) { - char *file = __FILE__; - CV *cv; dTHX; + char *file = __FILE__; + void *handle; newXS("Cwd::cwd", Cygwin_cwd, file); newXS("Cygwin::winpid_to_pid", XS_Cygwin_winpid_to_pid, file); newXS("Cygwin::pid_to_winpid", XS_Cygwin_pid_to_winpid, file); - if ((cv = get_cv("Win32CORE::bootstrap", 0))) { - dSP; - PUSHMARK(SP); - (void)call_sv((SV *)cv, G_EVAL|G_DISCARD|G_VOID); + /* Initialize Win32CORE if it has been statically linked. */ + handle = dlopen(NULL, RTLD_LAZY); + if (handle) { + void (*pfn_init)(pTHX); + pfn_init = (void (*)(pTHX))dlsym(handle, "init_Win32CORE"); + if (pfn_init) + pfn_init(aTHX); + dlclose(handle); } } diff -ruN perl-5.8.x/cygwin/perlld.in AP822_source/cygwin/perlld.in --- perl-5.8.x/cygwin/perlld.in 2006-06-13 12:30:49.000000000 -0700 +++ AP822_source/cygwin/perlld.in 2007-08-01 10:17:40.436139430 -0700 @@ -64,6 +64,7 @@ $command .=" -Wl,--out-implib=$libname.dll$LIB_EXT" if $LIB_EXT; $command .=" -Wl,--export-all-symbols" if $EXPORT_ALL; $command .=" -Wl,--enable-auto-import -Wl,--stack,8388608"; # always + $command .=" -Wl,--enable-auto-image-base"; # always # other args are passed through shellexec("$command \\\n$args\n"); diff -ruN perl-5.8.x/dosish.h AP822_source/dosish.h --- perl-5.8.x/dosish.h 2007-03-10 10:40:30.000000000 -0800 +++ AP822_source/dosish.h 2007-08-01 10:17:40.468133845 -0700 @@ -17,7 +17,7 @@ # define BIT_BUCKET "nul" # define OP_BINARY O_BINARY # define PERL_SYS_INIT(c,v) \ - MALLOC_CHECK_TAINT2(*c,*v) Perl_DJGPP_init(c,v); PERLIO_INIT + MALLOC_CHECK_TAINT2(*c,*v) Perl_DJGPP_init(c,v) # define init_os_extras Perl_init_os_extras # define HAS_UTIME # define HAS_KILL @@ -33,17 +33,17 @@ #else /* DJGPP */ # ifdef WIN32 # define PERL_SYS_INIT(c,v) \ - MALLOC_CHECK_TAINT2(*c,*v) Perl_win32_init(c,v); PERLIO_INIT + MALLOC_CHECK_TAINT2(*c,*v) Perl_win32_init(c,v) # define PERL_SYS_TERM() Perl_win32_term() # define BIT_BUCKET "nul" # else # ifdef NETWARE # define PERL_SYS_INIT(c,v) \ - MALLOC_CHECK_TAINT2(*c,*v) Perl_nw5_init(c,v); PERLIO_INIT + MALLOC_CHECK_TAINT2(*c,*v) Perl_nw5_init(c,v) # define BIT_BUCKET "nwnul" # else # define PERL_SYS_INIT(c,v) \ - MALLOC_CHECK_TAINT2(*c,*v); PERLIO_INIT + MALLOC_CHECK_TAINT2(*c,*v) # define BIT_BUCKET "\\dev\\nul" /* "wanna be like, umm, Newlined, or somethin?" */ # endif /* NETWARE */ # endif diff -ruN perl-5.8.x/embed.fnc AP822_source/embed.fnc --- perl-5.8.x/embed.fnc 2007-05-05 15:04:17.000000000 -0700 +++ AP822_source/embed.fnc 2007-08-01 10:17:40.520124768 -0700 @@ -127,6 +127,7 @@ ApR |I32 |block_gimme pR |int |block_start |int full p |void |boot_core_UNIVERSAL +p |void |boot_core_ActivePerl p |void |boot_core_PerlIO Ap |void |call_list |I32 oldscope|NN AV* av_list pR |bool |cando |Mode_t mode|Uid_t effective|NN Stat_t* statbufp diff -ruN perl-5.8.x/embed.h AP822_source/embed.h --- perl-5.8.x/embed.h 2007-05-05 15:04:17.000000000 -0700 +++ AP822_source/embed.h 2007-08-01 10:17:40.533122499 -0700 @@ -86,6 +86,7 @@ #ifdef PERL_CORE #define block_start Perl_block_start #define boot_core_UNIVERSAL Perl_boot_core_UNIVERSAL +#define boot_core_ActivePerl Perl_boot_core_ActivePerl #define boot_core_PerlIO Perl_boot_core_PerlIO #endif #define call_list Perl_call_list @@ -2223,6 +2224,7 @@ #ifdef PERL_CORE #define block_start(a) Perl_block_start(aTHX_ a) #define boot_core_UNIVERSAL() Perl_boot_core_UNIVERSAL(aTHX) +#define boot_core_ActivePerl() Perl_boot_core_ActivePerl(aTHX) #define boot_core_PerlIO() Perl_boot_core_PerlIO(aTHX) #endif #define call_list(a,b) Perl_call_list(aTHX_ a,b) diff -ruN perl-5.8.x/embed.pl AP822_source/embed.pl --- perl-5.8.x/embed.pl 2007-04-12 08:06:13.000000000 -0700 +++ AP822_source/embed.pl 2007-08-01 10:17:40.535122150 -0700 @@ -178,7 +178,7 @@ } else { $retval = "PERL_CALLCONV $splint_flags$retval"; - if ($flags =~ /p/) { + if ($flags =~ /[pb]/) { $func = "Perl_$func"; } } diff -ruN perl-5.8.x/epoc/epocish.h AP822_source/epoc/epocish.h --- perl-5.8.x/epoc/epocish.h 2007-02-13 13:19:40.000000000 -0800 +++ AP822_source/epoc/epocish.h 2007-08-01 10:17:40.579114469 -0700 @@ -110,7 +110,7 @@ #ifndef PERL_SYS_INIT # define PERL_SYS_INIT(c,v) \ MALLOC_CHECK_TAINT2(*c,*v) putenv(".dummy=foo"); putenv(".dummy"); \ - PERLIO_INIT; MALLOC_INIT + MALLOC_INIT #endif #ifndef PERL_SYS_TERM diff -ruN perl-5.8.x/ext/B/B/Asmdata.pm AP822_source/ext/B/B/Asmdata.pm --- perl-5.8.x/ext/B/B/Asmdata.pm 2007-03-13 10:50:38.000000000 -0700 +++ AP822_source/ext/B/B/Asmdata.pm 2007-08-01 10:17:40.614108360 -0700 @@ -19,7 +19,7 @@ our(%insn_data, @insn_name, @optype, @specialsv_name); @optype = qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP PADOP PVOP LOOP COP); -@specialsv_name = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no (SV*)pWARN_ALL (SV*)pWARN_NONE (SV*)pWARN_STD); +@specialsv_name = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no pWARN_ALL pWARN_NONE); # XXX insn_data is initialised this way because with a large # %insn_data = (foo => [...], bar => [...], ...) initialiser diff -ruN perl-5.8.x/ext/B/t/stash.t AP822_source/ext/B/t/stash.t --- perl-5.8.x/ext/B/t/stash.t 2007-02-08 08:36:13.000000000 -0800 +++ AP822_source/ext/B/t/stash.t 2007-08-01 10:17:40.811073973 -0700 @@ -58,6 +58,7 @@ print "# (after perlio censorings)\n"; print "# got = @got\n"; +@got = grep { ! /^ActivePerl$/ } @got if defined &ActivePerl::BUILD; @got = grep { ! /^Win32$/ } @got if $^O eq 'MSWin32'; @got = grep { ! /^NetWare$/ } @got if $^O eq 'NetWare'; @got = grep { ! /^(Cwd|File|File::Copy|OS2)$/ } @got if $^O eq 'os2'; diff -ruN perl-5.8.x/ext/Cwd/Changes AP822_source/ext/Cwd/Changes --- perl-5.8.x/ext/Cwd/Changes 2007-02-05 10:09:43.000000000 -0800 +++ AP822_source/ext/Cwd/Changes 2007-08-01 10:17:40.885061056 -0700 @@ -1,5 +1,16 @@ Revision history for Perl distribution PathTools. + - Added a workaround for auto-vivication-of-function-args Perl bug + (triggered by OS/2-specific code). [Ilya Zakharevich] + + - Sync with a bleadperl change: miniperl can no longer use Win32::* + functions because it cannot load Win32.dll. [Jan Dubois] + + - We only need to load ppport.h when building outside the core, so we + avoid using it when in the core. + +3.24 - Sun Nov 19 22:52:49 2006 + - Fixed a bug in the $ENV{PWD}-updating of Cwd::chdir() when a dirhandle is passed in. [Steve Peters] diff -ruN perl-5.8.x/ext/Cwd/Cwd.xs AP822_source/ext/Cwd/Cwd.xs --- perl-5.8.x/ext/Cwd/Cwd.xs 2007-02-05 10:09:43.000000000 -0800 +++ AP822_source/ext/Cwd/Cwd.xs 2007-08-01 10:17:40.886060881 -0700 @@ -1,8 +1,10 @@ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" -#define NEED_sv_2pv_nolen -#include "ppport.h" +#ifndef NO_PPPORT_H +# define NEED_sv_2pv_nolen +# include "ppport.h" +#endif #ifdef I_UNISTD # include diff -ruN perl-5.8.x/ext/Cwd/Makefile.PL AP822_source/ext/Cwd/Makefile.PL --- perl-5.8.x/ext/Cwd/Makefile.PL 2006-06-13 12:30:53.000000000 -0700 +++ AP822_source/ext/Cwd/Makefile.PL 2007-08-01 10:17:40.907057215 -0700 @@ -1,5 +1,7 @@ +# core-only Makefile.PL use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Cwd', VERSION_FROM => '../../lib/Cwd.pm', + 'DEFINE' => '-DNO_PPPORT_H', ); diff -ruN perl-5.8.x/ext/DynaLoader/DynaLoader_pm.PL AP822_source/ext/DynaLoader/DynaLoader_pm.PL --- perl-5.8.x/ext/DynaLoader/DynaLoader_pm.PL 2007-02-04 10:52:17.000000000 -0800 +++ AP822_source/ext/DynaLoader/DynaLoader_pm.PL 2007-08-01 10:17:41.426966447 -0700 @@ -92,7 +92,7 @@ require Carp; BEGIN { - $VERSION = '1.08'; + $VERSION = '1.0801'; } # See http://rt.perl.org/rt3//Public/Bug/Display.html?id=32539 @@ -518,13 +518,19 @@ my(@names, $name); # what filenames to look for if (m:-l: ) { # convert -lname to appropriate library name s/-l//; - push(@names,"lib$_.<<=to_string($Config::Config{'so'})>>"); + push(@names,"lib$_.<<=$dl_so>>"); push(@names,"lib$_.a"); } else { # Umm, a bare name. Try various alternatives: # these should be ordered with the most likely first push(@names,"$_.<<=$dl_dlext>>") unless m/\.<<=$dl_dlext>>$/o; push(@names,"$_.<<=$dl_so>>") unless m/\.<<=$dl_so>>$/o; push(@names,"lib$_.<<=$dl_so>>") unless m:/:; + <<$^O-eq-aix>> + # The AIX linker will look for shared objects in both .so and .a files + # if the program has been linked with the -brtl option. + push(@names,"$_.a") unless m/\.a$/o; + push(@names,"lib$_.a") unless m:/:; + <> push(@names,"$_.a") if !m/\.a$/ and $dlsrc eq "dl_dld.xs"; push(@names, $_); } diff -ruN perl-5.8.x/ext/Encode/Changes AP822_source/ext/Encode/Changes --- perl-5.8.x/ext/Encode/Changes 2007-04-25 03:14:49.000000000 -0700 +++ AP822_source/ext/Encode/Changes 2007-08-01 10:17:41.550944803 -0700 @@ -1,8 +1,52 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 2.20 2007/04/22 14:56:12 dankogai Exp dankogai $ +# $Id: Changes,v 2.23 2007/05/29 18:15:32 dankogai Exp dankogai $ # -$Revision: 2.20 $ $Date: 2007/04/22 14:56:12 $ +$Revision: 2.23 $ $Date: 2007/05/29 18:15:32 $ +! Encode.xs + got rid of global fallback_cb; encode_method() now takes one more + argument which is a coderef to fallback. This should make + encode_method() thread-safe. +! Encode.pm + Added perluniintro, perlunifaq, and perlunitut to POD +! Encode.xs + Plug a memory leak in Encode -- by rgs + Message-Id: +! Unicode/Unicode.pm + POD fixes on UTF-16LE + http://aspn.activestate.com/ASPN/Mail/Message/perl5-porters/3486118 +! Makefile.PL + man page generation is now conditional; yes by default but no if $PERL_CORE + Message-Id: + +2.22 2007/05/29 07:35:27 +! Encode.pm + from_to() does not honor the check while decoding. That's a feature. + To make sure it is a feature it is mentioned in the POD. + http://rt.cpan.org/NoAuth/Bug.html?id=27277 +! Makefile.pl + Encode used to suppress man page generation. Now it does. + http://rt.cpan.org/NoAuth/Bug.html?id=27200 +! Encode.pm Encode.xs t/fallback.t + Addressed: (de|en)code("ascii", "\x{3000}", sub{ $_[0] }) segfaults + Reported by MIYAGAWA + +2.21 2007/05/12 06:42:19 ++ lib/Encode/MIME/Name.pm t/mime-name.t +! Encode.pm Encode.xs lib/Encode/Encoding.pm + new method: mime_name() + inspired by: MIYAGAWA +! t/encoding.t + Subject: Re: Compress::Zlib, pack "C" and utf-8 [PATCH] + From: Marc Lehmann + Date: Thu, 12 Apr 2007 08:41:53 +0200 + Message-ID: <20070412064153.GA22475@schmorp.de> + http://public.activestate.com/cgi-bin/perlbrowse/p/31194 +! Unicode/Unicode.pm + POD fix. + Message-Id: <20070417220547.GA11999@zetta.zet> + +2.20 2007/04/22 14:56:12 ! Encode.pm Pod fixes. Now find_encoding() is explained more in details. + lib/Encode/GSM0338.pm @@ -26,19 +70,19 @@ Message-Id: <693254b90704060526s6d850320h71cdda50dfbf7eba@mail.gmail.com> ! Encode.pm #25216 ([PATCH] Encode.pm: postpone the load of Encode::Encoding) - http://rt.cpan.org/NoAuth/Bug.html?id=#25216 + http://rt.cpan.org/NoAuth/Bug.html?id=25216 ! lib/Encode/MIME/Header.pm t/mime-header.t #24418 (Encode::MIME::Header: wrong encoding with latin1 characters) - http://rt.cpan.org/NoAuth/Bug.html?id=#24418 + http://rt.cpan.org/NoAuth/Bug.html?id=24418 ! Encode.pm #23876 (Add documentation for LEAVE_SRC) - http://rt.cpan.org/NoAuth/Bug.html?id=#23876 + http://rt.cpan.org/NoAuth/Bug.html?id=23876 ! lib/Encode/Alias.pm t/Aliases.t #20781: Thai encoding needs alias for tis-620 - http://rt.cpan.org/NoAuth/Bug.html?id=#20781 + http://rt.cpan.org/NoAuth/Bug.html?id=20781 ! bin/piconv AUTHORS #20344: piconv: wrong conversion of utf-16le encoded files (with PATCH) - http://rt.cpan.org/NoAuth/Bug.html?id=#20344 + http://rt.cpan.org/NoAuth/Bug.html?id=20344 ! Encode.pm Encode.xs bin/enc2xs encoding.pm t/Aliases.t t/utf8strict.t Imported from bleedperl's 2.18_01 @@ -70,7 +114,7 @@ --xmlcref and --htmlcref added. ! Encode.pm Copyright Notice Added. - http://rt.cpan.org/NoAuth/Bug.html?id=#19056 + http://rt.cpan.org/NoAuth/Bug.html?id=19056 ! * Replaced remaining ^\t with q( ) x 4. -- Perl Best Practice pp. 20 And all .pm's are now perltidy-ed. @@ -78,11 +122,11 @@ 2.15 2006/04/06 15:44:11 ! Unicode/Unicode.xs Addressed: UTF-16, UTF-32, UCS, UTF-7 decoders mishandle illegal characters - http://rt.cpan.org/NoAuth/Bug.html?id=#18556 + http://rt.cpan.org/NoAuth/Bug.html?id=18556 ! Encode.pm added str2bytes() as an alias to encode() and bytes2str() as an alias to decode() - http://rt.cpan.org/NoAuth/Bug.html?id=#17103 + http://rt.cpan.org/NoAuth/Bug.html?id=17103 ! Encode.xs Change 26922: Avoid warning with MS Visual C compiler. Message-Id: <200601231245.k0NCj2dw009484@smtp3.ActiveState.com> diff -ruN perl-5.8.x/ext/Encode/Encode.pm AP822_source/ext/Encode/Encode.pm --- perl-5.8.x/ext/Encode/Encode.pm 2007-04-25 03:14:49.000000000 -0700 +++ AP822_source/ext/Encode/Encode.pm 2007-08-01 10:17:41.568941661 -0700 @@ -1,10 +1,10 @@ # -# $Id: Encode.pm,v 2.20 2007/04/22 14:56:12 dankogai Exp dankogai $ +# $Id: Encode.pm,v 2.23 2007/05/29 18:15:32 dankogai Exp dankogai $ # package Encode; use strict; use warnings; -our $VERSION = sprintf "%d.%02d", q$Revision: 2.20 $ =~ /(\d+)/g; +our $VERSION = sprintf "%d.%02d", q$Revision: 2.23 $ =~ /(\d+)/g; sub DEBUG () { 0 } use XSLoader (); XSLoader::load( __PACKAGE__, $VERSION ); @@ -144,7 +144,7 @@ Carp::croak("Unknown encoding '$name'"); } my $octets = $enc->encode( $string, $check ); - $_[1] = $string if $check and !( $check & LEAVE_SRC() ); + $_[1] = $string if $check and !ref $check and !( $check & LEAVE_SRC() ); return $octets; } *str2bytes = \&encode; @@ -160,7 +160,7 @@ Carp::croak("Unknown encoding '$name'"); } my $string = $enc->decode( $octets, $check ); - $_[1] = $octets if $check and !( $check & LEAVE_SRC() ); + $_[1] = $octets if $check and !ref $check and !( $check & LEAVE_SRC() ); return $string; } *bytes2str = \&decode; @@ -499,6 +499,20 @@ See L below. +Also note that + + from_to($octets, $from, $to, $check); + +is equivalent to + + $octets = encode($to, decode($from, $octets), $check); + +Yes, it does not respect the $check during decoding. It is +deliberately done that way. If you need minute control, C +then C as follows; + + $octets = encode($to, decode($from, $octets, $check_from), $check_to); + =item $octets = encode_utf8($string); Equivalent to C<$octets = encode("utf8", $string);> The characters @@ -565,6 +579,22 @@ See L for details. +=head2 Finding IANA Character Set Registry names + +The canonical name of a given encoding does not necessarily agree with +IANA IANA Character Set Registry, commonly seen as C<< Content-Type: +text/plain; charset=I >>. For most cases canonical names +work but sometimes it does not (notably 'utf-8-strict'). + +Therefore as of Encode version 2.21, a new method C is added. + + use Encode; + my $enc = find_encoding('UTF-8'); + warn $enc->name; # utf-8-strict + warn $enc->mime_name; # UTF-8 + +See also: L + =head1 Encoding via PerlIO If your perl supports I (which is the default), you can use a @@ -892,7 +922,7 @@ L, L, L, -L, +L, L, L, L L, the Perl Unicode Mailing List Eperl-unicode@perl.orgE diff -ruN perl-5.8.x/ext/Encode/Encode.xs AP822_source/ext/Encode/Encode.xs --- perl-5.8.x/ext/Encode/Encode.xs 2007-04-25 03:14:49.000000000 -0700 +++ AP822_source/ext/Encode/Encode.xs 2007-08-01 10:17:41.576940264 -0700 @@ -1,5 +1,5 @@ /* - $Id: Encode.xs,v 2.11 2007/04/06 12:53:41 dankogai Exp $ + $Id: Encode.xs,v 2.14 2007/05/29 18:15:32 dankogai Exp dankogai $ */ #define PERL_NO_GET_CONTEXT @@ -35,8 +35,6 @@ UTF8_ALLOW_NON_CONTINUATION | \ UTF8_ALLOW_LONG)) -static SV* fallback_cb = (SV*)NULL ; - void Encode_XSEncoding(pTHX_ encode_t * enc) { @@ -66,11 +64,11 @@ #define ERR_DECODE_NOMAP "%s \"\\x%02" UVXf "\" does not map to Unicode" static SV * -do_fallback_cb(pTHX_ UV ch) +do_fallback_cb(pTHX_ UV ch, SV *fallback_cb) { dSP; int argc; - SV* retval; + SV *temp, *retval; ENTER; SAVETMPS; PUSHMARK(sp); @@ -79,18 +77,22 @@ argc = call_sv(fallback_cb, G_SCALAR); SPAGAIN; if (argc != 1){ - croak("fallback sub must return scalar!"); + croak("fallback sub must return scalar!"); } - retval = newSVsv(POPs); + temp = newSVsv(POPs); PUTBACK; FREETMPS; LEAVE; + retval = newSVpv("",0); + sv_catsv(retval, temp); + SvREFCNT_dec(temp); return retval; } static SV * encode_method(pTHX_ const encode_t * enc, const encpage_t * dir, SV * src, - int check, STRLEN * offset, SV * term, int * retcode) + int check, STRLEN * offset, SV * term, int * retcode, + SV *fallback_cb) { STRLEN slen; U8 *s = (U8 *) SvPV(src, slen); @@ -192,8 +194,9 @@ } if (check & (ENCODE_PERLQQ|ENCODE_HTMLCREF|ENCODE_XMLCREF)){ SV* subchar = - (fallback_cb != (SV*)NULL) ? do_fallback_cb(aTHX_ ch) : - newSVpvf(check & ENCODE_PERLQQ ? "\\x{%04"UVxf"}" : + (fallback_cb != &PL_sv_undef) + ? do_fallback_cb(aTHX_ ch, fallback_cb) + : newSVpvf(check & ENCODE_PERLQQ ? "\\x{%04"UVxf"}" : check & ENCODE_HTMLCREF ? "&#%" UVuf ";" : "&#x%" UVxf ";", (UV)ch); sdone += slen + clen; @@ -226,9 +229,9 @@ if (check & (ENCODE_PERLQQ|ENCODE_HTMLCREF|ENCODE_XMLCREF)){ SV* subchar = - (fallback_cb != (SV*)NULL) ? - do_fallback_cb(aTHX_ (UV)s[slen]) : - newSVpvf("\\x%02" UVXf, (UV)s[slen]); + (fallback_cb != &PL_sv_undef) + ? do_fallback_cb(aTHX_ (UV)s[slen], fallback_cb) + : newSVpvf("\\x%02" UVXf, (UV)s[slen]); sdone += slen + 1; ddone += dlen + SvCUR(subchar); sv_catsv(dst, subchar); @@ -539,23 +542,31 @@ } void -Method_cat_decode(obj, dst, src, off, term, check = 0) +Method_cat_decode(obj, dst, src, off, term, check_sv = &PL_sv_no) SV * obj SV * dst SV * src SV * off SV * term -int check +SV * check_sv CODE: { + int check; + SV *fallback_cb = &PL_sv_undef; encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj))); STRLEN offset = (STRLEN)SvIV(off); int code = 0; if (SvUTF8(src)) { sv_utf8_downgrade(src, FALSE); } + if (SvROK(check_sv)){ + fallback_cb = check_sv; + check = ENCODE_PERLQQ|ENCODE_LEAVE_SRC; /* same as FB_PERLQQ */ + }else{ + check = SvIV(check_sv); + } sv_catsv(dst, encode_method(aTHX_ enc, enc->t_utf8, src, check, - &offset, term, &code)); + &offset, term, &code, fallback_cb)); SvIV_set(off, (IV)offset); if (code == ENCODE_FOUND_TERM) { ST(0) = &PL_sv_yes; @@ -573,29 +584,23 @@ CODE: { int check; + SV *fallback_cb = &PL_sv_undef; encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj))); if (SvUTF8(src)) { sv_utf8_downgrade(src, FALSE); } if (SvROK(check_sv)){ - if (fallback_cb == (SV*)NULL){ - fallback_cb = newSVsv(check_sv); /* First time */ - }else{ - SvSetSV(fallback_cb, check_sv); /* Been here before */ - } - check = ENCODE_PERLQQ|ENCODE_LEAVE_SRC; /* same as FB_PERLQQ */ + fallback_cb = check_sv; + check = ENCODE_PERLQQ|ENCODE_LEAVE_SRC; /* same as FB_PERLQQ */ }else{ - fallback_cb = (SV*)NULL; - check = SvIV(check_sv); + check = SvIV(check_sv); } ST(0) = encode_method(aTHX_ enc, enc->t_utf8, src, check, - NULL, Nullsv, NULL); + NULL, Nullsv, NULL, fallback_cb); SvUTF8_on(ST(0)); XSRETURN(1); } - - void Method_encode(obj,src,check_sv = &PL_sv_no) SV * obj @@ -604,21 +609,17 @@ CODE: { int check; + SV *fallback_cb = &PL_sv_undef; encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj))); sv_utf8_upgrade(src); if (SvROK(check_sv)){ - if (fallback_cb == (SV*)NULL){ - fallback_cb = newSVsv(check_sv); /* First time */ - }else{ - SvSetSV(fallback_cb, check_sv); /* Been here before */ - } - check = ENCODE_PERLQQ|ENCODE_LEAVE_SRC; /* same as FB_PERLQQ */ + fallback_cb = check_sv; + check = ENCODE_PERLQQ|ENCODE_LEAVE_SRC; /* same as FB_PERLQQ */ }else{ - fallback_cb = (SV*)NULL; - check = SvIV(check_sv); + check = SvIV(check_sv); } ST(0) = encode_method(aTHX_ enc, enc->f_utf8, src, check, - NULL, Nullsv, NULL); + NULL, Nullsv, NULL, fallback_cb); XSRETURN(1); } @@ -650,6 +651,35 @@ XSRETURN(1); } +void +Method_mime_name(obj) +SV * obj +CODE: +{ + encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj))); + SV *retval; + eval_pv("require Encode::MIME::Name", 0); + + if (SvTRUE(get_sv("@", 0))) { + ST(0) = &PL_sv_undef; + }else{ + ENTER; + SAVETMPS; + PUSHMARK(sp); + XPUSHs(sv_2mortal(newSVpvn(enc->name[0], strlen(enc->name[0])))); + PUTBACK; + call_pv("Encode::MIME::Name::get_mime_name", G_SCALAR); + SPAGAIN; + retval = newSVsv(POPs); + PUTBACK; + FREETMPS; + LEAVE; + /* enc->name[0] */ + ST(0) = retval; + } + XSRETURN(1); +} + MODULE = Encode PACKAGE = Encode PROTOTYPES: ENABLE diff -ruN perl-5.8.x/ext/Encode/Makefile.PL AP822_source/ext/Encode/Makefile.PL --- perl-5.8.x/ext/Encode/Makefile.PL 2007-04-25 03:14:49.000000000 -0700 +++ AP822_source/ext/Encode/Makefile.PL 2007-08-01 10:17:41.610934329 -0700 @@ -1,10 +1,15 @@ +# +# $Id: Makefile.PL,v 2.5 2007/05/29 18:15:32 dankogai Exp dankogai $ +# use 5.007003; +use strict; +use warnings; use ExtUtils::MakeMaker; # Just for sure :) -my %ARGV = map { split /=/; defined $_[1] or $_[1]=1; @_ } @ARGV; +my %ARGV = map { my @r = split /=/,$_; defined $r[1] or $r[1]=1; @r } @ARGV; $ARGV{DEBUG} and warn "$_ => $ARGV{$_}\n" for keys %ARGV; -$ENV{PERL_CORE} ||= $ARGV{PERL_CORE}; +$ENV{PERL_CORE} ||= $ARGV{PERL_CORE} if $ARGV{PERL_CORE}; my %tables = ( @@ -25,6 +30,8 @@ $ARGV{MORE_SCRIOPTS} and push @exe_files, @more_exe_files; $ARGV{INSTALL_UCM} and push @pmlibdirs, "ucm"; +my @man = (); +@man = ( MAN1PODS => {}, MAN3PODS => {} ) if $ENV{PERL_CORE}; WriteMakefile( NAME => "Encode", @@ -36,8 +43,7 @@ SUFFIX => 'gz', DIST_DEFAULT => 'all tardist', }, - MAN1PODS => {}, - MAN3PODS => {}, + @man, INC => "-I./Encode", PMLIBDIRS => \@pmlibdirs, INSTALLDIRS => 'perl', diff -ruN perl-5.8.x/ext/Encode/Unicode/Unicode.pm AP822_source/ext/Encode/Unicode/Unicode.pm --- perl-5.8.x/ext/Encode/Unicode/Unicode.pm 2006-06-13 12:30:55.000000000 -0700 +++ AP822_source/ext/Encode/Unicode/Unicode.pm 2007-08-01 10:17:41.640929093 -0700 @@ -4,7 +4,7 @@ use warnings; no warnings 'redefine'; -our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.5 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); @@ -97,14 +97,14 @@ Decodes from ord(N) Encodes chr(N) to... octet/char BOM S.P d800-dfff ord > 0xffff \x{1abcd} == ---------------+-----------------+------------------------------ - UCS-2BE 2 N N is bogus Not Available + UCS-2BE 2 N N is bogus Not Available UCS-2LE 2 N N bogus Not Available UTF-16 2/4 Y Y is S.P S.P BE/LE UTF-16BE 2/4 N Y S.P S.P 0xd82a,0xdfcd - UTF-16LE 2 N Y S.P S.P 0x2ad8,0xcddf - UTF-32 4 Y - is bogus As is BE/LE - UTF-32BE 4 N - bogus As is 0x0001abcd - UTF-32LE 4 N - bogus As is 0xcdab0100 + UTF-16LE 2/4 N Y S.P S.P 0x2ad8,0xcddf + UTF-32 4 Y - is bogus As is BE/LE + UTF-32BE 4 N - bogus As is 0x0001abcd + UTF-32LE 4 N - bogus As is 0xcdab0100 UTF-8 1-4 - - bogus >= 4 octets \xf0\x9a\af\8d ---------------+-----------------+------------------------------ @@ -158,7 +158,7 @@ 16 32 bits/char ------------------------- BE 0xFeFF 0x0000FeFF - LE 0xFFeF 0xFFFe0000 + LE 0xFFFe 0xFFFe0000 ------------------------- =back diff -ruN perl-5.8.x/ext/Encode/encoding.pm AP822_source/ext/Encode/encoding.pm --- perl-5.8.x/ext/Encode/encoding.pm 2007-04-25 03:14:49.000000000 -0700 +++ AP822_source/ext/Encode/encoding.pm 2007-08-01 10:17:41.683921587 -0700 @@ -1,4 +1,4 @@ -# $Id: encoding.pm,v 2.6 2007/04/22 14:56:12 dankogai Exp dankogai $ +# $Id: encoding.pm,v 2.6 2007/04/22 14:56:12 dankogai Exp $ package encoding; our $VERSION = do { my @r = ( q$Revision: 2.6 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; diff -ruN perl-5.8.x/ext/Encode/lib/Encode/Encoding.pm AP822_source/ext/Encode/lib/Encode/Encoding.pm --- perl-5.8.x/ext/Encode/lib/Encode/Encoding.pm 2007-01-27 15:51:00.000000000 -0800 +++ AP822_source/ext/Encode/lib/Encode/Encoding.pm 2007-08-01 10:17:41.698918969 -0700 @@ -3,7 +3,7 @@ # Base class for classes which implement encodings use strict; use warnings; -our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.5 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; require Encode; @@ -20,6 +20,11 @@ sub name { return shift->{'Name'} } +sub mime_name{ + require Encode::MIME::Name; + return Encode::MIME::Name::get_mime_name(shift->name); +} + # sub renew { return $_[0] } sub renew { @@ -178,6 +183,17 @@ MUST return the string representing the canonical name of the encoding. +=item -Emime_name + +Predefined As: + + sub mime_name{ + require Encode::MIME::Name; + return Encode::MIME::Name::get_mime_name(shift->name); + } + +MUST return the string representing the IANA charset name of the encoding. + =item -Erenew Predefined As: diff -ruN perl-5.8.x/ext/Encode/lib/Encode/MIME/Name.pm AP822_source/ext/Encode/lib/Encode/MIME/Name.pm --- perl-5.8.x/ext/Encode/lib/Encode/MIME/Name.pm 1969-12-31 16:00:00.000000000 -0800 +++ AP822_source/ext/Encode/lib/Encode/MIME/Name.pm 2007-08-01 10:17:41.717915652 -0700 @@ -0,0 +1,94 @@ +package Encode::MIME::Name; +use strict; +use warnings; +our $VERSION = do { my @r = ( q$Revision: 1.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; + +our %MIME_NAME_OF = ( + 'AdobeStandardEncoding' => 'Adobe-Standard-Encoding', + 'AdobeSymbol' => 'Adobe-Symbol-Encoding', + 'ascii' => 'US-ASCII', + 'big5-hkscs' => 'Big5-HKSCS', + 'cp1026' => 'IBM1026', + 'cp1047' => 'IBM1047', + 'cp1250' => 'windows-1250', + 'cp1251' => 'windows-1251', + 'cp1252' => 'windows-1252', + 'cp1253' => 'windows-1253', + 'cp1254' => 'windows-1254', + 'cp1255' => 'windows-1255', + 'cp1256' => 'windows-1256', + 'cp1257' => 'windows-1257', + 'cp1258' => 'windows-1258', + 'cp37' => 'IBM037', + 'cp424' => 'IBM424', + 'cp437' => 'IBM437', + 'cp500' => 'IBM500', + 'cp775' => 'IBM775', + 'cp850' => 'IBM850', + 'cp852' => 'IBM852', + 'cp855' => 'IBM855', + 'cp857' => 'IBM857', + 'cp860' => 'IBM860', + 'cp861' => 'IBM861', + 'cp862' => 'IBM862', + 'cp863' => 'IBM863', + 'cp864' => 'IBM864', + 'cp865' => 'IBM865', + 'cp866' => 'IBM866', + 'cp869' => 'IBM869', + 'cp936' => 'GBK', + 'euc-jp' => 'EUC-JP', + 'euc-kr' => 'EUC-KR', + #'gb2312-raw' => 'GB2312', # no, you're wrong, I18N::Charset + 'hp-roman8' => 'hp-roman8', + 'hz' => 'HZ-GB-2312', + 'iso-2022-jp' => 'ISO-2022-JP', + 'iso-2022-jp-1' => 'ISO-2022-JP', + 'iso-2022-kr' => 'ISO-2022-KR', + 'iso-8859-1' => 'ISO-8859-1', + 'iso-8859-10' => 'ISO-8859-10', + 'iso-8859-13' => 'ISO-8859-13', + 'iso-8859-14' => 'ISO-8859-14', + 'iso-8859-15' => 'ISO-8859-15', + 'iso-8859-16' => 'ISO-8859-16', + 'iso-8859-2' => 'ISO-8859-2', + 'iso-8859-3' => 'ISO-8859-3', + 'iso-8859-4' => 'ISO-8859-4', + 'iso-8859-5' => 'ISO-8859-5', + 'iso-8859-6' => 'ISO-8859-6', + 'iso-8859-7' => 'ISO-8859-7', + 'iso-8859-8' => 'ISO-8859-8', + 'iso-8859-9' => 'ISO-8859-9', + #'jis0201-raw' => 'JIS_X0201', + #'jis0208-raw' => 'JIS_C6226-1983', + #'jis0212-raw' => 'JIS_X0212-1990', + 'koi8-r' => 'KOI8-R', + 'koi8-u' => 'KOI8-U', + #'ksc5601-raw' => 'KS_C_5601-1987', + 'shiftjis' => 'Shift_JIS', + 'UTF-16' => 'UTF-16', + 'UTF-16BE' => 'UTF-16BE', + 'UTF-16LE' => 'UTF-16LE', + 'UTF-32' => 'UTF-32', + 'UTF-32BE' => 'UTF-32BE', + 'UTF-32LE' => 'UTF-32LE', + 'UTF-7' => 'UTF-7', + 'utf8' => 'UTF-8', + 'utf-8-strict' => 'UTF-8', + 'viscii' => 'VISCII', +); + +sub get_mime_name($) { $MIME_NAME_OF{$_[0]} }; + +1; +__END__ + +=head1 NAME + +Encode::MIME::NAME -- internally used by Encode + +=head1 SEE ALSO + +L + +=cut diff -ruN perl-5.8.x/ext/Encode/t/encoding.t AP822_source/ext/Encode/t/encoding.t --- perl-5.8.x/ext/Encode/t/encoding.t 2006-06-13 12:30:56.000000000 -0700 +++ AP822_source/ext/Encode/t/encoding.t 2007-08-01 10:17:41.783904131 -0700 @@ -57,7 +57,7 @@ print "ok 8\n"; # the first octet of UTF-8 encoded 0x3af -print "not " unless unpack("C", chr(0xdf)) == 0xce; +print "not " unless unpack("U0 C", chr(0xdf)) == 0xce; print "ok 9\n"; print "not " unless unpack("U", pack("U", 0xdf)) == 0xdf; diff -ruN perl-5.8.x/ext/Encode/t/fallback.t AP822_source/ext/Encode/t/fallback.t --- perl-5.8.x/ext/Encode/t/fallback.t 2006-06-13 12:30:56.000000000 -0700 +++ AP822_source/ext/Encode/t/fallback.t 2007-08-01 10:17:41.784903957 -0700 @@ -17,7 +17,7 @@ use strict; #use Test::More qw(no_plan); -use Test::More tests => 44; +use Test::More tests => 48; use Encode q(:all); my $uo = ''; @@ -163,3 +163,15 @@ $dst = $ascii->decode($src, sub{ sprintf "[%02X]", shift }); is($dst, $uc, "coderef decode"); is($src, $ao, "coderef residue decode"); + +$src = "\x{3000}"; +$dst = $ascii->encode($src, sub{ $_[0] }); +is $dst, 0x3000."", qq{$ascii->encode(\$src, sub{ \$_[0] } )}; +$dst = encode("ascii", "\x{3000}", sub{ $_[0] }); +is $dst, 0x3000."", qq{encode("ascii", "\\x{3000}", sub{ \$_[0] })}; + +$src = pack "C*", 0xFF; +$dst = $ascii->decode($src, sub{ $_[0] }); +is $dst, 0xFF."", qq{$ascii->encode(\$src, sub{ \$_[0] } )}; +$dst = decode("ascii", (pack "C*", 0xFF), sub{ $_[0] }); +is $dst, 0xFF."", qq{decode("ascii", (pack "C*", 0xFF), sub{ \$_[0] })}; diff -ruN perl-5.8.x/ext/Encode/t/mime-name.t AP822_source/ext/Encode/t/mime-name.t --- perl-5.8.x/ext/Encode/t/mime-name.t 1969-12-31 16:00:00.000000000 -0800 +++ AP822_source/ext/Encode/t/mime-name.t 2007-08-01 10:17:41.800901164 -0700 @@ -0,0 +1,36 @@ +# +# $Id: mime-name.t,v 1.1 2007/05/12 06:42:19 dankogai Exp $ +# This script is written in utf8 +# +BEGIN { + if ($ENV{'PERL_CORE'}){ + chdir 't'; + unshift @INC, '../lib'; + } + require Config; import Config; + if ($Config{'extensions'} !~ /\bEncode\b/) { + print "1..0 # Skip: Encode was not built\n"; + exit 0; + } + if (ord("A") == 193) { + print "1..0 # Skip: EBCDIC\n"; + exit 0; + } + $| = 1; +} + +use strict; +use warnings; +use Encode; +#use Test::More qw(no_plan); +use Test::More tests => 68; + +use_ok("Encode::MIME::Name"); +for my $canon ( sort keys %Encode::MIME::Name::MIME_NAME_OF ) { + my $enc = find_encoding($canon); + my $mime_name = $Encode::MIME::Name::MIME_NAME_OF{$canon}; + is $enc->mime_name, $mime_name, + qq(\$enc->mime_name("$canon") eq $mime_name); +} + +__END__; diff -ruN perl-5.8.x/ext/Filter/Util/Call/Call.pm AP822_source/ext/Filter/Util/Call/Call.pm --- perl-5.8.x/ext/Filter/Util/Call/Call.pm 2006-06-13 12:31:06.000000000 -0700 +++ AP822_source/ext/Filter/Util/Call/Call.pm 2007-08-01 10:17:43.183659755 -0700 @@ -18,7 +18,7 @@ @ISA = qw(Exporter DynaLoader); @EXPORT = qw( filter_add filter_del filter_read filter_read_exact) ; -$VERSION = "1.0601" ; +$VERSION = "1.07" ; sub filter_read_exact($) { @@ -72,7 +72,7 @@ =head1 DESCRIPTION This module provides you with the framework to write I -in Perl. +in Perl. An alternate interface to Filter::Util::Call is now available. See L for more details. @@ -116,7 +116,7 @@ my($type, @arguments) = @_ ; filter_add( - sub + sub { my($status) ; $status = filter_read() ; @@ -129,7 +129,7 @@ To make use of either of the two filter modules above, place the line below in a Perl source file. - use MyFilter; + use MyFilter; In fact, the skeleton modules shown above are fully functional I, albeit fairly useless ones. All they does is filter the @@ -354,7 +354,7 @@ unless @_ == 3 ; my ($self, $from, $to) = @_ ; filter_add( - sub + sub { my ($status) ; s/$from/$to/ @@ -451,8 +451,8 @@ croak("usage: use Subst qw(start stop from to)") unless @_ == 5 ; - filter_add( - sub + filter_add( + sub { my ($status) ; @@ -488,7 +488,7 @@ =head1 AUTHOR -Paul Marquess +Paul Marquess =head1 DATE diff -ruN perl-5.8.x/ext/Filter/Util/Call/Call.xs AP822_source/ext/Filter/Util/Call/Call.xs --- perl-5.8.x/ext/Filter/Util/Call/Call.xs 2007-01-13 09:39:16.000000000 -0800 +++ AP822_source/ext/Filter/Util/Call/Call.xs 2007-08-01 10:17:43.187659057 -0700 @@ -25,6 +25,9 @@ #define FILTER_ACTIVE(s) IoLINES(s) #define BUF_OFFSET(sv) IoPAGE_LEN(sv) #define CODE_REF(sv) IoPAGE(sv) +#ifndef PERL_FILTER_EXISTS +# define PERL_FILTER_EXISTS(i) (PL_rsfp_filters && (i) <= av_len(PL_rsfp_filters)) +#endif #define SET_LEN(sv,len) \ do { SvPVX(sv)[len] = '\0'; SvCUR_set(sv, len); } while (0) @@ -235,7 +238,7 @@ filter_del() CODE: dMY_CXT; - if (PL_rsfp_filters && IDX <= av_len(PL_rsfp_filters) && FILTER_DATA(IDX) && FILTER_ACTIVE(FILTER_DATA(IDX))) + if (PERL_FILTER_EXISTS(IDX) && FILTER_DATA(IDX) && FILTER_ACTIVE(FILTER_DATA(IDX))) FILTER_ACTIVE(FILTER_DATA(IDX)) = FALSE ; diff -ruN perl-5.8.x/ext/POSIX/POSIX.pm AP822_source/ext/POSIX/POSIX.pm --- perl-5.8.x/ext/POSIX/POSIX.pm 2007-03-22 14:22:47.000000000 -0700 +++ AP822_source/ext/POSIX/POSIX.pm 2007-08-01 10:17:43.510602676 -0700 @@ -4,7 +4,7 @@ our(@ISA, %EXPORT_TAGS, @EXPORT_OK, @EXPORT, $AUTOLOAD, %SIGRT) = (); -our $VERSION = "1.12"; +our $VERSION = "1.1201"; use AutoLoader; @@ -64,6 +64,8 @@ use AutoLoader 'AUTOLOAD'; +sub new { bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0, SAFE => 0}, $_[0] } + package POSIX::SigRt; use AutoLoader 'AUTOLOAD'; @@ -987,7 +989,6 @@ package POSIX::SigAction; -sub new { bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0, SAFE => 0}, $_[0] } sub handler { $_[0]->{HANDLER} = $_[1] if @_ > 1; $_[0]->{HANDLER} }; sub mask { $_[0]->{MASK} = $_[1] if @_ > 1; $_[0]->{MASK} }; sub flags { $_[0]->{FLAGS} = $_[1] if @_ > 1; $_[0]->{FLAGS} }; diff -ruN perl-5.8.x/ext/POSIX/POSIX.xs AP822_source/ext/POSIX/POSIX.xs --- perl-5.8.x/ext/POSIX/POSIX.xs 2007-05-04 14:11:13.000000000 -0700 +++ AP822_source/ext/POSIX/POSIX.xs 2007-08-01 10:17:43.535598312 -0700 @@ -17,6 +17,11 @@ #define PERLIO_NOT_STDIO 1 #include "perl.h" #include "XSUB.h" + +#ifdef __hpux +# include "hpux_portable_uname.h" +#endif + #if defined(PERL_IMPLICIT_SYS) # undef signal # undef open diff -ruN perl-5.8.x/ext/POSIX/hpux_portable_uname.h AP822_source/ext/POSIX/hpux_portable_uname.h --- perl-5.8.x/ext/POSIX/hpux_portable_uname.h 1969-12-31 16:00:00.000000000 -0800 +++ AP822_source/ext/POSIX/hpux_portable_uname.h 2007-08-01 10:17:43.574591504 -0700 @@ -0,0 +1,60 @@ +#include +#include +#include + + +#define UNAME_V1 "uname" +#define UNAME_V2 "uname{20040821}" +#define SNLEN_V1 15 +#define SNLEN_V2 257 +#define UTSLEN_V1 9 +#define UTSLEN_V2 257 + +typedef struct portable_utsname +{ + char *sysname; + char *nodename; + char *release; + char *version; + char *machine; + char *idnumber; + int utslen; + int snlen; + char infop[UTSLEN_V2 * 7 + UTSLEN_V2]; +} portable_utsname; + +typedef int (*uname_ptr) (void *); + +static int portable_uname(portable_utsname * info) +{ + Dl_info dlinfo; + uname_ptr thisuname; + char **infoc = NULL; + char *c; + int i; + + dladdr((void *) &malloc, &dlinfo); + + if (thisuname = (uname_ptr) dlsym(dlinfo.dli_fbase, UNAME_V2)) { + info->snlen = SNLEN_V2; + info->utslen = UTSLEN_V2; + } + else { + thisuname = (uname_ptr)&uname; + info->snlen = SNLEN_V1; + info->utslen = UTSLEN_V1; + } + + thisuname(info->infop); + + infoc = (char **) info; + c = info->infop; + for (i = 0; i < 6; i++) { + infoc[i] = c; + c += info->utslen; + } + +} + +#define uname portable_uname +#define utsname portable_utsname diff -ruN perl-5.8.x/ext/Sys/Hostname/Hostname.pm AP822_source/ext/Sys/Hostname/Hostname.pm --- perl-5.8.x/ext/Sys/Hostname/Hostname.pm 2006-06-13 12:31:08.000000000 -0700 +++ AP822_source/ext/Sys/Hostname/Hostname.pm 2007-08-01 10:17:43.860541582 -0700 @@ -15,7 +15,7 @@ our $host; BEGIN { - $VERSION = '1.11'; + $VERSION = '1.1101'; { local $SIG{__DIE__}; eval { diff -ruN perl-5.8.x/ext/Sys/Hostname/Hostname.xs AP822_source/ext/Sys/Hostname/Hostname.xs --- perl-5.8.x/ext/Sys/Hostname/Hostname.xs 2006-06-13 12:31:08.000000000 -0700 +++ AP822_source/ext/Sys/Hostname/Hostname.xs 2007-08-01 10:17:43.875538963 -0700 @@ -6,6 +6,15 @@ # include #endif +/* On HP-UX, there are 2 versions of MAXHOSTNAMELEN (64/256) + * depending on large-hostname support or not. Pick the larger + * one so we can work on either one. Bug 52118 + */ +#if defined(__hpux) +# undef MAXHOSTNAMELEN +# define MAXHOSTNAMELEN 256 +#endif + /* a reasonable default */ #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 256 diff -ruN perl-5.8.x/ext/Sys/Syslog/t/syslog.t AP822_source/ext/Sys/Syslog/t/syslog.t --- perl-5.8.x/ext/Sys/Syslog/t/syslog.t 2007-02-12 14:43:06.000000000 -0800 +++ AP822_source/ext/Sys/Syslog/t/syslog.t 2007-08-01 10:17:43.912532505 -0700 @@ -146,6 +146,9 @@ like( $@, '/^syslog: too many facilities given: local1/', "syslog() called with level 'info,notice'" ); ok( !$r, "syslog() should return false: '$r'" ); + skip("stream doesn't really work on Linux 2.2", 6) + if $^O eq "linux" && $sock_type eq "stream" && $Config{osvers} =~ /^2\.2\./; + # syslog() with level "info" (as a string), should pass $r = eval { syslog('info', "$test_string by connecting to a $sock_type socket (errno=%m)") } || 0; is( $@, '', "syslog() called with level 'info' (string)" ); diff -ruN perl-5.8.x/ext/Win32/Makefile.PL AP822_source/ext/Win32/Makefile.PL --- perl-5.8.x/ext/Win32/Makefile.PL 2007-03-23 14:10:09.000000000 -0700 +++ AP822_source/ext/Win32/Makefile.PL 2007-08-01 10:17:44.049508591 -0700 @@ -1,10 +1,16 @@ +use 5.006; use ExtUtils::MakeMaker; my @libs; push @libs, '-L/lib/w32api -lole32 -lversion' if $^O eq "cygwin"; WriteMakefile( - NAME => 'Win32', - VERSION_FROM => 'Win32.pm', - LIBS => \@libs, + NAME => 'Win32', + VERSION_FROM => 'Win32.pm', + LIBS => \@libs, + INSTALLDIRS => ($] >= 5.008004 ? 'perl' : 'site'), + NO_META => 1, + + AUTHOR => 'Jan Dubois ', + ABSTRACT_FROM => 'Win32.pm', ); diff -ruN perl-5.8.x/ext/Win32/Win32.pm AP822_source/ext/Win32/Win32.pm --- perl-5.8.x/ext/Win32/Win32.pm 2007-03-23 14:51:54.000000000 -0700 +++ AP822_source/ext/Win32/Win32.pm 2007-08-01 10:17:44.051508242 -0700 @@ -2,13 +2,15 @@ BEGIN { use strict; - use vars qw|$VERSION @ISA @EXPORT @EXPORT_OK|; + use vars qw|$VERSION $XS_VERSION @ISA @EXPORT @EXPORT_OK|; require Exporter; require DynaLoader; @ISA = qw|Exporter DynaLoader|; - $VERSION = '0.27'; + $VERSION = '0.30'; + $XS_VERSION = $VERSION; + $VERSION = eval $VERSION; @EXPORT = qw( NULL @@ -79,20 +81,6 @@ ); } -# Routines available in core: -# Win32::GetLastError -# Win32::LoginName -# Win32::NodeName -# Win32::DomainName -# Win32::FsType -# Win32::GetCwd -# Win32::GetOSVersion -# Win32::FormatMessage ERRORCODE -# Win32::Spawn COMMAND, ARGS, PID -# Win32::GetTickCount -# Win32::IsWinNT -# Win32::IsWin95 - # We won't bother with the constant stuff, too much of a hassle. Just hard # code it here. @@ -251,6 +239,8 @@ return wantarray ? ($found_os, $found_desc) : $found_os; } +# "no warnings 'redefine';" doesn't work for 5.8.7 and earlier +local $^W = 0; bootstrap Win32; 1; @@ -263,22 +253,25 @@ =head1 DESCRIPTION -Perl on Win32 contains several functions to access Win32 APIs. Some -are included in Perl itself (on Win32) and some are only available -after explicitly requesting the Win32 module with: - - use Win32; - -The builtin functions are marked as [CORE] and the other ones -as [EXT] in the following alphabetical listing. +The Win32 module contains functions to access Win32 APIs. =head2 Alphabetical Listing of Win32 Functions +It is recommended to C before any of these functions; +however, for backwards compatibility, those marked as [CORE] will +automatically do this for you. + +In the function descriptions below the term I is used +to indicate that the string may contain characters outside the system +codepage. The caveat I +generally means Perl 5.8.9 and later, though some Unicode pathname +functionality may work on earlier versions. + =over =item Win32::AbortSystemShutdown(MACHINE) -[EXT] Aborts a system shutdown (started by the +Aborts a system shutdown (started by the InitiateSystemShutdown function) on the specified MACHINE. =item Win32::BuildNumber() @@ -296,6 +289,25 @@ not overwrite a read-only file; you have to unlink() it first yourself. +=item Win32::CreateDirectory(DIRECTORY) + +Creates the DIRECTORY and returns a true value on success. Check $^E +on failure for extended error information. + +DIRECTORY may contain Unicode characters outside the system codepage. +Once the directory has been created you can use +Win32::GetANSIPathName() to get a name that can be passed to system +calls and external programs. + +=item Win32::CreateFile(FILE) + +Creates the FILE and returns a true value on success. Check $^E on +failure for extended error information. + +FILE may contain Unicode characters outside the system codepage. Once +the file has been created you can use Win32::GetANSIPathName() to get +a name that can be passed to system calls and external programs. + =item Win32::DomainName() [CORE] Returns the name of the Microsoft Network domain that the @@ -304,7 +316,7 @@ =item Win32::ExpandEnvironmentStrings(STRING) -[EXT] Takes STRING and replaces all referenced environment variable +Takes STRING and replaces all referenced environment variable names with their defined values. References to environment variables take the form C<%VariableName%>. Case is ignored when looking up the VariableName in the environment. If the variable is not found then the @@ -313,6 +325,10 @@ $string =~ s/%([^%]*)%/$ENV{$1} || "%$1%"/eg +However, this function may return a Unicode string if the environment +variable being expanded hasn't been assigned to via %ENV. Access +to %ENV is currently always using byte semantics. + =item Win32::FormatMessage(ERRORCODE) [CORE] Converts the supplied Win32 error number (e.g. returned by @@ -348,18 +364,32 @@ =item Win32::FreeLibrary(HANDLE) -[EXT] Unloads a previously loaded dynamic-link library. The HANDLE is +Unloads a previously loaded dynamic-link library. The HANDLE is no longer valid after this call. See L for information on dynamically loading a library. +=item Win32::GetANSIPathName(FILENAME) + +Returns an ANSI version of FILENAME. This may be the short name +if the long name cannot be represented in the system codepage. + +While not currently implemented, it is possible that in the future +this function will convert only parts of the path to FILENAME to a +short form. + +If FILENAME doesn't exist on the filesystem, or if the filesystem +doesn't support short ANSI filenames, then this function will +translate the Unicode name into the system codepage using replacement +characters. + =item Win32::GetArchName() -[EXT] Use of this function is deprecated. It is equivalent with +Use of this function is deprecated. It is equivalent with $ENV{PROCESSOR_ARCHITECTURE}. This might not work on Win9X. =item Win32::GetChipName() -[EXT] Returns the processor type: 386, 486 or 586 for Intel processors, +Returns the processor type: 386, 486 or 586 for Intel processors, 21064 for the Alpha chip. =item Win32::GetCwd() @@ -368,16 +398,29 @@ does not return a UNC path, since the functionality required for such a feature is not available under Windows 95. +If supported by the core Perl version, this function will return an +ANSI path name for the current directory if the long pathname cannot +be represented in the system codepage. + +=item Win32::GetCurrentThreadId() + +Returns the thread identifier of the calling thread. Until the thread +terminates, the thread identifier uniquely identifies the thread +throughout the system. + +Note: the current process identifier is available via the predefined +$$ variable. + =item Win32::GetFileVersion(FILENAME) -[EXT] Returns the file version number from the VERSIONINFO resource of +Returns the file version number from the VERSIONINFO resource of the executable file or DLL. This is a tuple of four 16 bit numbers. In list context these four numbers will be returned. In scalar context they are concatenated into a string, separated by dots. =item Win32::GetFolderPath(FOLDER [, CREATE]) -[EXT] Returns the full pathname of one of the Windows special folders. +Returns the full pathname of one of the Windows special folders. The folder will be created if it doesn't exist and the optional CREATE argument is true. The following FOLDER constants are defined by the Win32 module, but only exported on demand: @@ -432,6 +475,11 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp +This function will return an ANSI folder path if the long name cannot +be represented in the system codepage. Use Win32::GetLongPathName() +on the result of Win32::GetFolderPath() if you want the Unicode +version of the folder name. + =item Win32::GetFullPathName(FILENAME) [CORE] GetFullPathName combines the FILENAME with the current drive @@ -440,8 +488,12 @@ PATH is the complete pathname component (including trailing backslash) and FILE is just the filename part. Note that no attempt is made to convert 8.3 components in the supplied FILENAME to longnames or -vice-versa. Compare with Win32::GetShortPathName and -Win32::GetLongPathName. +vice-versa. Compare with Win32::GetShortPathName() and +Win32::GetLongPathName(). + +If supported by the core Perl version, this function will return an +ANSI path name if the full pathname cannot be represented in the +system codepage. =item Win32::GetLastError() @@ -454,8 +506,12 @@ [CORE] Returns a representation of PATHNAME composed of longname components (if any). The result may not necessarily be longer than PATHNAME. No attempt is made to convert PATHNAME to the -absolute path. Compare with Win32::GetShortPathName and -Win32::GetFullPathName. +absolute path. Compare with Win32::GetShortPathName() and +Win32::GetFullPathName(). + +This function may return the pathname in Unicode if it cannot be +represented in the system codepage. Use Win32::GetANSIPathName() +before passing the path to a system call or another program. =item Win32::GetNextAvailDrive() @@ -521,7 +577,7 @@ =item Win32::GetOSName() -[EXT] In scalar context returns the name of the Win32 operating system +In scalar context returns the name of the Win32 operating system being used. In list context returns a two element list of the OS name and whatever edition information is known about the particular build (for Win9X boxes) and whatever service packs have been installed. @@ -549,12 +605,13 @@ (8.3) path components where available. For path components where the file system has not generated the short form the returned path will use the long form, so this function might still for instance return a -path containing spaces. Compare with Win32::GetFullPathName and -Win32::GetLongPathName. +path containing spaces. Returns C when the PATHNAME does not +exist. Compare with Win32::GetFullPathName() and +Win32::GetLongPathName(). =item Win32::GetProcAddress(INSTANCE, PROCNAME) -[EXT] Returns the address of a function inside a loaded library. The +Returns the address of a function inside a loaded library. The information about what you can do with this address has been lost in the mist of time. Use the Win32::API module instead of this deprecated function. @@ -567,7 +624,7 @@ =item Win32::GuidGen() -[EXT] Creates a globally unique 128 bit integer that can be used as a +Creates a globally unique 128 bit integer that can be used as a persistent identifier in a distributed setting. To a very high degree of certainty this function returns a unique value. No other invocation, on the same or any other system (networked or not), should @@ -582,7 +639,7 @@ (MACHINE, MESSAGE, TIMEOUT, FORCECLOSE, REBOOT) -[EXT] Shutsdown the specified MACHINE, notifying users with the +Shutsdown the specified MACHINE, notifying users with the supplied MESSAGE, within the specified TIMEOUT interval. Forces closing of all documents without prompting the user if FORCECLOSE is true, and reboots the machine if REBOOT is true. This function works @@ -590,11 +647,13 @@ =item Win32::IsAdminUser() -[EXT] Returns non zero if the account in whose security context the +Returns non zero if the account in whose security context the current process/thread is running belongs to the local group of Administrators in the built-in system domain; returns 0 if not. -Returns the undefined value and prints a warning if an error occurred. -This function always returns 1 on Win9X. +On Windows Vista it will only return non-zero if the process is +actually running with elevated privileges. Returns C +and prints a warning if an error occurred. This function always +returns 1 on Win9X. =item Win32::IsWinNT() @@ -606,28 +665,29 @@ =item Win32::LoadLibrary(LIBNAME) -[EXT] Loads a dynamic link library into memory and returns its module -handle. This handle can be used with Win32::GetProcAddress and -Win32::FreeLibrary. This function is deprecated. Use the Win32::API +Loads a dynamic link library into memory and returns its module +handle. This handle can be used with Win32::GetProcAddress() and +Win32::FreeLibrary(). This function is deprecated. Use the Win32::API module instead. =item Win32::LoginName() [CORE] Returns the username of the owner of the current perl process. +The return value may be a Unicode string. =item Win32::LookupAccountName(SYSTEM, ACCOUNT, DOMAIN, SID, SIDTYPE) -[EXT] Looks up ACCOUNT on SYSTEM and returns the domain name the SID and +Looks up ACCOUNT on SYSTEM and returns the domain name the SID and the SID type. =item Win32::LookupAccountSID(SYSTEM, SID, ACCOUNT, DOMAIN, SIDTYPE) -[EXT] Looks up SID on SYSTEM and returns the account name, domain name, +Looks up SID on SYSTEM and returns the account name, domain name, and the SID type. =item Win32::MsgBox(MESSAGE [, FLAGS [, TITLE]]) -[EXT] Create a dialogbox containing MESSAGE. FLAGS specifies the +Create a dialogbox containing MESSAGE. FLAGS specifies the required icon and buttons according to the following table: 0 = OK @@ -660,9 +720,19 @@ [CORE] Returns the Microsoft Network node-name of the current machine. +=item Win32::OutputDebugString(STRING) + +Sends a string to the application or system debugger for display. +The function does nothing if there is no active debugger. + +Alternatively one can use the I application to +watch the OutputDebugString() output: + +http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx + =item Win32::RegisterServer(LIBRARYNAME) -[EXT] Loads the DLL LIBRARYNAME and calls the function DllRegisterServer. +Loads the DLL LIBRARYNAME and calls the function DllRegisterServer. =item Win32::SetChildShowWindow(SHOWWINDOW) @@ -674,7 +744,7 @@ default behavior. The return value of SetChildShowWindow() is the previous setting or C. -[EXT] The following symbolic constants for SHOWWINDOW are available +The following symbolic constants for SHOWWINDOW are available (but not exported) from the Win32 module: SW_HIDE, SW_SHOWNORMAL, SW_SHOWMINIMIZED, SW_SHOWMAXIMIZED and SW_SHOWNOACTIVATE. @@ -704,7 +774,7 @@ =item Win32::UnregisterServer(LIBRARYNAME) -[EXT] Loads the DLL LIBRARYNAME and calls the function +Loads the DLL LIBRARYNAME and calls the function DllUnregisterServer. =back diff -ruN perl-5.8.x/ext/Win32/Win32.xs AP822_source/ext/Win32/Win32.xs --- perl-5.8.x/ext/Win32/Win32.xs 2007-03-23 14:51:54.000000000 -0700 +++ AP822_source/ext/Win32/Win32.xs 2007-08-01 10:17:44.062506322 -0700 @@ -1,20 +1,105 @@ +#include #include +#include +#define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" +#ifndef countof +# define countof(array) (sizeof (array) / sizeof (*(array))) +#endif + #define SE_SHUTDOWN_NAMEA "SeShutdownPrivilege" -typedef BOOL (WINAPI *PFNSHGetSpecialFolderPath)(HWND, char*, int, BOOL); -typedef HRESULT (WINAPI *PFNSHGetFolderPath)(HWND, int, HANDLE, DWORD, LPTSTR); +#ifndef WC_NO_BEST_FIT_CHARS +# define WC_NO_BEST_FIT_CHARS 0x00000400 +#endif + +#define GETPROC(fn) pfn##fn = (PFN##fn)GetProcAddress(module, #fn) + +typedef BOOL (WINAPI *PFNSHGetSpecialFolderPathA)(HWND, char*, int, BOOL); +typedef BOOL (WINAPI *PFNSHGetSpecialFolderPathW)(HWND, WCHAR*, int, BOOL); +typedef HRESULT (WINAPI *PFNSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPTSTR); +typedef HRESULT (WINAPI *PFNSHGetFolderPathW)(HWND, int, HANDLE, DWORD, LPWSTR); +typedef BOOL (WINAPI *PFNCreateEnvironmentBlock)(void**, HANDLE, BOOL); +typedef BOOL (WINAPI *PFNDestroyEnvironmentBlock)(void*); typedef int (__stdcall *PFNDllRegisterServer)(void); typedef int (__stdcall *PFNDllUnregisterServer)(void); +typedef DWORD (__stdcall *PFNNetApiBufferFree)(void*); +typedef DWORD (__stdcall *PFNNetWkstaGetInfo)(LPWSTR, DWORD, void*); + +typedef BOOL (__stdcall *PFNOpenProcessToken)(HANDLE, DWORD, HANDLE*); +typedef BOOL (__stdcall *PFNOpenThreadToken)(HANDLE, DWORD, BOOL, HANDLE*); +typedef BOOL (__stdcall *PFNGetTokenInformation)(HANDLE, TOKEN_INFORMATION_CLASS, void*, DWORD, DWORD*); +typedef BOOL (__stdcall *PFNAllocateAndInitializeSid)(PSID_IDENTIFIER_AUTHORITY, BYTE, DWORD, DWORD, + DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, PSID*); +typedef BOOL (__stdcall *PFNEqualSid)(PSID, PSID); +typedef void* (__stdcall *PFNFreeSid)(PSID); +typedef BOOL (__stdcall *PFNIsUserAnAdmin)(); + #ifndef CSIDL_FLAG_CREATE # define CSIDL_FLAG_CREATE 0x8000 #endif -static OSVERSIONINFO g_osver = {0, 0, 0, 0, 0, ""}; +#ifndef CSIDL_ADMINTOOLS +# define CSIDL_ADMINTOOLS 0x0030 +# define CSIDL_COMMON_ADMINTOOLS 0x002F +# define CSIDL_COMMON_APPDATA 0x0023 +# define CSIDL_COMMON_DOCUMENTS 0x002E +# define CSIDL_COMMON_TEMPLATES 0x002D +# define CSIDL_LOCAL_APPDATA 0x001C +# define CSIDL_MYPICTURES 0x0027 +# define CSIDL_PROFILE 0x0028 +# define CSIDL_PROGRAM_FILES 0x0026 +# define CSIDL_PROGRAM_FILES_COMMON 0x002B +# define CSIDL_WINDOWS 0x0024 +#endif + +#ifndef CSIDL_CDBURN_AREA +# define CSIDL_CDBURN_AREA 0x003B +#endif + +#ifndef CSIDL_COMMON_MUSIC +# define CSIDL_COMMON_MUSIC 0x0035 +#endif + +#ifndef CSIDL_COMMON_PICTURES +# define CSIDL_COMMON_PICTURES 0x0036 +#endif + +#ifndef CSIDL_COMMON_VIDEO +# define CSIDL_COMMON_VIDEO 0x0037 +#endif + +#ifndef CSIDL_MYMUSIC +# define CSIDL_MYMUSIC 0x000D +#endif + +#ifndef CSIDL_MYVIDEO +# define CSIDL_MYVIDEO 0x000E +#endif + +/* Use explicit struct definition because wSuiteMask and + * wProductType are not defined in the VC++ 6.0 headers. + * WORD type has been replaced by unsigned short because + * WORD is already used by Perl itself. + */ +struct { + DWORD dwOSVersionInfoSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + DWORD dwBuildNumber; + DWORD dwPlatformId; + CHAR szCSDVersion[128]; + unsigned short wServicePackMajor; + unsigned short wServicePackMinor; + unsigned short wSuiteMask; + BYTE wProductType; + BYTE wReserved; +} g_osver = {0, 0, 0, 0, 0, "", 0, 0, 0, 0, 0}; +BOOL g_osver_ex = TRUE; #define ONE_K_BUFSIZE 1024 @@ -30,125 +115,226 @@ return (g_osver.dwPlatformId == VER_PLATFORM_WIN32_NT); } -#ifdef __CYGWIN__ +int +IsWin2000(void) +{ + return (g_osver.dwMajorVersion > 4); +} -#define isSLASH(c) ((c) == '/' || (c) == '\\') -#define SKIP_SLASHES(s) \ - STMT_START { \ - while (*(s) && isSLASH(*(s))) \ - ++(s); \ - } STMT_END -#define COPY_NONSLASHES(d,s) \ - STMT_START { \ - while (*(s) && !isSLASH(*(s))) \ - *(d)++ = *(s)++; \ - } STMT_END +/* Convert SV to wide character string. The return value must be + * freed using Safefree(). + */ +WCHAR* +sv_to_wstr(pTHX_ SV *sv) +{ + DWORD wlen; + WCHAR *wstr; + STRLEN len; + char *str = SvPV(sv, len); + UINT cp = SvUTF8(sv) ? CP_UTF8 : CP_ACP; -/* Find the longname of a given path. path is destructively modified. - * It should have space for at least MAX_PATH characters. */ -char * -win32_longpath(char *path) + wlen = MultiByteToWideChar(cp, 0, str, len+1, NULL, 0); + New(0, wstr, wlen, WCHAR); + MultiByteToWideChar(cp, 0, str, len+1, wstr, wlen); + + return wstr; +} + +/* Convert wide character string to mortal SV. Use UTF8 encoding + * if the string cannot be represented in the system codepage. + */ +SV * +wstr_to_sv(pTHX_ WCHAR *wstr) +{ + size_t wlen = wcslen(wstr)+1; + BOOL use_default = FALSE; + int len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, wstr, wlen, NULL, 0, NULL, NULL); + SV *sv = sv_2mortal(newSV(len)); + + len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, wstr, wlen, SvPVX(sv), len, NULL, &use_default); + if (use_default) { + len = WideCharToMultiByte(CP_UTF8, 0, wstr, wlen, NULL, 0, NULL, NULL); + sv_grow(sv, len); + len = WideCharToMultiByte(CP_UTF8, 0, wstr, wlen, SvPVX(sv), len, NULL, NULL); + SvUTF8_on(sv); + } + /* Shouldn't really ever fail since we ask for the required length first, but who knows... */ + if (len) { + SvPOK_on(sv); + SvCUR_set(sv, len-1); + } + return sv; +} + +/* Retrieve a variable from the Unicode environment in a mortal SV. + * + * Recreates the Unicode environment because a bug in earlier Perl versions + * overwrites it with the ANSI version, which contains replacement + * characters for the characters not in the ANSI codepage. + */ +SV* +get_unicode_env(pTHX_ WCHAR *name) { - WIN32_FIND_DATA fdata; - HANDLE fhand; - char tmpbuf[MAX_PATH+1]; - char *tmpstart = tmpbuf; - char *start = path; - char sep; - if (!path) - return Nullch; - - /* drive prefix */ - if (isALPHA(path[0]) && path[1] == ':') { - start = path + 2; - *tmpstart++ = path[0]; - *tmpstart++ = ':'; - } - /* UNC prefix */ - else if (isSLASH(path[0]) && isSLASH(path[1])) { - start = path + 2; - *tmpstart++ = path[0]; - *tmpstart++ = path[1]; - SKIP_SLASHES(start); - COPY_NONSLASHES(tmpstart,start); /* copy machine name */ - if (*start) { - *tmpstart++ = *start