| 1 | # Copyright 2004 by Audrey Tang <cpan@audreyt.org> | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | package Win32::Exe::Resource::Version; | ||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use base 'Win32::Exe::Resource'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use constant FORMAT => ( | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | Data => 'a*', | ||||||||||||||||||||||||||||||||||||||||||
| 9 | 5 | ); | |||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use constant FIXED_INFO => [qw( | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | Signature StrucVersion FileVersionMS FileVersionLS | ||||||||||||||||||||||||||||||||||||||||||
| 12 | ProductVersionMS ProductVersionLS FileFlagsMask FileFlags | ||||||||||||||||||||||||||||||||||||||||||
| 13 | FileOS FileType FileSubtype FileDateMS FileDateLS | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 5 | )]; | |||||||||||||||||||||||||||||||||||||||||
| 15 | 5 | ▶ | use constant STRING_INFO => [qw( | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | Comments CompanyName FileDescription FileVersion InternalName | ||||||||||||||||||||||||||||||||||||||||||
| 17 | LegalCopyright LegalTrademarks OriginalFilename PrivateBuild | ||||||||||||||||||||||||||||||||||||||||||
| 18 | ProductName ProductVersion SpecialBuild FileNumber ProductNumber | ||||||||||||||||||||||||||||||||||||||||||
| 19 | 5 | )]; | |||||||||||||||||||||||||||||||||||||||||
| 20 | 5 | ▶ | use constant FI_TO_ID => { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 5 | map { (FIXED_INFO->[$_] => $_) } (0 .. $#{+FIXED_INFO}) | |||||||||||||||||||||||||||||||||||||||||
| 22 | 5 | }; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 5 | ▶ | use constant LC_TO_SI => { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 135 | (map { (lc($_) => $_) } @{+STRING_INFO}, keys %{+FI_TO_ID}), | |||||||||||||||||||||||||||||||||||||||||
| 25 | 5 | ▶ | (map { (lc($_) => $_) } map { /^(.+)MS$/ ? $1 : () } keys %{+FI_TO_ID}), | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 5 | }; | |||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 24 | ▶ | sub fi_to_id { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fi_to_id: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 24 | my ($self, $name) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 24 | return(+FI_TO_ID->{$name}); | |||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | 8 | ▶ | sub lc_to_si { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
lc_to_si: called CC=2 SCAR=8.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 8 | my ($self, $name) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 35 | 8 | ▶ | return(+LC_TO_SI->{lc($name)} || $name); | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
{comments => 'Comments', companyname => 'CompanyName', filedate => 'FileDate', filedatels => 'FileDateLS', filedatems => 'FileDateMS', filedescription => 'FileDescription', fileflags => 'FileFlags', fileflagsmask => 'FileFlagsMask', filenumber => 'FileNumber', fileos => 'FileOS', filesubtype => 'FileSubtype', filetype => 'FileType', fileversion => 'FileVersion', fileversionls => 'FileVersionLS', fileversionms => 'FileVersionMS', internalname => 'InternalName', legalcopyright => 'LegalCopyright', legaltrademarks => 'LegalTrademarks', originalfilename => 'OriginalFilename', privatebuild => 'PrivateBuild', productname => 'ProductName', productnumber => 'ProductNumber', productversion => 'ProductVersion', productversionls => 'ProductVersionLS', productversionms => 'ProductVersionMS', signature => 'Signature', specialbuild => 'SpecialBuild', strucversion => 'StrucVersion'}->{lc $name} || $name
MC/DC0%0/2
{comments => 'Comments', companyname => 'CompanyName', filedate => 'FileDate', filedatels => 'FileDateLS', filedatems => 'FileDateMS', filedescription => 'FileDescription', fileflags => 'FileFlags', fileflagsmask => 'FileFlagsMask', filenumber => 'FileNumber', fileos => 'FileOS', filesubtype => 'FileSubtype', filetype => 'FileType', fileversion => 'FileVersion', fileversionls => 'FileVersionLS', fileversionms => 'FileVersionMS', internalname => 'InternalName', legalcopyright => 'LegalCopyright', legaltrademarks => 'LegalTrademarks', originalfilename => 'OriginalFilename', privatebuild => 'PrivateBuild', productname => 'ProductName', productnumber => 'ProductNumber', productversion => 'ProductVersion', productversionls => 'ProductVersionLS', productversionms => 'ProductVersionMS', signature => 'Signature', specialbuild => 'SpecialBuild', strucversion => 'StrucVersion'}->{lc $name} || $name
{comments => 'Comments', companyname => 'CompanyName', filedate => 'FileDate', filedatels => 'FileDateLS', filedatems => 'FileDateMS', filedescription => 'FileDescription', fileflags => 'FileFlags', fileflagsmask => 'FileFlagsMask', filenumber => 'FileNumber', fileos => 'FileOS', filesubtype => 'FileSubtype', filetype => 'FileType', fileversion => 'FileVersion', fileversionls => 'FileVersionLS', fileversionms => 'FileVersionMS', internalname => 'InternalName', legalcopyright => 'LegalCopyright', legaltrademarks => 'LegalTrademarks', originalfilename => 'OriginalFilename', privatebuild => 'PrivateBuild', productname => 'ProductName', productnumber => 'ProductNumber', productversion => 'ProductVersion', productversionls => 'ProductVersionLS', productversionms => 'ProductVersionMS', signature => 'Signature', specialbuild => 'SpecialBuild', strucversion => 'StrucVersion'}->{lc $name}
$name
Truth table33%1/3
A || B
A= {comments => 'Comments', companyname => 'CompanyName', filedate => 'FileDate', filedatels => 'FileDateLS', filedatems => 'FileDateMS', filedescription => 'FileDescription', fileflags => 'FileFlags', fileflagsmask => 'FileFlagsMask', filenumber => 'FileNumber', fileos => 'FileOS', filesubtype => 'FileSubtype', filetype => 'FileType', fileversion => 'FileVersion', fileversionls => 'FileVersionLS', fileversionms => 'FileVersionMS', internalname => 'InternalName', legalcopyright => 'LegalCopyright', legaltrademarks => 'LegalTrademarks', originalfilename => 'OriginalFilename', privatebuild => 'PrivateBuild', productname => 'ProductName', productnumber => 'ProductNumber', productversion => 'ProductVersion', productversionls => 'ProductVersionLS', productversionms => 'ProductVersionMS', signature => 'Signature', specialbuild => 'SpecialBuild', strucversion => 'StrucVersion'}->{lc $name}B= $name
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 22 | ▶ | sub info { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 22 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 40 | 22 | return $self->{info}; | |||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | 10 | ▶ | sub set_info { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_info: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | 10 | my ($self, $info) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 45 | 10 | $self->{info} = $info; | |||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | 10 | ▶ | sub initialize { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
initialize: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | 10 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 50 | 10 | $self->set_info($self->decode_info($self->Data)); | |||||||||||||||||||||||||||||||||||||||||
| 51 | 10 | ▶ | die 'Invalid structure' unless $self->check; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 2 | ▶ | sub refresh { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
refresh: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 56 | 2 | $self->SetData($self->encode_info($self->info)); | |||||||||||||||||||||||||||||||||||||||||
| 57 | 2 | my $rsrc = $self->first_parent('Resources'); | |||||||||||||||||||||||||||||||||||||||||
| 58 | 2 | $rsrc->remove("/#RT_VERSION"); | |||||||||||||||||||||||||||||||||||||||||
| 59 | 2 | $rsrc->insert("/#RT_VERSION/#1/#0" => $self); | |||||||||||||||||||||||||||||||||||||||||
| 60 | 2 | $rsrc->refresh; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 2 | $self->initialize; | |||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 28 | ▶ | sub encode_info { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
encode_info: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | 28 | my ($self, $info) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | 28 | my $key = shift(@$info); | |||||||||||||||||||||||||||||||||||||||||
| 68 | 28 | $key = $self->encode_ucs2("$key\0"); | |||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | 28 | my $val = shift(@$info); | |||||||||||||||||||||||||||||||||||||||||
| 71 | 28 | my ($type, $vallen); | |||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | 28 | ▶ | if (ref $val) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | 4 | $type = 0; # binary | |||||||||||||||||||||||||||||||||||||||||
| 75 | 4 | $val = pack('V*', @$val); | |||||||||||||||||||||||||||||||||||||||||
| 76 | 4 | $vallen = length($val); | |||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||
| 78 | elsif (length $val) { | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 18 | $type = 1; # text; | |||||||||||||||||||||||||||||||||||||||||
| 80 | 18 | $val = $self->encode_ucs2("$val\0"); | |||||||||||||||||||||||||||||||||||||||||
| 81 | 18 | $vallen = length($val) / 2; | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 6 | $type = 1; | |||||||||||||||||||||||||||||||||||||||||
| 85 | 6 | $vallen = 0; | |||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | 28 | my @sub_objects; | |||||||||||||||||||||||||||||||||||||||||
| 89 | 28 | foreach my $sub_info (@$info) { | |||||||||||||||||||||||||||||||||||||||||
| 90 | 26 | my $obj = $self->encode_info($sub_info); | |||||||||||||||||||||||||||||||||||||||||
| 91 | 26 | push(@sub_objects, $obj); | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | 28 | my $buf = pack('v3', 0, $vallen, $type) . $key; | |||||||||||||||||||||||||||||||||||||||||
| 95 | 28 | $buf .= $self->pad($buf, 4); | |||||||||||||||||||||||||||||||||||||||||
| 96 | 28 | $buf .= $val; | |||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | 28 | foreach my $sub_object (@sub_objects) { | |||||||||||||||||||||||||||||||||||||||||
| 99 | 26 | $buf .= $self->pad($buf, 4); | |||||||||||||||||||||||||||||||||||||||||
| 100 | 26 | $buf .= $sub_object; | |||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | 28 | substr($buf, 0, 2, pack('v', length($buf))); | |||||||||||||||||||||||||||||||||||||||||
| 104 | 28 | return $buf; | |||||||||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | 140 | ▶ | sub decode_info { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
decode_info: called CC=12 SCAR=25.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 108 | 140 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 109 | 140 | ▶ | my $level = $_[1] || 1; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$_[1] || 1
MC/DC100%1/1
$_[1] || 1
$_[1]
Truth table100%2/2
A
A= $_[1]
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||
| 111 | 140 | my ($len, $vallen, $type) = unpack('v3', $_[0]); | |||||||||||||||||||||||||||||||||||||||||
| 112 | 140 | ▶ | die 'No record length' unless $len; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 113 | 140 | ▶ | die 'Long length' if $len > length($_[0]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | 140 | my $buf = substr($_[0], 0, $len); | |||||||||||||||||||||||||||||||||||||||||
| 116 | 140 | substr($_[0], 0, $self->align($len, 4)) = ''; | |||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||
| 118 | 140 | my $endkey = index($buf, "\0\0", 6); | |||||||||||||||||||||||||||||||||||||||||
| 119 | 140 | ▶ | while ($endkey > 0 and ($endkey % 2)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$endkey > 0 and $endkey % 2
MC/DC50%1/2
$endkey > 0 and $endkey % 2
$endkey > 0
$endkey % 2
Truth table66%2/3
A and B
A= $endkey > 0B= $endkey % 2
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 140 | $endkey = index($buf, "\0\0", $endkey + 1); | |||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | 140 | ▶ | die 'Invalid endkey' if $endkey < 6 or $endkey > $len - $vallen;; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$endkey < 6 or $endkey > $len - $vallen
MC/DC0%0/2
$endkey < 6 or $endkey > $len - $vallen
$endkey < 6
$endkey > $len - $vallen
Truth table33%1/3
A or B
A= $endkey < 6B= $endkey > $len - $vallen
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||
| 125 | 140 | my $key = substr($buf, 6, $endkey - 6); | |||||||||||||||||||||||||||||||||||||||||
| 126 | 140 | my $u8_key = $self->decode_ucs2($key); | |||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||
| 128 | 140 | my @res = ($u8_key); | |||||||||||||||||||||||||||||||||||||||||
| 129 | 140 | $endkey = $self->align($endkey + 2, 4); | |||||||||||||||||||||||||||||||||||||||||
| 130 | 140 | substr($buf, 0, $endkey, ''); | |||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | 140 | ▶ | if ($vallen) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 110 | ▶ | $vallen *= 2 if $level == 4; # only for strings | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | 110 | my $val = substr($buf, 0, $vallen); | |||||||||||||||||||||||||||||||||||||||||
| 135 | 110 | ▶ | if ($type) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 136 | 90 | $val = $self->decode_ucs2($val); | |||||||||||||||||||||||||||||||||||||||||
| 137 | 90 | $val =~ s/\0\z//; | |||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||
| 139 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 140 | 20 | $val = [ unpack('V*', $val) ]; | |||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||
| 142 | 110 | push(@res, $val); | |||||||||||||||||||||||||||||||||||||||||
| 143 | 110 | $vallen = $self->align($vallen, 4); | |||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||
| 145 | 110 | substr($buf, 0, $vallen) = ''; | |||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||
| 147 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 148 | 30 | push(@res, ''); | |||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||
| 151 | 140 | ▶ | while (length $buf) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | 130 | push(@res, $self->decode_info($buf, $level + 1)); | |||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | 140 | return \@res; | |||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | sub empty_info { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
empty_info: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | [ 'VS_VERSION_INFO', [ 0xFEEF04BD, 1 << 16, (0) x 11 ] ]; | |||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||
| 162 | 10 | ▶ | sub check_info { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_info: called CC=5 SCAR=17.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 163 | 10 | my ($self, $info) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 164 | 10 | ▶ | return 0 unless $info->[0] eq 'VS_VERSION_INFO'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 165 | 10 | ▶ | return 0 unless ref($info->[1]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | 10 | ▶ | return 0 unless $info->[1][0] == 0xFEEF04BD; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | 10 | ▶ | return 0 unless $self->check_sub_info($info); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | 10 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||
| 171 | 140 | ▶ | sub check_sub_info { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_sub_info: called CC=11 SCAR=28.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 172 | 140 | my ($self, $info) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 173 | 140 | ▶ | return unless UNIVERSAL::isa($info, 'ARRAY'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 174 | 140 | ▶ | return if @$info < 2; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 175 | 140 | ▶ | return unless defined($info->[0]) and defined($info->[1]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $info->[0] and defined $info->[1]
MC/DC0%0/2
defined $info->[0] and defined $info->[1]
defined $info->[0]
defined $info->[1]
Truth table33%1/3
A and B
A= defined $info->[0]B= defined $info->[1]
| |||||||||||||||||||||||||||||||||||||||||||
| 176 | 140 | ▶ | return unless !ref($info->[0]) and length($info->[0]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not ref $info->[0] and length $info->[0]
MC/DC0%0/2
not ref $info->[0] and length $info->[0]
not ref $info->[0]
length $info->[0]
Truth table33%1/3
not(A) and B
A= not ref $info->[0]B= length $info->[0]
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 140 | ▶ | return unless !ref($info->[1]) or UNIVERSAL::isa($info->[1], 'ARRAY'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not ref $info->[1] or UNIVERSAL::isa($info->[1], "ARRAY")
MC/DC0%0/2
not ref $info->[1] or UNIVERSAL::isa($info->[1], "ARRAY")
not ref $info->[1]
UNIVERSAL::isa($info->[1], "ARRAY")
Truth table66%2/3
not(A) or B
A= not ref $info->[1]B= UNIVERSAL::isa($info->[1], "ARRAY")
| |||||||||||||||||||||||||||||||||||||||||||
| 178 | 140 | foreach my $idx (2 .. @$info - 1) { | |||||||||||||||||||||||||||||||||||||||||
| 179 | 130 | ▶ | return 0 unless $self->check_sub_info($info->[$idx]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||
| 181 | 140 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||
| 184 | 6 | ▶ | sub get { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get: called CC=17 SCAR=47.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | 6 | my ($self, $name) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 186 | 6 | $name =~ s!\\!/!g; | |||||||||||||||||||||||||||||||||||||||||
| 187 | 6 | $name = $self->lc_to_si($name); | |||||||||||||||||||||||||||||||||||||||||
| 188 | 6 | my $info = $self->info; | |||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||
| 190 | 6 | ▶ | if ($name eq '/') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | return undef unless ref $info->[1]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | return $info->[1]; | |||||||||||||||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | 6 | my $fixed = $self->fi_to_id($name); | |||||||||||||||||||||||||||||||||||||||||
| 196 | 6 | ▶ | if (defined $fixed) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | my $struct = $info->[1]; | |||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | ▶ | return undef unless $struct && ref($struct); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$struct and ref $struct
MC/DC0%0/2
$struct and ref $struct
$struct
ref $struct
Truth table0%0/3
A and B
A= $structB= ref $struct
| |||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | return $struct->[$fixed]; | |||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||
| 202 | 6 | $fixed = $self->fi_to_id($name.'MS'); | |||||||||||||||||||||||||||||||||||||||||
| 203 | 6 | ▶ | if (defined $fixed) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 204 | 6 | my $struct = $info->[1]; | |||||||||||||||||||||||||||||||||||||||||
| 205 | 6 | ▶ | return undef unless $struct && ref($struct); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$struct and ref $struct
MC/DC0%0/2
$struct and ref $struct
$struct
ref $struct
Truth table33%1/3
A and B
A= $structB= ref $struct
| |||||||||||||||||||||||||||||||||||||||||||
| 206 | 6 | my $ms = $struct->[$fixed]; | |||||||||||||||||||||||||||||||||||||||||
| 207 | 6 | my $ls = $struct->[ $self->fi_to_id($name.'LS') ]; | |||||||||||||||||||||||||||||||||||||||||
| 208 | 6 | return join(',', $self->split_dword($ms), $self->split_dword($ls)); | |||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | my $s; | |||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | if ($name =~ s!^/!!) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | $s = $info; | |||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | ▶ | while ($name =~ s!^([^/]+)/!!) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | $s = $self->find_info($s, $1) or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||
| 218 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | ▶ | $s = $self->find_info($info, 'StringFileInfo') or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | if (my $cur_trans = $self->{cur_trans}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | $s = $self->find_info($s, $cur_trans, 1) or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||
| 223 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | $s = $s->[2] or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | $self->{cur_trans} = $s->[0]; | |||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | $s = $self->find_info($s, $name) or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | return $s->[1]; | |||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||
| 233 | 2 | ▶ | sub set { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set: called CC=22 SCAR=54.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 234 | 2 | my ($self, $name, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 235 | 2 | $name =~ s!\\!/!g; | |||||||||||||||||||||||||||||||||||||||||
| 236 | 2 | $name = $self->lc_to_si($name); | |||||||||||||||||||||||||||||||||||||||||
| 237 | 2 | my $info = $self->info; | |||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||
| 239 | 2 | ▶ | if ($name eq '/') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | if (!defined $value) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | $info->[1] = ''; | |||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||
| 243 | ▶ | elsif (UNIVERSAL::isa($value, 'ARRAY') and @$value == 13) { | |||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
UNIVERSAL::isa($value, "ARRAY") and @$value == 13
MC/DC0%0/2
UNIVERSAL::isa($value, "ARRAY") and @$value == 13
UNIVERSAL::isa($value, "ARRAY")
@$value == 13
Truth table0%0/3
A and B
A= UNIVERSAL::isa($value, "ARRAY")B= @$value == 13
| |||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | $info->[1] = $value; | |||||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||||||
| 246 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | die 'Invalid array assigned'; | |||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||
| 251 | 2 | my $fixed = $self->fi_to_id($name); | |||||||||||||||||||||||||||||||||||||||||
| 252 | 2 | ▶ | if (defined $fixed) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | ▶ | $value = oct($value) if $value =~ /^0/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | $info->[1][$fixed] = $value; | |||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||
| 258 | 2 | $fixed = $self->fi_to_id($name.'MS'); | |||||||||||||||||||||||||||||||||||||||||
| 259 | 2 | ▶ | if (defined $fixed) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 260 | 2 | my @value = split(/[,.]/, $value, -1); | |||||||||||||||||||||||||||||||||||||||||
| 261 | 2 | ▶ | if (@value == 4) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 262 | 2 | $value[0] = ($value[0] << 16) | $value[1]; | |||||||||||||||||||||||||||||||||||||||||
| 263 | 2 | $value[1] = ($value[2] << 16) | $value[3]; | |||||||||||||||||||||||||||||||||||||||||
| 264 | 2 | splice(@value, 2); | |||||||||||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||
| 267 | 2 | ▶ | die 'Invalid MS/LS value' if @value != 2; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 268 | 2 | ▶ | $info->[1][$fixed] = $value[0] || 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$value[0] || 0
MC/DC0%0/1
$value[0] || 0
$value[0]
Truth table50%1/2
A
A= $value[0]
| |||||||||||||||||||||||||||||||||||||||||||
| 269 | 2 | ▶ | $info->[1][$self->fi_to_id($name.'LS')] = $value[1] || 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$value[1] || 0
MC/DC0%0/1
$value[1] || 0
$value[1]
Truth table50%1/2
A
A= $value[1]
| |||||||||||||||||||||||||||||||||||||||||||
| 270 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | my $container = $info; | |||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | ▶ | if ($name =~ s!^/!!) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | ▶ | while ($name =~ s!^([^/]+)/!!) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | my $n = $1; | |||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | my $s = $self->find_info($container, $n); | |||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | ▶ | unless ($s) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | $s = [ $n => '' ]; | |||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | push(@$container, $s); | |||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | $container = $s; | |||||||||||||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||||||||||||
| 286 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | my $s = $self->find_info($container, 'StringFileInfo'); | |||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | ▶ | unless ($s) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | $s = [ StringFileInfo => '' ]; | |||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | push(@$container, $s); | |||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | $container = $s; | |||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | my $cur_trans = $self->{cur_trans}; | |||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | ▶ | unless ($cur_trans) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | ▶ | if (@$container > 2) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | $cur_trans = $container->[2][0]; | |||||||||||||||||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||||||||||||||||
| 299 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | $cur_trans = '000004B0'; # Language Neutral && CP 1200 = Unicode | |||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | $self->{cur_trans} = $cur_trans; | |||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | $s = $self->find_info($container, $cur_trans, 1); | |||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | unless ($s) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | $s = [ $cur_trans => '' ]; | |||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | push(@$container, $s); | |||||||||||||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | $container = $s; | |||||||||||||||||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | my ($kv, $kv_index) = $self->find_info($container, $name); | |||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | ▶ | unless ($kv) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | ▶ | push(@$container, [ $name => $value ]) if defined $value; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 316 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 317 | } | ||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | ▶ | if (defined $value) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | $kv->[1] = $value; | |||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||
| 322 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 323 | 0 | splice(@$container, $kv_index, 1); | |||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||
| 325 | } | ||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||
| 327 | 10 | ▶ | sub check { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 328 | 10 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 329 | 10 | return $self->check_info($self->info); | |||||||||||||||||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | ▶ | sub find_info { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
find_info: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | my ($self, $info, $name, $ignore) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 334 | 0 | my $index; | |||||||||||||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | ▶ | if ($name =~ /^#(\d+)$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | $index = $1 - 1 + 2; | |||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | $index = undef if $index < 2 || $index >= @$info; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$index < 2 or $index >= @$info
MC/DC0%0/2
$index < 2 or $index >= @$info
$index < 2
$index >= @$info
Truth table0%0/3
A or B
A= $index < 2B= $index >= @$info
| |||||||||||||||||||||||||||||||||||||||||||
| 339 | } | ||||||||||||||||||||||||||||||||||||||||||
| 340 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | for (2 .. @$info - 1) { | |||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | my $e = $info->[$_]; | |||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | ▶ | if ($e->[0] eq $name or $ignore && lc($e->[0]) eq lc($name)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$e->[0] eq $name or $ignore and lc $e->[0] eq lc $name
$ignore and lc $e->[0] eq lc $name
MC/DC0%0/3
$e->[0] eq $name or $ignore and lc $e->[0] eq lc $name
$e->[0] eq $name
$ignore
lc $e->[0] eq lc $name
Truth table0%0/4
A or B and C
A= $e->[0] eq $nameB= $ignoreC= lc $e->[0] eq lc $name
| |||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | $index = $_; | |||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||
| 346 | } | ||||||||||||||||||||||||||||||||||||||||||
| 347 | } | ||||||||||||||||||||||||||||||||||||||||||
| 348 | } | ||||||||||||||||||||||||||||||||||||||||||
| 349 | 0 | ▶ | if ($index) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | ▶ | return $info->[$index] unless wantarray; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | return ($info->[$index], $index); | |||||||||||||||||||||||||||||||||||||||||
| 352 | } | ||||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||
| 354 | 0 | ▶ | return undef unless wantarray; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | return (undef, undef); | |||||||||||||||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||||||||||||||||
| 358 | 12 | ▶ | sub split_dword { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
split_dword: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 359 | 12 | my ($self, $dword) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 360 | 12 | return ($dword >> 16), ($dword & 0xFFFF); | |||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||
| 363 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||