From 708d4d6c656dd15ba2854b65d68eb61c6d0ee04d Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Tue, 30 Jun 2020 23:13:18 +0900 Subject: [PATCH] Updated v2_0_c_overview (markdown) --- v2_0_c_overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2_0_c_overview.md b/v2_0_c_overview.md index b5de7c0..a9abad6 100644 --- a/v2_0_c_overview.md +++ b/v2_0_c_overview.md @@ -113,7 +113,7 @@ Those functions are corresponding to [msgpack format](https://github.com/msgpack To pack STR, RAW(v4 format), BIN, and EXT, call `msgpack_pack_[str|v4raw|bin|ext]` to provide a size and then call `msgpack_pack_[str|v4raw|bin|ext]_body` to provide a payload. To pack ARRAY, call `msgpack_pack_array` to provide the number of elements and then call any `msgpack_pack_*` functions the number times. To pack MAP, call `msgpack_pack_map` to provide the number of elements and then call any `msgpack_pack_*` functions the number*2 times (key and value). -When you use packer as value (not pointer), you don't need to call destroy function. Be careful that [msgpack_packer_free](https://github.com/msgpack/msgpack-c/blob/master/include/msgpack/pack.h#L53) is not a destroy function for a packer as value. It is for [msgpack_packer_new](https://github.com/msgpack/msgpack-c/blob/master/include/msgpack/pack.h#L52). If you want to create a packer on heap, call `msgpack_packer_new` to create a packer and `msgpack_packer_free` to destroy(free) the packer. +When you use packer as value (not pointer), you don't need to call destroy function. Be careful that [msgpack_packer_free](https://github.com/msgpack/msgpack-c/blob/c_master/include/msgpack/pack.h#L53) is not a destroy function for a packer as value. It is for [msgpack_packer_new](https://github.com/msgpack/msgpack-c/blob/c_master/include/msgpack/pack.h#L52). If you want to create a packer on heap, call `msgpack_packer_new` to create a packer and `msgpack_packer_free` to destroy(free) the packer. ### Unpack @@ -173,7 +173,7 @@ Now, msgpack_unpacker has enough buffer size. You can get buffer pointer using m memcpy(msgpack_unpacker_buffer(&unp), data, request_size); ``` -The number of writing bytes is might not always equal to reqest_size. See https://github.com/msgpack/msgpack-c/blob/master/example/c/lib_buffer_unpack.c. +The number of writing bytes is might not always equal to reqest_size. See https://github.com/msgpack/msgpack-c/blob/c_master/example/c/lib_buffer_unpack.c. After writing, you need to notify the number of wrote bytes to msgpack_unpacker using msgpack_unpacker_buffer_consumed().