line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MaxMind::DB::Common; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
11818
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.040000'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $separator_size; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
BEGIN { |
11
|
1
|
|
|
1
|
|
28
|
$separator_size = 16; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use constant { |
15
|
1
|
|
|
|
|
78
|
LEFT_RECORD => 0, |
16
|
|
|
|
|
|
|
RIGHT_RECORD => 1, |
17
|
|
|
|
|
|
|
DATA_SECTION_SEPARATOR_SIZE => $separator_size, |
18
|
|
|
|
|
|
|
DATA_SECTION_SEPARATOR => ( "\0" x $separator_size ), |
19
|
|
|
|
|
|
|
METADATA_MARKER => "\xab\xcd\xefMaxMind.com", |
20
|
1
|
|
|
1
|
|
3
|
}; |
|
1
|
|
|
|
|
7
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
3
|
use Exporter qw( import ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
75
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
## no critic (Variables::ProhibitPackageVars) |
25
|
|
|
|
|
|
|
our %TypeNumToName = ( |
26
|
|
|
|
|
|
|
0 => 'extended', |
27
|
|
|
|
|
|
|
1 => 'pointer', |
28
|
|
|
|
|
|
|
2 => 'utf8_string', |
29
|
|
|
|
|
|
|
3 => 'double', |
30
|
|
|
|
|
|
|
4 => 'bytes', |
31
|
|
|
|
|
|
|
5 => 'uint16', |
32
|
|
|
|
|
|
|
6 => 'uint32', |
33
|
|
|
|
|
|
|
7 => 'map', |
34
|
|
|
|
|
|
|
8 => 'int32', |
35
|
|
|
|
|
|
|
9 => 'uint64', |
36
|
|
|
|
|
|
|
10 => 'uint128', |
37
|
|
|
|
|
|
|
11 => 'array', |
38
|
|
|
|
|
|
|
12 => 'container', |
39
|
|
|
|
|
|
|
13 => 'end_marker', |
40
|
|
|
|
|
|
|
14 => 'boolean', |
41
|
|
|
|
|
|
|
15 => 'float', |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
our %TypeNameToNum = reverse %TypeNumToName; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
47
|
|
|
|
|
|
|
LEFT_RECORD |
48
|
|
|
|
|
|
|
RIGHT_RECORD |
49
|
|
|
|
|
|
|
DATA_SECTION_SEPARATOR_SIZE |
50
|
|
|
|
|
|
|
DATA_SECTION_SEPARATOR |
51
|
|
|
|
|
|
|
METADATA_MARKER |
52
|
|
|
|
|
|
|
%TypeNumToName |
53
|
|
|
|
|
|
|
%TypeNameToNum |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# ABSTRACT: Code shared by the MaxMind DB reader and writer modules |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |