line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MaxMind::DB::Common; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
21754
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
52
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.040001'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $separator_size; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
BEGIN { |
11
|
1
|
|
|
1
|
|
57
|
$separator_size = 16; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use constant { |
15
|
1
|
|
|
|
|
148
|
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
|
|
6
|
}; |
|
1
|
|
|
|
|
2
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
5
|
use Exporter qw( import ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
135
|
|
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__ |