line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Plugin::FFI::Package; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
955528
|
use strict; |
|
4
|
|
|
|
|
32
|
|
|
4
|
|
|
|
|
121
|
|
4
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
104
|
|
5
|
4
|
|
|
4
|
|
114
|
use 5.008001; |
|
4
|
|
|
|
|
16
|
|
6
|
4
|
|
|
4
|
|
2236
|
use FFI::CheckLib 0.11 qw( find_lib ); |
|
4
|
|
|
|
|
12588
|
|
|
4
|
|
|
|
|
313
|
|
7
|
4
|
|
|
4
|
|
39
|
use Cwd qw( getcwd ); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
172
|
|
8
|
4
|
|
|
4
|
|
29
|
use File::Basename qw( basename ); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1078
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Plugin to test bundled FFI code without EUMM |
11
|
|
|
|
|
|
|
our $VERSION = '0.06'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import |
15
|
|
|
|
|
|
|
{ |
16
|
4
|
|
|
4
|
|
3152
|
require FFI::Platypus; |
17
|
|
|
|
|
|
|
|
18
|
4
|
|
|
|
|
29975
|
my $old = \&FFI::Platypus::package; |
19
|
|
|
|
|
|
|
my $new = sub { |
20
|
0
|
|
|
0
|
|
0
|
my($ffi, $module, $modlibname) = @_; |
21
|
0
|
0
|
|
|
|
0
|
($module, $modlibname) = caller() unless defined $modlibname; |
22
|
0
|
|
|
|
|
0
|
my $dist = $module; |
23
|
0
|
|
|
|
|
0
|
$dist =~ s/::/-/g; |
24
|
0
|
0
|
|
|
|
0
|
if(basename(getcwd()) eq $dist) |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
|
|
0
|
my @lib = find_lib( |
27
|
|
|
|
|
|
|
lib => '*', |
28
|
|
|
|
|
|
|
libpath => 'share/lib', |
29
|
|
|
|
|
|
|
systempath => [], |
30
|
|
|
|
|
|
|
); |
31
|
0
|
0
|
|
|
|
0
|
if(@lib) |
32
|
|
|
|
|
|
|
{ |
33
|
0
|
|
|
|
|
0
|
$ffi->lib(@lib); |
34
|
0
|
|
|
|
|
0
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
0
|
$old->($ffi, $module, $modlibname); |
38
|
4
|
|
|
|
|
24
|
}; |
39
|
|
|
|
|
|
|
|
40
|
4
|
|
|
4
|
|
33
|
no warnings 'redefine'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
265
|
|
41
|
4
|
|
|
|
|
4297
|
*FFI::Platypus::package = $new; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |