Add msgpack_object_print_buffer() function

In order to print the msgpack object in a memory buffer.
This commit is contained in:
Stefan Mititelu
2016-07-06 15:54:35 +03:00
committed by Stefan Mititelu
parent 42181289ed
commit 4fa661a63d
4 changed files with 212 additions and 0 deletions

View File

@@ -98,6 +98,9 @@ typedef struct msgpack_object_kv {
MSGPACK_DLLEXPORT
void msgpack_object_print(FILE* out, msgpack_object o);
MSGPACK_DLLEXPORT
int msgpack_object_print_buffer(char *buffer, uint32_t buffer_size, msgpack_object o);
MSGPACK_DLLEXPORT
bool msgpack_object_equal(const msgpack_object x, const msgpack_object y);

View File

@@ -14,6 +14,11 @@
#include <stdlib.h>
#include <stddef.h>
#if defined(_MSC_VER) && _MSC_VER <= 1800
# define snprintf(buf, len, format,...) _snprintf_s(buf, len, len, format, __VA_ARGS__)
#endif
#if defined(_MSC_VER) && _MSC_VER < 1600
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;