MessagePack for C
Macros | Functions
pack_template.h File Reference

Go to the source code of this file.

Macros

#define msgpack_pack_real_uint8(x, d)
 
#define msgpack_pack_real_uint16(x, d)
 
#define msgpack_pack_real_uint32(x, d)
 
#define msgpack_pack_real_uint64(x, d)
 
#define msgpack_pack_real_int8(x, d)
 
#define msgpack_pack_real_int16(x, d)
 
#define msgpack_pack_real_int32(x, d)
 
#define msgpack_pack_real_int64(x, d)
 

Functions

msgpack_pack_inline_func() _uint8 (msgpack_pack_user x, uint8_t d)
 
msgpack_pack_inline_func() _uint16 (msgpack_pack_user x, uint16_t d)
 
msgpack_pack_inline_func() _uint32 (msgpack_pack_user x, uint32_t d)
 
msgpack_pack_inline_func() _uint64 (msgpack_pack_user x, uint64_t d)
 
msgpack_pack_inline_func() _int8 (msgpack_pack_user x, int8_t d)
 
msgpack_pack_inline_func() _int16 (msgpack_pack_user x, int16_t d)
 
msgpack_pack_inline_func() _int32 (msgpack_pack_user x, int32_t d)
 
msgpack_pack_inline_func() _int64 (msgpack_pack_user x, int64_t d)
 
msgpack_pack_inline_func() _char (msgpack_pack_user x, char d)
 
msgpack_pack_inline_func() _signed_char (msgpack_pack_user x, signed char d)
 
msgpack_pack_inline_func() _unsigned_char (msgpack_pack_user x, unsigned char d)
 
msgpack_pack_inline_func() _float (msgpack_pack_user x, float d)
 
msgpack_pack_inline_func() _double (msgpack_pack_user x, double d)
 
msgpack_pack_inline_func() _nil (msgpack_pack_user x)
 
msgpack_pack_inline_func() _true (msgpack_pack_user x)
 
msgpack_pack_inline_func() _false (msgpack_pack_user x)
 
msgpack_pack_inline_func() _array (msgpack_pack_user x, size_t n)
 
msgpack_pack_inline_func() _map (msgpack_pack_user x, size_t n)
 
msgpack_pack_inline_func() _str (msgpack_pack_user x, size_t l)
 
msgpack_pack_inline_func() _str_body (msgpack_pack_user x, const void *b, size_t l)
 
msgpack_pack_inline_func() _v4raw (msgpack_pack_user x, size_t l)
 
msgpack_pack_inline_func() _v4raw_body (msgpack_pack_user x, const void *b, size_t l)
 
msgpack_pack_inline_func() _bin (msgpack_pack_user x, size_t l)
 
msgpack_pack_inline_func() _bin_body (msgpack_pack_user x, const void *b, size_t l)
 
msgpack_pack_inline_func() _ext (msgpack_pack_user x, size_t l, int8_t type)
 
msgpack_pack_inline_func() _ext_body (msgpack_pack_user x, const void *b, size_t l)
 

Macro Definition Documentation

◆ msgpack_pack_real_int16

#define msgpack_pack_real_int16 (   x,
 
)
Value:
do { \
if(d < -(1<<5)) { \
if(d < -(1<<7)) { \
/* signed 16 */ \
unsigned char buf[3]; \
buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \
msgpack_pack_append_buffer(x, buf, 3); \
} else { \
/* signed 8 */ \
unsigned char buf[2] = {0xd0, TAKE8_16(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} else if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &TAKE8_16(d), 1); \
} else { \
if(d < (1<<8)) { \
/* unsigned 8 */ \
unsigned char buf[2] = {0xcc, TAKE8_16(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} else { \
/* unsigned 16 */ \
unsigned char buf[3]; \
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
msgpack_pack_append_buffer(x, buf, 3); \
} \
} \
} while(0)
#define _msgpack_store16(to, num)
Definition: sysdep.h:163

Referenced by _int16(), and _unsigned_char().

◆ msgpack_pack_real_int32

#define msgpack_pack_real_int32 (   x,
 
)

Referenced by _int32(), and _unsigned_char().

◆ msgpack_pack_real_int64

#define msgpack_pack_real_int64 (   x,
 
)

Referenced by _int64(), and _unsigned_char().

◆ msgpack_pack_real_int8

#define msgpack_pack_real_int8 (   x,
 
)
Value:
do { \
if(d < -(1<<5)) { \
/* signed 8 */ \
unsigned char buf[2] = {0xd0, TAKE8_8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} else { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); \
} \
} while(0)

Referenced by _char(), _int8(), and _signed_char().

◆ msgpack_pack_real_uint16

#define msgpack_pack_real_uint16 (   x,
 
)
Value:
do { \
if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &TAKE8_16(d), 1); \
} else if(d < (1<<8)) { \
/* unsigned 8 */ \
unsigned char buf[2] = {0xcc, TAKE8_16(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} else { \
/* unsigned 16 */ \
unsigned char buf[3]; \
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
msgpack_pack_append_buffer(x, buf, 3); \
} \
} while(0)
#define _msgpack_store16(to, num)
Definition: sysdep.h:163

Referenced by _uint16(), and _unsigned_char().

◆ msgpack_pack_real_uint32

#define msgpack_pack_real_uint32 (   x,
 
)
Value:
do { \
if(d < (1<<8)) { \
if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &TAKE8_32(d), 1); \
} else { \
/* unsigned 8 */ \
unsigned char buf[2] = {0xcc, TAKE8_32(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} else { \
if(d < (1<<16)) { \
/* unsigned 16 */ \
unsigned char buf[3]; \
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
msgpack_pack_append_buffer(x, buf, 3); \
} else { \
/* unsigned 32 */ \
unsigned char buf[5]; \
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
msgpack_pack_append_buffer(x, buf, 5); \
} \
} \
} while(0)
#define _msgpack_store32(to, num)
Definition: sysdep.h:165
#define _msgpack_store16(to, num)
Definition: sysdep.h:163

Referenced by _uint32(), and _unsigned_char().

◆ msgpack_pack_real_uint64

#define msgpack_pack_real_uint64 (   x,
 
)
Value:
do { \
if(d < (1ULL<<8)) { \
if(d < (1ULL<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &TAKE8_64(d), 1); \
} else { \
/* unsigned 8 */ \
unsigned char buf[2] = {0xcc, TAKE8_64(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} else { \
if(d < (1ULL<<16)) { \
/* unsigned 16 */ \
unsigned char buf[3]; \
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
msgpack_pack_append_buffer(x, buf, 3); \
} else if(d < (1ULL<<32)) { \
/* unsigned 32 */ \
unsigned char buf[5]; \
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
msgpack_pack_append_buffer(x, buf, 5); \
} else { \
/* unsigned 64 */ \
unsigned char buf[9]; \
buf[0] = 0xcf; _msgpack_store64(&buf[1], d); \
msgpack_pack_append_buffer(x, buf, 9); \
} \
} \
} while(0)
#define _msgpack_store64(to, num)
Definition: sysdep.h:167
#define _msgpack_store32(to, num)
Definition: sysdep.h:165
#define _msgpack_store16(to, num)
Definition: sysdep.h:163

Referenced by _uint64(), and _unsigned_char().

◆ msgpack_pack_real_uint8

#define msgpack_pack_real_uint8 (   x,
 
)
Value:
do { \
if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); \
} else { \
/* unsigned 8 */ \
unsigned char buf[2] = {0xcc, TAKE8_8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} while(0)

Referenced by _char(), _uint8(), and _unsigned_char().

Function Documentation

◆ _array()

msgpack_pack_inline_func() _array ( msgpack_pack_user  x,
size_t  n 
)

◆ _bin()

msgpack_pack_inline_func() _bin ( msgpack_pack_user  x,
size_t  l 
)

◆ _bin_body()

msgpack_pack_inline_func() _bin_body ( msgpack_pack_user  x,
const void *  b,
size_t  l 
)

◆ _char()

msgpack_pack_inline_func() _char ( msgpack_pack_user  x,
char  d 
)

◆ _double()

msgpack_pack_inline_func() _double ( msgpack_pack_user  x,
double  d 
)

◆ _ext()

msgpack_pack_inline_func() _ext ( msgpack_pack_user  x,
size_t  l,
int8_t  type 
)

◆ _ext_body()

msgpack_pack_inline_func() _ext_body ( msgpack_pack_user  x,
const void *  b,
size_t  l 
)

◆ _false()

◆ _float()

msgpack_pack_inline_func() _float ( msgpack_pack_user  x,
float  d 
)

◆ _int16()

msgpack_pack_inline_func() _int16 ( msgpack_pack_user  x,
int16_t  d 
)

◆ _int32()

msgpack_pack_inline_func() _int32 ( msgpack_pack_user  x,
int32_t  d 
)

◆ _int64()

msgpack_pack_inline_func() _int64 ( msgpack_pack_user  x,
int64_t  d 
)

◆ _int8()

msgpack_pack_inline_func() _int8 ( msgpack_pack_user  x,
int8_t  d 
)

◆ _map()

msgpack_pack_inline_func() _map ( msgpack_pack_user  x,
size_t  n 
)

◆ _nil()

◆ _signed_char()

msgpack_pack_inline_func() _signed_char ( msgpack_pack_user  x,
signed char  d 
)

◆ _str()

msgpack_pack_inline_func() _str ( msgpack_pack_user  x,
size_t  l 
)

◆ _str_body()

msgpack_pack_inline_func() _str_body ( msgpack_pack_user  x,
const void *  b,
size_t  l 
)

◆ _true()

◆ _uint16()

msgpack_pack_inline_func() _uint16 ( msgpack_pack_user  x,
uint16_t  d 
)

◆ _uint32()

msgpack_pack_inline_func() _uint32 ( msgpack_pack_user  x,
uint32_t  d 
)

◆ _uint64()

msgpack_pack_inline_func() _uint64 ( msgpack_pack_user  x,
uint64_t  d 
)

◆ _uint8()

msgpack_pack_inline_func() _uint8 ( msgpack_pack_user  x,
uint8_t  d 
)

◆ _unsigned_char()

msgpack_pack_inline_func() _unsigned_char ( msgpack_pack_user  x,
unsigned char  d 
)

◆ _v4raw()

msgpack_pack_inline_func() _v4raw ( msgpack_pack_user  x,
size_t  l 
)

◆ _v4raw_body()

msgpack_pack_inline_func() _v4raw_body ( msgpack_pack_user  x,
const void *  b,
size_t  l 
)