10 #ifndef MSGPACK_PACK_H
11 #define MSGPACK_PACK_H
49 static int msgpack_pack_signed_char(
msgpack_packer* pk,
signed char d);
53 static int msgpack_pack_long_long(
msgpack_packer* pk,
long long d);
54 static int msgpack_pack_unsigned_char(
msgpack_packer* pk,
unsigned char d);
55 static int msgpack_pack_unsigned_short(
msgpack_packer* pk,
unsigned short d);
56 static int msgpack_pack_unsigned_int(
msgpack_packer* pk,
unsigned int d);
57 static int msgpack_pack_unsigned_long(
msgpack_packer* pk,
unsigned long d);
58 static int msgpack_pack_unsigned_long_long(
msgpack_packer* pk,
unsigned long long d);
70 static int msgpack_pack_fix_uint16(
msgpack_packer* pk, uint16_t d);
71 static int msgpack_pack_fix_uint32(
msgpack_packer* pk, uint32_t d);
72 static int msgpack_pack_fix_uint64(
msgpack_packer* pk, uint64_t d);
90 static int msgpack_pack_str_body(
msgpack_packer* pk,
const void* b,
size_t l);
93 static int msgpack_pack_v4raw_body(
msgpack_packer* pk,
const void* b,
size_t l);
96 static int msgpack_pack_bin_body(
msgpack_packer* pk,
const void* b,
size_t l);
98 static int msgpack_pack_ext(
msgpack_packer* pk,
size_t l, int8_t type);
99 static int msgpack_pack_ext_body(
msgpack_packer* pk,
const void* b,
size_t l);
108 #define msgpack_pack_inline_func(name) \
109 inline int msgpack_pack ## name
111 #define msgpack_pack_inline_func_cint(name) \
112 inline int msgpack_pack ## name
114 #define msgpack_pack_inline_func_fixint(name) \
115 inline int msgpack_pack_fix ## name
117 #define msgpack_pack_user msgpack_packer*
119 #define msgpack_pack_append_buffer(user, buf, len) \
120 return (*(user)->callback)((user)->data, (const char*)buf, len)
133 if(!pk) {
return NULL; }
134 msgpack_packer_init(pk,
data, callback);