line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
MODULE = URI::XS PACKAGE = URI::XS |
2
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
SV* encode_uri_component (string_view input, bool plus = false) : ALIAS(encodeURIComponent=1) { |
5
|
4
|
50
|
|
|
|
|
RETVAL = newSV(input.length()*3 + 1); |
6
|
4
|
|
|
|
|
|
SvPOK_on(RETVAL); |
7
|
4
|
100
|
|
|
|
|
size_t rlen = encode_uri_component(input, SvPVX(RETVAL), plus ? URIComponent::query_param_plus : URIComponent::query_param); |
|
|
50
|
|
|
|
|
|
8
|
4
|
|
|
|
|
|
SvPVX(RETVAL)[rlen] = 0; |
9
|
4
|
|
|
|
|
|
SvCUR_set(RETVAL, rlen); |
10
|
|
|
|
|
|
|
PERL_UNUSED_VAR(ix); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
SV* decode_uri_component (string_view input) : ALIAS(decodeURIComponent=1) { |
14
|
4
|
50
|
|
|
|
|
RETVAL = newSV(input.length()+1); |
15
|
4
|
|
|
|
|
|
SvPOK_on(RETVAL); |
16
|
4
|
50
|
|
|
|
|
size_t rlen = decode_uri_component(input, SvPVX(RETVAL)); |
17
|
4
|
|
|
|
|
|
SvPVX(RETVAL)[rlen] = 0; |
18
|
4
|
|
|
|
|
|
SvCUR_set(RETVAL, rlen); |
19
|
|
|
|
|
|
|
PERL_UNUSED_VAR(ix); |
20
|
|
|
|
|
|
|
} |