diff options
Diffstat (limited to 'cpp/unpack.cc')
-rw-r--r-- | cpp/unpack.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cpp/unpack.cc b/cpp/unpack.cc new file mode 100644 index 0000000..ce57e67 --- /dev/null +++ b/cpp/unpack.cc @@ -0,0 +1,30 @@ +#include "unpack.h" +#include "unpack_context.h" +#include <stdlib.h> + +msgpack_unpack_t* msgpack_unpack_new(void) +{ + msgpack_unpacker* ctx; + ctx = (msgpack_unpacker*)calloc(1, sizeof(msgpack_unpacker)); + if(ctx == NULL) { return NULL; } + msgpack_unpacker_init(ctx); + return (msgpack_unpack_t*)ctx; +} + +void msgpack_unpack_free(msgpack_unpack_t* ctx) +{ + free((msgpack_unpacker*)ctx); +} + +int msgpack_unpack_execute(msgpack_unpack_t* ctx, const char* data, size_t len, size_t* off) +{ + return msgpack_unpacker_execute( + (msgpack_unpacker*)ctx, + data, len, off); +} + +void* msgpack_unpack_data(msgpack_unpack_t* ctx) +{ + return msgpack_unpacker_data((msgpack_unpacker*)ctx); +} + |