Add bin type support.

This commit is contained in:
INADA Naoki 2013-10-17 08:35:08 +09:00
parent f45d7b4e2d
commit da12e177a3
6 changed files with 81 additions and 26 deletions

View file

@ -226,4 +226,13 @@ static inline int unpack_callback_raw(unpack_user* u, const char* b, const char*
return 0;
}
static inline int unpack_callback_bin(unpack_user* u, const char* b, const char* p, unsigned int l, msgpack_unpack_object* o)
{
PyObject *py = PyBytes_FromStringAndSize(p, l);
if (!py)
return -1;
*o = py;
return 0;
}
#include "unpack_template.h"