diff options
author | INADA Naoki <songofacandy@gmail.com> | 2013-10-17 08:35:08 +0900 |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2013-10-17 08:35:08 +0900 |
commit | da12e177a31445492795f4003bbe0328645325b2 (patch) | |
tree | 8e4d4d8ff30e9d0ff8fa8298cf9c64d74a7af8b5 /msgpack/unpack.h | |
parent | f45d7b4e2d362222698b755444ffb61f1cf74b02 (diff) | |
download | msgpack-python-da12e177a31445492795f4003bbe0328645325b2.tar.gz |
Add bin type support.
Diffstat (limited to 'msgpack/unpack.h')
-rw-r--r-- | msgpack/unpack.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/msgpack/unpack.h b/msgpack/unpack.h index baeed1f..03c735e 100644 --- a/msgpack/unpack.h +++ b/msgpack/unpack.h @@ -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" |