50static int msgpack_pack_signed_char(
msgpack_packer* pk,
signed char d);
55static int msgpack_pack_unsigned_char(
msgpack_packer* pk,
unsigned char d);
56static int msgpack_pack_unsigned_short(
msgpack_packer* pk,
unsigned short d);
57static int msgpack_pack_unsigned_int(
msgpack_packer* pk,
unsigned int d);
58static int msgpack_pack_unsigned_long(
msgpack_packer* pk,
unsigned long d);
59static int msgpack_pack_unsigned_long_long(
msgpack_packer* pk,
unsigned long long d);
91static int msgpack_pack_str_body(
msgpack_packer* pk,
const void* b,
size_t l);
92static int msgpack_pack_str_with_body(
msgpack_packer* pk,
const void* b,
size_t l);
95static int msgpack_pack_v4raw_body(
msgpack_packer* pk,
const void* b,
size_t l);
98static int msgpack_pack_bin_body(
msgpack_packer* pk,
const void* b,
size_t l);
99static int msgpack_pack_bin_with_body(
msgpack_packer* pk,
const void* b,
size_t l);
101static int msgpack_pack_ext(
msgpack_packer* pk,
size_t l, int8_t type);
102static int msgpack_pack_ext_body(
msgpack_packer* pk,
const void* b,
size_t l);
103static int msgpack_pack_ext_with_body(
msgpack_packer* pk,
const void* b,
size_t l, int8_t type);
114#define msgpack_pack_inline_func(name) \
115 inline int msgpack_pack ## name
117#define msgpack_pack_inline_func_cint(name) \
118 inline int msgpack_pack ## name
120#define msgpack_pack_inline_func_fixint(name) \
121 inline int msgpack_pack_fix ## name
123#define msgpack_pack_user msgpack_packer*
125#define msgpack_pack_append_buffer(user, buf, len) \
126 return (*(user)->callback)((user)->data, (const char*)buf, len)
128#include "pack_template.h"
139 if(!pk) {
return NULL; }
140 msgpack_packer_init(pk,
data, callback);
149inline int msgpack_pack_str_with_body(
msgpack_packer* pk,
const void* b,
size_t l)
151 int ret = msgpack_pack_str(pk, l);
152 if (
ret != 0) {
return ret; }
153 return msgpack_pack_str_body(pk, b, l);
156 inline int msgpack_pack_bin_with_body(
msgpack_packer* pk,
const void* b,
size_t l)
158 int ret = msgpack_pack_bin(pk, l);
159 if (
ret != 0) {
return ret; }
160 return msgpack_pack_bin_body(pk, b, l);
163 inline int msgpack_pack_ext_with_body(
msgpack_packer* pk,
const void* b,
size_t l, int8_t type)
165 int ret = msgpack_pack_ext(pk, l, type);
166 if (
ret != 0) {
return ret; }
167 return msgpack_pack_ext_body(pk, b, l);
MSGPACK_DLLEXPORT int msgpack_pack_object(msgpack_packer *pk, msgpack_object d)
int(* msgpack_packer_write)(void *data, const char *buf, size_t len)
Definition pack.h:36
msgpack_packer_write callback
Definition pack.h:40
void * data
Definition pack.h:39
Definition timestamp.h:20
const void * n
Definition unpack_template.h:100
int ret
Definition unpack_template.h:114
const char * data
Definition unpack_template.h:94
const char size_t len
Definition unpack_template.h:94