mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
lang/c/msgpack: added Messagepack, a binary-based efficient data interchange format.
git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@48 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
This commit is contained in:
commit
269cda016d
50 changed files with 4869 additions and 0 deletions
30
cpp/unpack.cc
Normal file
30
cpp/unpack.cc
Normal file
|
|
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue