line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ExtUtils::Typemaps::Type; |
2
|
15
|
|
|
15
|
|
229
|
use 5.006001; |
|
15
|
|
|
|
|
47
|
|
3
|
15
|
|
|
15
|
|
77
|
use strict; |
|
15
|
|
|
|
|
48
|
|
|
15
|
|
|
|
|
321
|
|
4
|
15
|
|
|
15
|
|
68
|
use warnings; |
|
15
|
|
|
|
|
30
|
|
|
15
|
|
|
|
|
4832
|
|
5
|
|
|
|
|
|
|
require ExtUtils::Typemaps; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '3.44'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
ExtUtils::Typemaps::Type - Entry in the TYPEMAP section of a typemap |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use ExtUtils::Typemaps; |
16
|
|
|
|
|
|
|
... |
17
|
|
|
|
|
|
|
my $type = $typemap->get_type_map('char*'); |
18
|
|
|
|
|
|
|
my $input = $typemap->get_input_map($type->xstype); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Refer to L for details. |
23
|
|
|
|
|
|
|
Object associates C with C, which is the index |
24
|
|
|
|
|
|
|
into the in- and output mapping tables. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 METHODS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head2 new |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Requires C and C parameters. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Optionally takes C parameter. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub new { |
39
|
3245
|
|
|
3245
|
1
|
4401
|
my $prot = shift; |
40
|
3245
|
|
66
|
|
|
6945
|
my $class = ref($prot)||$prot; |
41
|
3245
|
|
|
|
|
6467
|
my %args = @_; |
42
|
|
|
|
|
|
|
|
43
|
3245
|
100
|
|
|
|
5568
|
if (!ref($prot)) { |
44
|
1098
|
50
|
33
|
|
|
3463
|
if (not defined $args{xstype} or not defined $args{ctype}) { |
45
|
0
|
|
|
|
|
0
|
die("Need xstype and ctype parameters"); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
3245
|
100
|
|
|
|
12703
|
my $self = bless( |
50
|
|
|
|
|
|
|
(ref($prot) ? {%$prot} : {proto => ''}) |
51
|
|
|
|
|
|
|
=> $class |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
3245
|
100
|
|
|
|
7539
|
$self->{xstype} = $args{xstype} if defined $args{xstype}; |
55
|
3245
|
100
|
|
|
|
5984
|
$self->{ctype} = $args{ctype} if defined $args{ctype}; |
56
|
3245
|
|
|
|
|
6547
|
$self->{tidy_ctype} = ExtUtils::Typemaps::tidy_type($self->{ctype}); |
57
|
3245
|
50
|
|
|
|
6278
|
$self->{proto} = $args{'prototype'} if defined $args{'prototype'}; |
58
|
|
|
|
|
|
|
|
59
|
3245
|
|
|
|
|
7862
|
return $self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 proto |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Returns or sets the prototype. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub proto { |
69
|
291
|
50
|
|
291
|
1
|
550
|
$_[0]->{proto} = $_[1] if @_ > 1; |
70
|
291
|
|
|
|
|
992
|
return $_[0]->{proto}; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 xstype |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Returns the name of the XS type that this C type is associated to. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub xstype { |
80
|
437
|
|
|
437
|
1
|
1465
|
return $_[0]->{xstype}; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 ctype |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Returns the name of the C type as it was set on construction. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub ctype { |
90
|
2204
|
50
|
|
2204
|
1
|
7481
|
return defined($_[0]->{ctype}) ? $_[0]->{ctype} : $_[0]->{tidy_ctype}; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 tidy_ctype |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Returns the canonicalized name of the C type. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub tidy_ctype { |
100
|
2164
|
|
|
2164
|
1
|
6044
|
return $_[0]->{tidy_ctype}; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 SEE ALSO |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
L |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 AUTHOR |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Steffen Mueller C<> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Copyright 2009, 2010, 2011, 2012 Steffen Mueller |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
116
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=cut |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
1; |
121
|
|
|
|
|
|
|
|