mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-19 04:33:27 +02:00
Add EXT support to C library
This commit is contained in:
12
src/unpack.c
12
src/unpack.c
@@ -261,6 +261,18 @@ static inline int template_callback_bin(unpack_user* u, const char* b, const cha
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int template_callback_ext(unpack_user* u, const char* b, const char* p, unsigned int l, msgpack_object* o)
|
||||
{
|
||||
MSGPACK_UNUSED(u);
|
||||
MSGPACK_UNUSED(b);
|
||||
o->type = MSGPACK_OBJECT_EXT;
|
||||
o->via.ext.type = *p;
|
||||
o->via.ext.ptr = p + 1;
|
||||
o->via.ext.size = l - 1;
|
||||
u->referenced = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "msgpack/unpack_template.h"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user