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,
|  |  | d
| ) |  |

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)
_msgpack_store16
#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,
|  |  | d
| ) |  |

Referenced by _int32(), and _unsigned_char().

## msgpack_pack_real_int64

#define msgpack_pack_real_int64 | ( |  | x,
|  |  | d
| ) |  |

Referenced by _int64(), and _unsigned_char().

## msgpack_pack_real_int8

#define msgpack_pack_real_int8 | ( |  | x,
|  |  | d
| ) |  |

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,
|  |  | d
| ) |  |

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)
_msgpack_store16
#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,
|  |  | d
| ) |  |

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)
_msgpack_store32
#define _msgpack_store32(to, num)
Definition: sysdep.h:165
_msgpack_store16
#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,
|  |  | d
| ) |  |

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)
_msgpack_store64
#define _msgpack_store64(to, num)
Definition: sysdep.h:167
_msgpack_store32
#define _msgpack_store32(to, num)
Definition: sysdep.h:165
_msgpack_store16
#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,
|  |  | d
| ) |  |

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
| ) |  |

References _msgpack_store16, _msgpack_store32, msgpack_pack_append_buffer, and n.

## _bin()

msgpack_pack_inline_func() _bin | ( | msgpack_pack_user | x,
|  | size_t | l
| ) |  |

References _msgpack_store16, _msgpack_store32, and msgpack_pack_append_buffer.

## _bin_body()

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

References msgpack_pack_append_buffer.

## _char()

msgpack_pack_inline_func() _char | ( | msgpack_pack_user | x,
|  | char | d
| ) |  |

References msgpack_pack_real_int8, and msgpack_pack_real_uint8.

## _double()

msgpack_pack_inline_func() _double | ( | msgpack_pack_user | x,
|  | double | d
| ) |  |

References _msgpack_store64, and msgpack_pack_append_buffer.

## _ext()

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

References _msgpack_store16, _msgpack_store32, and msgpack_pack_append_buffer.

## _ext_body()

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

References msgpack_pack_append_buffer.

## _false()

msgpack_pack_inline_func() _false | ( | msgpack_pack_user | x | ) |

References msgpack_pack_append_buffer.

## _float()

msgpack_pack_inline_func() _float | ( | msgpack_pack_user | x,
|  | float | d
| ) |  |

References _msgpack_store32, and msgpack_pack_append_buffer.

## _int16()

msgpack_pack_inline_func() _int16 | ( | msgpack_pack_user | x,
|  | int16_t | d
| ) |  |

References msgpack_pack_real_int16.

## _int32()

msgpack_pack_inline_func() _int32 | ( | msgpack_pack_user | x,
|  | int32_t | d
| ) |  |

References msgpack_pack_real_int32.

## _int64()

msgpack_pack_inline_func() _int64 | ( | msgpack_pack_user | x,
|  | int64_t | d
| ) |  |

References msgpack_pack_real_int64.

## _int8()

msgpack_pack_inline_func() _int8 | ( | msgpack_pack_user | x,
|  | int8_t | d
| ) |  |

References msgpack_pack_real_int8.

## _map()

msgpack_pack_inline_func() _map | ( | msgpack_pack_user | x,
|  | size_t | n
| ) |  |

References _msgpack_store16, _msgpack_store32, msgpack_pack_append_buffer, and n.

## _nil()

msgpack_pack_inline_func() _nil | ( | msgpack_pack_user | x | ) |

References msgpack_pack_append_buffer.

## _signed_char()

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

References msgpack_pack_real_int8.

## _str()

msgpack_pack_inline_func() _str | ( | msgpack_pack_user | x,
|  | size_t | l
| ) |  |

References _msgpack_store16, _msgpack_store32, and msgpack_pack_append_buffer.

## _str_body()

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

References msgpack_pack_append_buffer.

## _true()

msgpack_pack_inline_func() _true | ( | msgpack_pack_user | x | ) |

References msgpack_pack_append_buffer.

## _uint16()

msgpack_pack_inline_func() _uint16 | ( | msgpack_pack_user | x,
|  | uint16_t | d
| ) |  |

References msgpack_pack_real_uint16.

## _uint32()

msgpack_pack_inline_func() _uint32 | ( | msgpack_pack_user | x,
|  | uint32_t | d
| ) |  |

References msgpack_pack_real_uint32.

## _uint64()

msgpack_pack_inline_func() _uint64 | ( | msgpack_pack_user | x,
|  | uint64_t | d
| ) |  |

References msgpack_pack_real_uint64.

## _uint8()

msgpack_pack_inline_func() _uint8 | ( | msgpack_pack_user | x,
|  | uint8_t | d
| ) |  |

References msgpack_pack_real_uint8.

## _unsigned_char()

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

References msgpack_pack_inline_func_cint, msgpack_pack_real_int16, msgpack_pack_real_int32, msgpack_pack_real_int64, msgpack_pack_real_uint16, msgpack_pack_real_uint32, msgpack_pack_real_uint64, msgpack_pack_real_uint8, and msgpack_pack_user.

## _v4raw()

msgpack_pack_inline_func() _v4raw | ( | msgpack_pack_user | x,
|  | size_t | l
| ) |  |

References _msgpack_store16, _msgpack_store32, and msgpack_pack_append_buffer.

## _v4raw_body()

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

References msgpack_pack_append_buffer.