mirror of
https://github.com/msgpack/msgpack-c
synced 2026-06-08 16:11:40 +00:00
Updated v2_0_c_overview (markdown)
+1
-1
@@ -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/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.
|
||||
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#L46) 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#L45). 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user