mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
Add list_hook option to unpacker.
This commit is contained in:
parent
063d51c662
commit
e1711ffcf2
4 changed files with 43 additions and 13 deletions
|
|
@ -304,6 +304,7 @@ _push:
|
|||
case CT_ARRAY_ITEM:
|
||||
if(msgpack_unpack_callback(_array_item)(user, c->curr, &c->obj, obj) < 0) { goto _failed; }
|
||||
if(++c->curr == c->count) {
|
||||
msgpack_unpack_callback(_array_end)(user, &c->obj);
|
||||
obj = c->obj;
|
||||
--top;
|
||||
/*printf("stack pop %d\n", top);*/
|
||||
|
|
@ -317,7 +318,7 @@ _push:
|
|||
case CT_MAP_VALUE:
|
||||
if(msgpack_unpack_callback(_map_item)(user, &c->obj, c->map_key, obj) < 0) { goto _failed; }
|
||||
if(--c->count == 0) {
|
||||
msgpack_unpack_callback(_map_end)(user, &c->obj);
|
||||
msgpack_unpack_callback(_map_end)(user, &c->obj);
|
||||
obj = c->obj;
|
||||
--top;
|
||||
/*printf("stack pop %d\n", top);*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue