9#ifndef MSGPACK_CODEC_H_
10#define MSGPACK_CODEC_H_
19#define MP_FIXINT_MAX 0x7f
22#define MP_NEG_FIXINT 0xe0
30#define MP_FLOAT32 0xca
31#define MP_FLOAT64 0xcb
47#define MP_FIXSTR_MASK 0x1f
53#define MP_FIXARRAY 0x90
54#define MP_FIXARRAY_MASK 0x0f
55#define MP_ARRAY16 0xdc
56#define MP_ARRAY32 0xdd
60#define MP_FIXMAP_MASK 0x0f
67 const unsigned char *data;
77static void mp_pack_nil(
sstr_t out);
78static void mp_pack_bool(
sstr_t out,
int v);
79static void mp_pack_int(
sstr_t out, int64_t v);
80static void mp_pack_uint(
sstr_t out, uint64_t v);
81static void mp_pack_float(
sstr_t out,
float v);
82static void mp_pack_double(
sstr_t out,
double v);
83static void mp_pack_str(
sstr_t out,
const char *s, uint32_t len);
85static void mp_pack_array_header(
sstr_t out, uint32_t count);
86static void mp_pack_map_header(
sstr_t out, uint32_t count);
90static int mp_reader_init(
struct mp_reader *r,
const unsigned char *data,
size_t len);
93static int mp_unpack_nil(
struct mp_reader *r);
94static int mp_unpack_bool(
struct mp_reader *r,
int *out);
95static int mp_unpack_int64(
struct mp_reader *r, int64_t *out);
96static int mp_unpack_uint64(
struct mp_reader *r, uint64_t *out);
97static int mp_unpack_float(
struct mp_reader *r,
float *out);
98static int mp_unpack_double(
struct mp_reader *r,
double *out);
99static int mp_unpack_str(
struct mp_reader *r,
const char **out, uint32_t *out_len);
100static int mp_unpack_array_header(
struct mp_reader *r, uint32_t *count);
101static int mp_unpack_map_header(
struct mp_reader *r, uint32_t *count);
104static int mp_unpack_skip(
struct mp_reader *r);
107static int mp_unpack_number_as_int64(
struct mp_reader *r, int64_t *out);
108static int mp_unpack_number_as_uint64(
struct mp_reader *r, uint64_t *out);
109static int mp_unpack_number_as_double(
struct mp_reader *r,
double *out);
void * sstr_t
sstr_t are objects that represent sequences of characters.
Definition sstr.h:75
Definition msgpack_codec.h:66
position of string
Definition struct_parse.h:175