line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
#include |
4
|
|
|
|
|
|
|
#include |
5
|
|
|
|
|
|
|
#include |
6
|
|
|
|
|
|
|
#include |
7
|
|
|
|
|
|
|
#include |
8
|
|
|
|
|
|
|
#include |
9
|
|
|
|
|
|
|
#include |
10
|
|
|
|
|
|
|
#include |
11
|
|
|
|
|
|
|
#include |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
using namespace panda::lib; |
14
|
|
|
|
|
|
|
using namespace panda; |
15
|
|
|
|
|
|
|
using namespace xs::lib; |
16
|
|
|
|
|
|
|
using namespace xs::exp; |
17
|
|
|
|
|
|
|
using panda::logger::Level; |
18
|
|
|
|
|
|
|
using xs::SvIntrPtr; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
MODULE = Panda::Lib PACKAGE = Panda::Lib |
21
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
uint64_t hash64 (SV* source) : ALIAS(string_hash=1) { |
24
|
|
|
|
|
|
|
STRLEN len; |
25
|
1
|
50
|
|
|
|
|
const char* str = SvPV(source, len); |
|
|
0
|
|
|
|
|
|
26
|
1
|
50
|
|
|
|
|
RETVAL = hash64(str, len); |
27
|
|
|
|
|
|
|
PERL_UNUSED_VAR(ix); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
uint32_t hash32 (SV* source) : ALIAS(string_hash32=1) { |
31
|
|
|
|
|
|
|
STRLEN len; |
32
|
1
|
50
|
|
|
|
|
const char* str = SvPV(source, len); |
|
|
0
|
|
|
|
|
|
33
|
1
|
50
|
|
|
|
|
RETVAL = hash32(str, len); |
34
|
|
|
|
|
|
|
PERL_UNUSED_VAR(ix); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
uint64_t hash_murmur64a (SV* source) { |
38
|
|
|
|
|
|
|
STRLEN len; |
39
|
0
|
0
|
|
|
|
|
const char* str = SvPV(source, len); |
|
|
0
|
|
|
|
|
|
40
|
0
|
0
|
|
|
|
|
RETVAL = hash_murmur64a(str, len); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
uint32_t hash_jenkins_one_at_a_time (SV* source) { |
44
|
|
|
|
|
|
|
STRLEN len; |
45
|
0
|
0
|
|
|
|
|
const char* str = SvPV(source, len); |
|
|
0
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
RETVAL = hash_jenkins_one_at_a_time(str, len); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
SV* crypt_xor (SV* source_string, SV* key_string) { |
50
|
|
|
|
|
|
|
STRLEN slen, klen; |
51
|
3
|
50
|
|
|
|
|
char* str = SvPV(source_string, slen); |
|
|
0
|
|
|
|
|
|
52
|
3
|
50
|
|
|
|
|
char* key = SvPV(key_string, klen); |
|
|
0
|
|
|
|
|
|
53
|
3
|
50
|
|
|
|
|
RETVAL = newSV(slen+1); |
54
|
3
|
|
|
|
|
|
SvPOK_on(RETVAL); |
55
|
3
|
|
|
|
|
|
SvCUR_set(RETVAL, slen); |
56
|
3
|
50
|
|
|
|
|
crypt_xor(str, slen, key, klen, SvPVX(RETVAL)); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
SV* hash_merge (HV* dest, HV* source, int flags = 0) { |
60
|
17
|
|
|
|
|
|
HV* result = hash_merge(aTHX_ dest, source, flags); |
61
|
17
|
100
|
|
|
|
|
if (result == dest) { // hash not changed - return the same RV for speed |
62
|
12
|
|
|
|
|
|
RETVAL = ST(0); |
63
|
12
|
|
|
|
|
|
SvREFCNT_inc_simple_void_NN(RETVAL); |
64
|
|
|
|
|
|
|
} |
65
|
5
|
|
|
|
|
|
else RETVAL = newRV_noinc((SV*)result); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
SV* merge (SV* dest, SV* source, int flags = 0) { |
69
|
8
|
|
|
|
|
|
RETVAL = merge(aTHX_ dest, source, flags); |
70
|
8
|
100
|
|
|
|
|
if (RETVAL == dest) SvREFCNT_inc_simple_void_NN(RETVAL); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
SV* lclone (SV* source) { |
74
|
0
|
|
|
|
|
|
RETVAL = clone(aTHX_ source, false); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
SV* fclone (SV* source) { |
78
|
4
|
|
|
|
|
|
RETVAL = clone(aTHX_ source, true); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
SV* clone (SV* source, bool cross = false) { |
82
|
22
|
|
|
|
|
|
RETVAL = clone(aTHX_ source, cross); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
bool compare (SV* first, SV* second) { |
86
|
57
|
|
|
|
|
|
RETVAL = sv_compare(aTHX_ first, second); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
INCLUDE: CallbackDispatcher.xsi |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
INCLUDE: NativeCallbackDispatcher.xsi |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
INCLUDE: Logger.xsi |