feat(msgpack): convert Blobs to BIN strings

This commit is contained in:
Sean Dewar
2021-08-02 19:27:52 +01:00
parent ab82369c8e
commit af6f454f5c
3 changed files with 17 additions and 3 deletions

View File

@@ -950,7 +950,13 @@ char *encode_tv2json(typval_T *tv, size_t *len)
} while (0)
#define TYPVAL_ENCODE_CONV_BLOB(tv, blob, len) \
abort() /* TODO(seandewar) */ \
do { \
const size_t len_ = (size_t)(len); \
msgpack_pack_bin(packer, len_); \
if (len_ > 0) { \
msgpack_pack_bin_body(packer, (blob)->bv_ga.ga_data, len_); \
} \
} while (0)
#define TYPVAL_ENCODE_CONV_NUMBER(tv, num) \
msgpack_pack_int64(packer, (int64_t)(num))