line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::MMagic::XS; |
2
|
7
|
|
|
7
|
|
208634
|
use strict; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
342
|
|
3
|
7
|
|
|
7
|
|
39
|
use warnings; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
214
|
|
4
|
7
|
|
|
7
|
|
41
|
use XSLoader; |
|
7
|
|
|
|
|
25
|
|
|
7
|
|
|
|
|
1063
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION; |
7
|
|
|
|
|
|
|
our $MAGIC_FILE; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN |
10
|
|
|
|
|
|
|
{ |
11
|
7
|
|
|
7
|
|
21
|
$VERSION = '0.09008'; |
12
|
7
|
|
|
|
|
6240
|
XSLoader::load(__PACKAGE__, $VERSION); |
13
|
|
|
|
|
|
|
|
14
|
7
|
|
|
|
|
104
|
require File::Spec; |
15
|
7
|
|
|
|
|
18
|
foreach my $path (map { File::Spec->catfile($_, qw(File MMagic magic)) } @INC) { |
|
84
|
|
|
|
|
809
|
|
16
|
14
|
100
|
|
|
|
353
|
if (-f $path) { |
17
|
7
|
|
|
|
|
23
|
$MAGIC_FILE = $path; |
18
|
7
|
|
|
|
|
2157
|
last; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub import |
24
|
|
|
|
|
|
|
{ |
25
|
7
|
|
|
7
|
|
54
|
my $class = shift; |
26
|
|
|
|
|
|
|
|
27
|
7
|
|
|
|
|
34
|
for(my $idx = 0; $idx < @_; $idx++) { |
28
|
2
|
50
|
|
|
|
10
|
if ($_[$idx] eq ':compat') { |
29
|
2
|
|
|
|
|
6
|
*checktype_filename = \&get_mime; |
30
|
2
|
|
|
|
|
5
|
*checktype_filehandle = \&fhmagic; |
31
|
2
|
|
|
|
|
4
|
*checktype_contents = \&bufmagic; |
32
|
2
|
|
|
|
|
4
|
*addMagicEntry = \&add_magic; |
33
|
|
|
|
|
|
|
|
34
|
2
|
50
|
|
|
|
26
|
splice(@_, $idx, 1) and last; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
7
|
|
|
|
|
9032
|
$class->SUPER::import(@_); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new { |
42
|
8
|
|
|
8
|
1
|
10637
|
my ($class, $magic_file) = @_; |
43
|
8
|
|
33
|
|
|
76
|
$magic_file ||= $MAGIC_FILE; |
44
|
|
|
|
|
|
|
|
45
|
8
|
|
|
|
|
175
|
my $self = $class->_create(); |
46
|
8
|
|
|
|
|
4883
|
$self->parse_magic_file( $magic_file ); |
47
|
8
|
|
|
|
|
35
|
return $self; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |