FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
msgpack-python/msgpack/unpack_container_header.h at main · DiamondLightSource/msgpack-python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
DiamondLightSource
/
msgpack-python
Public
forked from
msgpack/msgpack-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
msgpack-python
/
msgpack
/
unpack_container_header.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
54 lines (49 loc) · 1.38 KB
Breadcrumbs
msgpack-python
/
msgpack
/
unpack_container_header.h
Copy path
File metadata and controls
54 lines (49 loc) · 1.38 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
static
inline
int
unpack_container_header
(
unpack_context
*
ctx
,
const
char
*
data
,
Py_ssize_t
len
,
Py_ssize_t
*
off
)
{
assert
(
len
>=
*
off
);
uint32_t
size
;
const
unsigned
char
*
const
p
=
(
unsigned
char
*
)
data
+
*
off
;
#define
inc_offset
(
inc
) \
if (len - *off < inc) \
return 0; \
*off += inc;
switch
(
*
p
) {
case
var_offset
:
inc_offset
(
3
);
size
=
_msgpack_load16
(
uint16_t
,
p
+
1
);
break
;
case
var_offset
+
1
:
inc_offset
(
5
);
size
=
_msgpack_load32
(
uint32_t
,
p
+
1
);
break
;
#ifdef
USE_CASE_RANGE
case
fixed_offset
+
0x0
...
fixed_offset
+
0xf
:
#else
case
fixed_offset
+
0x0
:
case
fixed_offset
+
0x1
:
case
fixed_offset
+
0x2
:
case
fixed_offset
+
0x3
:
case
fixed_offset
+
0x4
:
case
fixed_offset
+
0x5
:
case
fixed_offset
+
0x6
:
case
fixed_offset
+
0x7
:
case
fixed_offset
+
0x8
:
case
fixed_offset
+
0x9
:
case
fixed_offset
+
0xa
:
case
fixed_offset
+
0xb
:
case
fixed_offset
+
0xc
:
case
fixed_offset
+
0xd
:
case
fixed_offset
+
0xe
:
case
fixed_offset
+
0xf
:
#endif
++
*
off
;
size
=
((
unsigned
int
)
*
p
)
&
0x0f
;
break
;
default
:
PyErr_SetString
(
PyExc_ValueError
,
"Unexpected type header on stream"
);
return
-1
;
}
if
(
unpack_callback_uint32
(
&
ctx
->
user
,
size
,
&
ctx
->
stack
[
0
].
obj
)
<
0
)
return
-1
;
return
1
;
}
Back
|
FazBrowse Home
|
New Git URL