| 1 | package FFI::Platypus::Legacy; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use 5.008004; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | # ABSTRACT: Legacy Platypus interfaces | ||||||||||
| 8 | 2 | our $VERSION = '2.12'; # VERSION | |||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | package FFI::Platypus; | ||||||||||
| 12 | |||||||||||
| 13 | sub _package | ||||||||||
| 14 | 2 | ▶ | { | ||||||||
|
Subroutine
_package: called CC=9 SCAR=25.0
| |||||||||||
| 15 | 2 | my($self, $module, $modlibname) = @_; | |||||||||
| 16 | |||||||||||
| 17 | 2 | ▶ | ($module, $modlibname) = caller unless defined $modlibname; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 2 | my @modparts = split /::/, $module; | |||||||||
| 19 | 2 | my $modfname = $modparts[-1]; | |||||||||
| 20 | 2 | my $modpname = join('/',@modparts); | |||||||||
| 21 | 2 | my $c = @modparts; | |||||||||
| 22 | 2 | ▶ | $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | |||||||||||
| 24 | { | ||||||||||
| 25 | 2 | my @maybe = ( | |||||||||
| 26 | "$modlibname/auto/$modpname/$modfname.txt", | ||||||||||
| 27 | "$modlibname/../arch/auto/$modpname/$modfname.txt", | ||||||||||
| 28 | ); | ||||||||||
| 29 | 2 | foreach my $file (@maybe) | |||||||||
| 30 | { | ||||||||||
| 31 | 4 | ▶ | if(-f $file) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | { | ||||||||||
| 33 | 0 | open my $fh, '<', $file; | |||||||||
| 34 | 0 | my $line = <$fh>; | |||||||||
| 35 | 0 | close $fh; | |||||||||
| 36 | 0 | ▶ | if($line =~ /^FFI::Build\@(.*)$/) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | { | ||||||||||
| 38 | 0 | $self->lib("$modlibname/$1"); | |||||||||
| 39 | 0 | return $self; | |||||||||
| 40 | } | ||||||||||
| 41 | } | ||||||||||
| 42 | } | ||||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 2 | require FFI::Platypus::ShareConfig; | |||||||||
| 46 | 2 | my @dlext = @{ FFI::Platypus::ShareConfig->get("config_dlext") }; | |||||||||
| 47 | |||||||||||
| 48 | 2 | foreach my $dlext (@dlext) | |||||||||
| 49 | { | ||||||||||
| 50 | 2 | my $file = "$modlibname/auto/$modpname/$modfname.$dlext"; | |||||||||
| 51 | 2 | ▶ | unless(-e $file) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | { | ||||||||||
| 53 | 2 | $modlibname =~ s,[\\/][^\\/]+$,,; | |||||||||
| 54 | 2 | $file = "$modlibname/arch/auto/$modpname/$modfname.$dlext"; | |||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | 2 | ▶ | if(-e $file) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | { | ||||||||||
| 59 | 0 | $self->lib($file); | |||||||||
| 60 | 0 | return $self; | |||||||||
| 61 | } | ||||||||||
| 62 | } | ||||||||||
| 63 | |||||||||||
| 64 | 2 | $self; | |||||||||
| 65 | } | ||||||||||
| 66 | |||||||||||
| 67 | 2 | 1; | |||||||||
| 68 | |||||||||||
| 69 | __END__ | ||||||||||