summaryrefslogtreecommitdiff
path: root/msgpack/unpack.h
diff options
context:
space:
mode:
Diffstat (limited to 'msgpack/unpack.h')
-rw-r--r--msgpack/unpack.h9
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"