File::Spec in XS
authorZefram <zefram@fysh.org>
Thu, 28 Feb 2013 16:48:01 +0000 (16:48 +0000)
committerZefram <zefram@fysh.org>
Sat, 17 Aug 2013 15:37:18 +0000 (16:37 +0100)
commit07f43755f921a0932e6f0968eef6a88c15c70dae
treeac615409c8a13cb6728b9d24c9c11b4c3320770f
parent8e6d3e2b7e856d175326708059cbba69d76ac2eb
File::Spec in XS

Reimplement parts of File::Spec in XS.  Mainly File::Spec::Unix methods.

The methods can be used as methods on File::Spec::Unix, as methods
inherited by File::Spec::$notunix, and as standalone functions.  Quite a
lot of complexity comes from making them work in all of these roles,
without the compatibility damaging the performance of any of them.
The methods therefore need to check their invocant, using C code
where the invocant is File::Spec::Unix, and calling other methods if
it is not, so that they play nicely in composition with other methods.
The standalone function is another XS entry point, entirely unencumbered
by OO interface paraphernalia.  File::Spec::Functions is modified to
pick up the separate function version.

There is new logic for File::Spec to fall back to pure Perl, in the way
that Cwd.pm already does, for XS-impaired systems.
14 files changed:
dist/Cwd/Cwd.pm
dist/Cwd/Cwd.xs
dist/Cwd/Makefile.PL
dist/Cwd/lib/File/Spec.pm
dist/Cwd/lib/File/Spec/Cygwin.pm
dist/Cwd/lib/File/Spec/Epoc.pm
dist/Cwd/lib/File/Spec/Functions.pm
dist/Cwd/lib/File/Spec/Mac.pm
dist/Cwd/lib/File/Spec/OS2.pm
dist/Cwd/lib/File/Spec/Unix.pm
dist/Cwd/lib/File/Spec/VMS.pm
dist/Cwd/lib/File/Spec/Win32.pm
dist/Cwd/t/Functions.t
dist/Cwd/t/Spec.t