line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AnyEvent::MPRPC::Constant; |
2
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
103
|
|
3
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
189
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub import { |
6
|
6
|
|
|
6
|
|
54
|
my %a = ( |
7
|
|
|
|
|
|
|
MP_TYPE_REQUEST => 0, |
8
|
|
|
|
|
|
|
MP_TYPE_RESPONSE => 1, |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
MP_RES_TYPE => 0, |
11
|
|
|
|
|
|
|
MP_RES_MSGID => 1, |
12
|
|
|
|
|
|
|
MP_RES_ERROR => 2, |
13
|
|
|
|
|
|
|
MP_RES_RESULT => 3, |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
MP_REQ_TYPE => 0, |
16
|
|
|
|
|
|
|
MP_REQ_MSGID => 1, |
17
|
|
|
|
|
|
|
MP_REQ_METHOD => 2, |
18
|
|
|
|
|
|
|
MP_REQ_PARAMS => 3, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
3
|
|
17
|
no strict 'refs'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
345
|
|
22
|
6
|
|
|
|
|
15
|
my $pkg = caller(0); |
23
|
6
|
|
|
|
|
35
|
while (my ($k, $v) = each %a) { |
24
|
60
|
|
|
0
|
|
364
|
*{"$pkg\::$k"} = sub () { $v }; ## no critic |
|
60
|
|
|
|
|
2731
|
|
|
0
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |