Magic.pm

filter: Statementstmt 68.7% 11 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 71.4% 15 / 21 CC 1 SCAR 2.2
CC
1
Cov
69%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« MagicExt.pm ↑ Summary MagicBuf.pm »
1 package ExtUtils::Typemaps::Magic;
2 1 $ExtUtils::Typemaps::Magic::VERSION = '0.010';
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use parent 'ExtUtils::Typemaps';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
9 0 my $class = shift;
10 0 my $self = $class->SUPER::new(@_);
11  
12 0 $self->add_inputmap(xstype => 'T_MAGIC', code => <<'END');
13 SV* ${var}_arg = $arg;
14 MAGIC* magic = SvROK(${var}_arg) && SvRMAGICAL(SvRV(${var}_arg)) ? mg_findext(SvRV(${var}_arg), PERL_MAGIC_ext, NULL) : NULL;
15 if (magic)
16 $var = ($type)magic->mg_ptr;
17 else
18 Perl_croak(aTHX_ \"%s object is lacking magic\", \"$ntype\");
19 END
20  
21 0 $self->add_outputmap(xstype => 'T_MAGIC', code => ' sv_magicext(newSVrv($arg, "$ntype"), NULL, PERL_MAGIC_ext, NULL, (const char*)$var, 0);');
22  
23 0 return $self;
24 }
25  
26 1 1;
27  
28 # ABSTRACT: Typemap for storing objects in magic
29  
30 __END__
« MagicExt.pm ↑ Summary MagicBuf.pm »