line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
MODULE = MsgPack::Raw PACKAGE = MsgPack::Raw::Unpacker |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Unpacker |
4
|
|
|
|
|
|
|
new (class) |
5
|
|
|
|
|
|
|
SV *class |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
PREINIT: |
8
|
|
|
|
|
|
|
msgpack_raw_unpacker *self; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
CODE: |
11
|
6
|
|
|
|
|
|
Newxz (self, 1, msgpack_raw_unpacker); |
12
|
6
|
50
|
|
|
|
|
if (!msgpack_unpacker_init (&self->unpacker, MSGPACK_UNPACKER_INIT_BUFFER_SIZE)) |
13
|
|
|
|
|
|
|
{ |
14
|
0
|
|
|
|
|
|
Safefree (self); |
15
|
0
|
|
|
|
|
|
croak ("Could not allocate msgpack unpacker"); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
6
|
|
|
|
|
|
RETVAL = self; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
OUTPUT: RETVAL |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
void |
23
|
|
|
|
|
|
|
DESTROY (self) |
24
|
|
|
|
|
|
|
Unpacker self |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
CODE: |
27
|
6
|
|
|
|
|
|
msgpack_unpacker_destroy (&self->unpacker); |
28
|
6
|
|
|
|
|
|
Safefree (self); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
void |
31
|
|
|
|
|
|
|
feed (self, buffer) |
32
|
|
|
|
|
|
|
Unpacker self |
33
|
|
|
|
|
|
|
SV *buffer |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
PREINIT: |
36
|
|
|
|
|
|
|
const char *b; |
37
|
|
|
|
|
|
|
STRLEN size, available; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
CODE: |
40
|
14
|
50
|
|
|
|
|
b = SvPV (buffer, size); |
41
|
|
|
|
|
|
|
|
42
|
14
|
|
|
|
|
|
available = msgpack_unpacker_buffer_capacity (&self->unpacker); |
43
|
14
|
50
|
|
|
|
|
if (size > available) |
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
|
|
|
STRLEN extra = size-available; |
46
|
0
|
|
|
|
|
|
msgpack_unpacker_reserve_buffer (&self->unpacker, extra); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
14
|
|
|
|
|
|
memcpy (msgpack_unpacker_buffer (&self->unpacker), b, size); |
50
|
14
|
|
|
|
|
|
msgpack_unpacker_buffer_consumed (&self->unpacker, size); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
void |
53
|
|
|
|
|
|
|
next (self) |
54
|
|
|
|
|
|
|
Unpacker self |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
PREINIT: |
57
|
|
|
|
|
|
|
msgpack_unpacked u; |
58
|
|
|
|
|
|
|
msgpack_unpack_return ret; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
PPCODE: |
61
|
21
|
|
|
|
|
|
msgpack_unpacked_init (&u); |
62
|
21
|
|
|
|
|
|
ret = msgpack_unpacker_next (&self->unpacker, &u); |
63
|
21
|
|
|
|
|
|
switch (ret) |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
case MSGPACK_UNPACK_SUCCESS: |
66
|
14
|
50
|
|
|
|
|
mXPUSHs (decode_msgpack (&u.data)); |
67
|
14
|
|
|
|
|
|
msgpack_unpacked_destroy (&u); |
68
|
14
|
|
|
|
|
|
XSRETURN (1); |
69
|
|
|
|
|
|
|
break; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
case MSGPACK_UNPACK_CONTINUE: |
72
|
7
|
|
|
|
|
|
msgpack_unpacked_destroy (&u); |
73
|
7
|
|
|
|
|
|
XSRETURN_UNDEF; |
74
|
|
|
|
|
|
|
break; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
case MSGPACK_UNPACK_PARSE_ERROR: |
77
|
0
|
|
|
|
|
|
msgpack_unpacked_destroy (&u); |
78
|
0
|
|
|
|
|
|
croak ("unpack: parse error"); |
79
|
|
|
|
|
|
|
break; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
case MSGPACK_UNPACK_NOMEM_ERROR: |
82
|
0
|
|
|
|
|
|
msgpack_unpacked_destroy (&u); |
83
|
0
|
|
|
|
|
|
croak ("unpack: oom"); |
84
|
|
|
|
|
|
|
break; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
default: |
87
|
0
|
|
|
|
|
|
msgpack_unpacked_destroy (&u); |
88
|
21
|
|
|
|
|
|
croak ("unpack: unknown error"); |
89
|
|
|
|
|
|
|
break; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|