line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ExtUtils::XSBuilder::CallbackMap; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
5
|
1
|
|
|
1
|
|
6
|
use ExtUtils::XSBuilder::MapUtil qw(callback_table); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
564
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(ExtUtils::XSBuilder::FunctionMap); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ============================================================================ |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#look for callbacks that do not exist in *.map |
12
|
|
|
|
|
|
|
sub check { |
13
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
14
|
0
|
|
|
|
|
|
my $map = $self->get; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my @missing; |
17
|
0
|
|
|
|
|
|
my $parsesource = $self -> {wrapxs} -> parsesource_objects ; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
loop: |
20
|
0
|
|
|
|
|
|
for my $name (map $_->{name}, @{ callback_table($self -> {wrapxs}) }) { |
21
|
0
|
0
|
|
|
|
|
next if exists $map->{$name}; |
22
|
0
|
|
|
|
|
|
push @missing, $name ; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
return @missing ? \@missing : undef; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# ============================================================================ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
#look for callbacks in *.map that do not exist |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub check_exists { |
33
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
my %callbacks = map { $_->{name}, 1 } @{ callback_table($self -> {wrapxs}) }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my @missing = (); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#print Data::Dumper -> Dump ([\%callbacks, $self->{map}]) ; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
for my $name (keys %{ $self->{map} }) { |
|
0
|
|
|
|
|
|
|
41
|
0
|
0
|
|
|
|
|
next if $callbacks{$name}; |
42
|
0
|
|
|
|
|
|
push @missing, $name ; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
|
return @missing ? \@missing : undef; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# ============================================================================ |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub parse { |
52
|
0
|
|
|
0
|
0
|
|
my($self, $fh, $map) = @_; |
53
|
0
|
|
|
|
|
|
my %cur; |
54
|
0
|
|
|
|
|
|
my $disabled = 0; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
while ($fh->readline) { |
57
|
0
|
|
|
|
|
|
my($type, $argspec) = split /\s*\|\s*/; |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
my $entry = $map->{$type} = { |
60
|
|
|
|
|
|
|
name => $type, |
61
|
|
|
|
|
|
|
argspec => $argspec ? [split /\s*,\s*/, $argspec] : "", |
62
|
|
|
|
|
|
|
}; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
#avoid 'use of uninitialized value' warnings |
66
|
0
|
|
0
|
|
|
|
$entry->{$_} ||= "" for keys %{ $entry }; |
|
0
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub write { |
73
|
0
|
|
|
0
|
0
|
|
my ($self, $fh, $newentries, $prefix) = @_ ; |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
foreach (@$newentries) |
76
|
|
|
|
|
|
|
{ |
77
|
0
|
|
|
|
|
|
my $line = $self -> {wrapxs} -> mapline_func ($_) ; |
78
|
|
|
|
|
|
|
|
79
|
0
|
0
|
|
|
|
|
if ($line =~ /\)\((.*?)\)/) |
80
|
|
|
|
|
|
|
{ |
81
|
0
|
|
|
|
|
|
my @args = split (/,/, $1) ; |
82
|
0
|
0
|
|
|
|
|
$line .= ' | ' if (@args) ; |
83
|
0
|
|
|
|
|
|
my $i = 0 ; |
84
|
0
|
|
|
|
|
|
foreach (@args) |
85
|
|
|
|
|
|
|
{ |
86
|
0
|
0
|
|
|
|
|
$line .= ',' if ($i++ > 0) ; |
87
|
0
|
|
|
|
|
|
/([^ ]+)$/ ; |
88
|
0
|
|
|
|
|
|
my $arg = $1 ; |
89
|
0
|
0
|
|
|
|
|
$line .= '<' if (/\* \*/) ; |
90
|
0
|
|
|
|
|
|
$line .= $arg ; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
$fh -> print ($prefix, $line, "\n") ; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|