| 1 | package ExtUtils::XSpp::Typemap::parsed; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 21 | ▶ | use base 'ExtUtils::XSpp::Typemap'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 970 | ▶ | sub _dl { return defined( $_[0] ) && length( $_[0] ) ? $_[0] : undef } | ||||||||||||||||||||||||||
|
Subroutine
_dl: called CC=3 SCAR=11.1
Branch: 1 branch
Condition66%2/3
defined $_[0] and length $_[0]
MC/DC50%1/2
defined $_[0] and length $_[0]
defined $_[0]
length $_[0]
Truth table66%2/3
A and B
A= defined $_[0]B= length $_[0]
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 194 | ▶ | sub init { | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=7 SCAR=20.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 8 | 194 | my $this = shift; | |||||||||||||||||||||||||||
| 9 | 194 | my %args = @_; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 194 | ▶ | if( my $base = $args{base} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 12 | %args = ( cpp_type => $base->{CPP_TYPE}, | ||||||||||||||||||||||||||||
| 13 | call_function_code => $base->{CALL_FUNCTION_CODE}, | ||||||||||||||||||||||||||||
| 14 | output_code => $base->{OUTPUT_CODE}, | ||||||||||||||||||||||||||||
| 15 | cleanup_code => $base->{CLEANUP_CODE}, | ||||||||||||||||||||||||||||
| 16 | precall_code => $base->{PRECALL_CODE}, | ||||||||||||||||||||||||||||
| 17 | output_list => $base->{OUTPUT_LIST}, | ||||||||||||||||||||||||||||
| 18 | xs_type => $base->{XS_TYPE}, | ||||||||||||||||||||||||||||
| 19 | xs_input_code => $base->{XS_INPUT_CODE}, | ||||||||||||||||||||||||||||
| 20 | xs_output_code => $base->{XS_OUTPUT_CODE}, | ||||||||||||||||||||||||||||
| 21 | 0 | %args ); | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 194 | $this->{TYPE} = $args{type}; | |||||||||||||||||||||||||||
| 25 | 194 | $this->{NAME} = $args{name}; | |||||||||||||||||||||||||||
| 26 | 194 | ▶ | $this->{CPP_TYPE} = $args{cpp_type} || $args{arg1}; | ||||||||||||||||||||||||||
|
Condition66%2/3
$args{'cpp_type'} || $args{'arg1'}
MC/DC50%1/2
$args{'cpp_type'} || $args{'arg1'}
$args{'cpp_type'}
$args{'arg1'}
Truth table66%2/3
A || B
A= $args{'cpp_type'}B= $args{'arg1'}
| |||||||||||||||||||||||||||||
| 27 | 194 | ▶ | $this->{CALL_FUNCTION_CODE} = _dl( $args{call_function_code} || $args{arg2} ); | ||||||||||||||||||||||||||
|
Condition66%2/3
$args{'call_function_code'} || $args{'arg2'}
MC/DC50%1/2
$args{'call_function_code'} || $args{'arg2'}
$args{'call_function_code'}
$args{'arg2'}
Truth table66%2/3
A || B
A= $args{'call_function_code'}B= $args{'arg2'}
| |||||||||||||||||||||||||||||
| 28 | 194 | ▶ | $this->{OUTPUT_CODE} = _dl( $args{output_code} || $args{arg3} ); | ||||||||||||||||||||||||||
|
Condition66%2/3
$args{'output_code'} || $args{'arg3'}
MC/DC50%1/2
$args{'output_code'} || $args{'arg3'}
$args{'output_code'}
$args{'arg3'}
Truth table66%2/3
A || B
A= $args{'output_code'}B= $args{'arg3'}
| |||||||||||||||||||||||||||||
| 29 | 194 | ▶ | $this->{CLEANUP_CODE} = _dl( $args{cleanup_code} || $args{arg4} ); | ||||||||||||||||||||||||||
|
Condition66%2/3
$args{'cleanup_code'} || $args{'arg4'}
MC/DC50%1/2
$args{'cleanup_code'} || $args{'arg4'}
$args{'cleanup_code'}
$args{'arg4'}
Truth table66%2/3
A || B
A= $args{'cleanup_code'}B= $args{'arg4'}
| |||||||||||||||||||||||||||||
| 30 | 194 | ▶ | $this->{PRECALL_CODE} = _dl( $args{precall_code} || $args{arg5} ); | ||||||||||||||||||||||||||
|
Condition66%2/3
$args{'precall_code'} || $args{'arg5'}
MC/DC50%1/2
$args{'precall_code'} || $args{'arg5'}
$args{'precall_code'}
$args{'arg5'}
Truth table66%2/3
A || B
A= $args{'precall_code'}B= $args{'arg5'}
| |||||||||||||||||||||||||||||
| 31 | 194 | $this->{OUTPUT_LIST} = _dl( $args{output_list} ); | |||||||||||||||||||||||||||
| 32 | 194 | $this->{XS_TYPE} = $args{xs_type}; | |||||||||||||||||||||||||||
| 33 | 194 | $this->{XS_INPUT_CODE} = $args{xs_input_code}; | |||||||||||||||||||||||||||
| 34 | 194 | $this->{XS_OUTPUT_CODE} = $args{xs_output_code}; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 19 | ▶ | sub cpp_type { $_[0]->{CPP_TYPE} || $_[0]->{TYPE}->print } | ||||||||||||||||||||||||||
|
Subroutine
cpp_type: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 7 | ▶ | sub output_code { | ||||||||||||||||||||||||||
|
Subroutine
output_code: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 40 | 7 | my( $this, $pvar, $cvar ) = @_; | |||||||||||||||||||||||||||
| 41 | 7 | ▶ | return unless defined $_[0]->{OUTPUT_CODE}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 2 | return _replace( $_[0]->{OUTPUT_CODE}, '$PerlVar' => $pvar, '$CVar' => $cvar ); | |||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 13 | ▶ | sub output_list { | ||||||||||||||||||||||||||
|
Subroutine
output_list: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 46 | 13 | my( $this, $cvar ) = @_; | |||||||||||||||||||||||||||
| 47 | 13 | ▶ | return unless defined $_[0]->{OUTPUT_LIST}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | 3 | return _replace( $_[0]->{OUTPUT_LIST}, '$CVar' => $cvar ); | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 7 | ▶ | sub cleanup_code { | ||||||||||||||||||||||||||
|
Subroutine
cleanup_code: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 52 | 7 | my( $this, $pvar, $cvar ) = @_; | |||||||||||||||||||||||||||
| 53 | 7 | ▶ | return unless defined $_[0]->{CLEANUP_CODE}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | 2 | return _replace( $_[0]->{CLEANUP_CODE}, '$PerlVar' => $pvar, '$CVar' => $cvar ); | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 12 | ▶ | sub call_parameter_code { undef } | ||||||||||||||||||||||||||
|
Subroutine
call_parameter_code: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 7 | ▶ | sub call_function_code { | ||||||||||||||||||||||||||
|
Subroutine
call_function_code: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 60 | 7 | my( $this, $func, $var ) = @_; | |||||||||||||||||||||||||||
| 61 | 7 | ▶ | return unless defined $this->{CALL_FUNCTION_CODE}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 62 | return _replace( $this->{CALL_FUNCTION_CODE}, | ||||||||||||||||||||||||||||
| 63 | 2 | '$CVar' => $var, '$Call' => $func, | |||||||||||||||||||||||||||
| 64 | # backward compatibility | ||||||||||||||||||||||||||||
| 65 | '$1' => $func, '$$' => $var, | ||||||||||||||||||||||||||||
| 66 | ); | ||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | 12 | ▶ | sub precall_code { | ||||||||||||||||||||||||||
|
Subroutine
precall_code: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 70 | 12 | my( $this, $pvar, $cvar ) = @_; | |||||||||||||||||||||||||||
| 71 | 12 | ▶ | return unless defined $_[0]->{PRECALL_CODE}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 72 | return _replace( $this->{PRECALL_CODE}, | ||||||||||||||||||||||||||||
| 73 | 2 | '$PerlVar' => $pvar, '$CVar' => $cvar, | |||||||||||||||||||||||||||
| 74 | # backward compatibility | ||||||||||||||||||||||||||||
| 75 | '$1' => $pvar, '$2' => $cvar, | ||||||||||||||||||||||||||||
| 76 | ); | ||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 11 | ▶ | sub _replace { | ||||||||||||||||||||||||||
|
Subroutine
_replace: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 80 | 11 | my( $code ) = shift; | |||||||||||||||||||||||||||
| 81 | 11 | ▶ | while( @_ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 82 | 27 | my( $f, $t ) = ( shift, shift ); | |||||||||||||||||||||||||||
| 83 | 27 | $code =~ s/\Q$f\E/$t/g; | |||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||
| 85 | 11 | return $code; | |||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 21 | 1; | |||||||||||||||||||||||||||