A number of breaking API changes will be made as we approach a 1.0 release. Please take note of these changes when upgrading.
Breaking Changes:
-
The Node API now separates tree initialization from parsing. After calling one of the
mpack_tree_init()
functions, you must explicitly callmpack_tree_parse()
before accessing any nodes. -
The mpack configuration
mpack-config.h
file is now optional, and requiresMPACK_HAS_CONFIG
in order to be included. This means you must defineMPACK_HAS_CONFIG
when upgrading or your config file will be ignored! (It is recommended to delete your config file and use the defaults.)
New Features:
-
The Node API can now parse multiple messages from a data source.
mpack_tree_parse()
can be called repeatedly to parse each message. -
The Node API can now parse messages indefinitely from a continuous stream. A tree can be initialized with
mpack_tree_init_stream()
to receive a callback for more data. -
The writer now supports a v4 compatibility mode. Call
mpack_writer_set_version(writer, mpack_version_v4);
to encode without using theraw8
andbin
types. -
The stdio helpers now allow reading from a
FILE*
._init_file()
functions have been renamed to_init_filename()
. The old names will continue to work for a few more versions.
Changes:
-
The reader's skip function is no longer ignored under
MPACK_OPTIMIZE_FOR_SIZE
. -
Fixed an allocation bug when closing a growable writer without having written anything.
Changes:
- Fixed incorrect element tracking in
mpack_write_tag()
- Added type-generic writer functions
mpack_write()
andmpack_write_kv()
- Added
mpack_write_object_bytes()
to insert pre-encoded MessagePack into a larger message - Enabled strings in all builds by default
- Fixed unit test errors under
-ffast-math
- Fixed some compiler warnings
Changes:
- Fixed some compiler warnings
- Added various performance improvements
- Improved documentation
Changes:
- Added
mpack_peek_tag()
- Added reader helper functions to expect re-ordered map keys
- Improved documentation and added Pages
- Made node key lookups check for duplicate keys
- Added various UTF-8 checking functions for reader and nodes
- Added support for compiling as C in recent versions of Visual Studio
- Removed
mpack_expect_str_alloc()
andmpack_expect_utf8_alloc()
- Fixed miscellaneous bugs and improved performance
Changes:
- Removed
mpack_reader_destroy_cancel()
andmpack_writer_destroy_cancel()
. You must now flag an error (such asmpack_error_data
) in order to cancel reading. - Added many code size optimizations.
MPACK_OPTIMIZE_FOR_SIZE
is no longer experimental. - Improved and reorganized Writer documentation
- Made writer flag
mpack_error_too_big
instead ofmpack_error_io
if writing too much data without a flush callback - Added optional
skip
callback and optimizedmpack_discard()
- Fixed various compiler and code analysis warnings
- Optimized speed and memory usage
Changes:
- Fixed various bugs in UTF-8 checking, error handler callbacks, out-of-memory and I/O errors, debug print functions and more
- Added many missing Tag and Expect functions such as
mpack_tag_ext()
,mpack_expect_int_range()
andmpack_expect_utf8()
- Added extensive unit tests
Changes:
setjmp
/longjmp
support has been replaced by error callbacks. You can safelylongjmp
or throw C++ exceptions out of error callbacks. Be aware of local variable invalidation rules regardingsetjmp
if you use it. See the documentation formpack_reader_error_t
and issue #19 for more details.- All
inline
functions in the MPack API are no longerstatic
. A single non-inline
definition of eachinline
function is emitted, so they behave like normal functions with external linkage. - Configuration options can now be pre-defined before including
mpack-config.h
, so you can customize MPack by defining these in your build system rather than editing the configuration file.
Changes:
- Fixed compile errors in debug print function
- Fixed C++11 warnings
Changes:
mpack_node_t
is now a handle, so it should be passed by value, not by pointer. Porting to the new version should be as simple as replacingmpack_node_t*
withmpack_node_t
in your code.- Various other minor API changes have been made.
- Major performance improvements were made across all aspects of MPack.
Changes
- Added
mpack_writer_init_growable()
to write to a growable buffer - Converted tree parser to support node pool and pages. The Node API no longer requires an allocator.
- Added Xcode unit test project, included projects in release package
- Fixed various bugs
Changes:
- Changed default config and test suite to use
DEBUG
and_DEBUG
(instead ofNDEBUG
) - Added Visual Studio project for running unit tests
- Fixed various bugs
Changes:
- Added teardown callbacks to reader, writer and tree
- Simplified API for working with files (
mpack_file_tree_t
is now internal)
Initial release.