line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Ref::Store::Common; |
2
|
1
|
|
|
1
|
|
3987
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
6
|
use base qw(Exporter); |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
232
|
|
5
|
1
|
|
|
1
|
|
6
|
use Carp qw(carp confess); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
247
|
|
6
|
|
|
|
|
|
|
our (@EXPORT,%EXPORT_TAGS,@EXPORT_OK); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my @logfuncs; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub log_dummy { |
11
|
0
|
|
|
0
|
0
|
|
@_ = sprintf("".shift @_, @_); |
12
|
0
|
|
|
|
|
|
goto &carp; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$SIG{__DIE__} = \&confess; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
BEGIN { |
18
|
1
|
|
|
1
|
|
3
|
@logfuncs = map { $_, $_ . 'f' } map { 'log_' . $_ } |
|
5
|
|
|
|
|
63
|
|
|
5
|
|
|
|
|
18
|
|
19
|
|
|
|
|
|
|
qw(warn crit info debug err); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use Module::Stubber |
23
|
10
|
|
|
|
|
32
|
'Log::Fu' => [ { level => "debug" } ], |
24
|
1
|
|
|
1
|
|
1454
|
will_use => { map { $_ => \&log_dummy } @logfuncs }; |
|
1
|
|
|
|
|
2168
|
|
|
1
|
|
|
|
|
6
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
#Keep these in sync with hrdefs.h HR_HKEY_LOOKUP_ |
27
|
1
|
|
|
|
|
11
|
use Constant::Generate [qw( |
28
|
|
|
|
|
|
|
HR_TIDX_NULL |
29
|
|
|
|
|
|
|
HR_TIDX_SLOOKUP |
30
|
|
|
|
|
|
|
HR_TIDX_FLOOKUP |
31
|
|
|
|
|
|
|
HR_TIDX_RLOOKUP |
32
|
|
|
|
|
|
|
HR_TIDX_KEYTYPES |
33
|
|
|
|
|
|
|
HR_TIDX_ALOOKUP |
34
|
|
|
|
|
|
|
HR_TIDX_KEYFUNC |
35
|
|
|
|
|
|
|
HR_TIDX_UNKEYFUNC |
36
|
|
|
|
|
|
|
HR_TIDX_FLAGS |
37
|
|
|
|
|
|
|
HR_TIDX_PRIVDATA |
38
|
|
|
|
|
|
|
HR_TIDX_ITER |
39
|
1
|
|
|
1
|
|
4230
|
)], export => 1; |
|
1
|
|
|
|
|
32897
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#These map method names to lookup indicex |
42
|
|
|
|
|
|
|
our %LookupNames = ( |
43
|
|
|
|
|
|
|
reverse => HR_TIDX_RLOOKUP, |
44
|
|
|
|
|
|
|
scalar_lookup => HR_TIDX_SLOOKUP, |
45
|
|
|
|
|
|
|
forward => HR_TIDX_FLOOKUP, |
46
|
|
|
|
|
|
|
attr_lookup => HR_TIDX_ALOOKUP, |
47
|
|
|
|
|
|
|
keyfunc => HR_TIDX_KEYFUNC, |
48
|
|
|
|
|
|
|
unkeyfunc => HR_TIDX_UNKEYFUNC, |
49
|
|
|
|
|
|
|
keytypes => HR_TIDX_KEYTYPES, |
50
|
|
|
|
|
|
|
priv => HR_TIDX_PRIVDATA, |
51
|
|
|
|
|
|
|
flags => HR_TIDX_FLAGS, |
52
|
|
|
|
|
|
|
_iter => HR_TIDX_ITER |
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
|
|
5
|
use Constant::Generate [qw( |
56
|
|
|
|
|
|
|
HR_KFLD_STRSCALAR |
57
|
|
|
|
|
|
|
HR_KFLD_REFSCALAR |
58
|
|
|
|
|
|
|
HR_KFLD_TABLEREF |
59
|
|
|
|
|
|
|
HR_KFLD_ATTRHASH |
60
|
|
|
|
|
|
|
HR_KFLD_AVAILABLE |
61
|
1
|
|
|
1
|
|
613
|
)], export => 1; |
|
1
|
|
|
|
|
2
|
|
62
|
|
|
|
|
|
|
|
63
|
1
|
|
|
|
|
4
|
use Constant::Generate [qw( |
64
|
|
|
|
|
|
|
HR_REVERSE_KEYS |
65
|
|
|
|
|
|
|
HR_REVERSE_ATTRS |
66
|
1
|
|
|
1
|
|
342
|
)], export => 1; |
|
1
|
|
|
|
|
2
|
|
67
|
|
|
|
|
|
|
|
68
|
1
|
|
|
|
|
9
|
use Constant::Generate [qw( |
69
|
|
|
|
|
|
|
DUPIDX_RLOOKUP |
70
|
|
|
|
|
|
|
DUPIDX_FLOOKUP |
71
|
|
|
|
|
|
|
DUPIDX_ALOOKUP |
72
|
|
|
|
|
|
|
DUPIDX_SLOOKUP |
73
|
1
|
|
|
1
|
|
375
|
)], -tag => 'pp_constants' => -export_ok => 1; |
|
1
|
|
|
|
|
2
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
#Keep this in sync with C code |
76
|
|
|
|
|
|
|
use Constant::Generate { |
77
|
1
|
|
|
|
|
6
|
HR_PREFIX_DELIM => '#' |
78
|
1
|
|
|
1
|
|
294
|
}, export => 1; |
|
1
|
|
|
|
|
2
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
BEGIN { |
81
|
1
|
50
|
|
1
|
|
230
|
if(!$Module::Stubber::Status{'Log::Fu'}) { |
82
|
1
|
|
|
|
|
38
|
push @EXPORT, @logfuncs; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
1; |