Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
as_msgpack.h File Reference
#include <aerospike/as_serializer.h>
#include <aerospike/as_std.h>
+ Include dependency graph for as_msgpack.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_msgpack_ext
 
struct  as_packer
 
struct  as_packer_buffer
 
struct  as_unpacker
 

Macros

#define AS_PACKED_LIST_FLAG_NONE   0x00
 
#define AS_PACKED_LIST_FLAG_ORDERED   0x01
 
#define AS_PACKED_MAP_FLAG_K_ORDERED   0x01
 
#define AS_PACKED_MAP_FLAG_KV_ORDERED   (AS_PACKED_MAP_FLAG_K_ORDERED | AS_PACKED_MAP_FLAG_V_ORDERED)
 
#define AS_PACKED_MAP_FLAG_NONE   0x00
 
#define AS_PACKED_MAP_FLAG_PRESERVE_ORDER   0x08
 
#define AS_PACKED_MAP_FLAG_V_ORDERED   0x02
 
#define AS_PACKED_PERSIST_INDEX   0x10
 
#define AS_PACKER_BUFFER_SIZE   8192
 

Enumerations

enum  msgpack_compare_t {
  MSGPACK_COMPARE_ERROR = -2 , MSGPACK_COMPARE_END = -1 , MSGPACK_COMPARE_LESS = 0 , MSGPACK_COMPARE_EQUAL = 1 ,
  MSGPACK_COMPARE_GREATER = 2
}
 

Functions

AS_EXTERN as_serializeras_msgpack_init (as_serializer *)
 
AS_EXTERN as_serializeras_msgpack_new (void)
 
AS_EXTERN int as_pack_append (as_packer *pk, const unsigned char *buf, uint32_t sz)
 
int as_pack_bin (as_packer *pk, const uint8_t *buf, uint32_t sz)
 
uint32_t as_pack_bin_size (uint32_t buf_sz)
 
int as_pack_bool (as_packer *pk, bool val)
 
static uint32_t as_pack_bool_size (void)
 
int as_pack_buf_ext_header (uint8_t *buf, uint32_t size, uint32_t content_size, uint8_t type)
 
int as_pack_bytes (as_packer *pk, const uint8_t *buf, uint32_t sz)
 
int as_pack_cmp_inf (as_packer *pk)
 
static uint32_t as_pack_cmp_inf_size (void)
 
int as_pack_cmp_wildcard (as_packer *pk)
 
static uint32_t as_pack_cmp_wildcard_size (void)
 
int as_pack_double (as_packer *pk, double val)
 
static uint32_t as_pack_double_size (void)
 
AS_EXTERN int as_pack_ext_header (as_packer *pk, uint32_t content_size, uint8_t type)
 
uint32_t as_pack_ext_header_get_size (uint32_t content_size)
 
int as_pack_float (as_packer *pk, float val)
 
static uint32_t as_pack_float_size (void)
 
AS_EXTERN int as_pack_int64 (as_packer *pk, int64_t val)
 
uint32_t as_pack_int64_size (int64_t val)
 
AS_EXTERN int as_pack_list_header (as_packer *pk, uint32_t ele_count)
 
uint32_t as_pack_list_header_get_size (uint32_t ele_count)
 
AS_EXTERN int as_pack_map_header (as_packer *pk, uint32_t ele_count)
 
static uint32_t as_pack_map_header_get_size (uint32_t ele_count)
 
AS_EXTERN int as_pack_nil (as_packer *pk)
 
static uint32_t as_pack_nil_size (void)
 
int as_pack_str (as_packer *pk, const uint8_t *buf, uint32_t sz)
 
uint32_t as_pack_str_size (uint32_t str_sz)
 
AS_EXTERN int as_pack_uint64 (as_packer *pk, uint64_t val)
 
uint32_t as_pack_uint64_size (uint64_t val)
 
int as_pack_val (as_packer *pk, const as_val *val)
 
const uint8_t * as_unpack_bin (as_unpacker *pk, uint32_t *sz_r)
 
int64_t as_unpack_blob_size (as_unpacker *pk)
 
int as_unpack_boolean (as_unpacker *pk, bool *value)
 
msgpack_compare_t as_unpack_buf_compare (const uint8_t *buf1, uint32_t size1, const uint8_t *buf2, uint32_t size2)
 
static bool as_unpack_buf_is_less (const uint8_t *buf1, uint32_t size1, const uint8_t *buf2, uint32_t size2)
 
int64_t as_unpack_buf_list_element_count (const uint8_t *buf, uint32_t size)
 
int64_t as_unpack_buf_map_element_count (const uint8_t *buf, uint32_t size)
 
as_val_t as_unpack_buf_peek_type (const uint8_t *buf, uint32_t size)
 
msgpack_compare_t as_unpack_compare (as_unpacker *pk1, as_unpacker *pk2)
 
int as_unpack_double (as_unpacker *pk, double *x)
 
int as_unpack_ext (as_unpacker *pk, as_msgpack_ext *ext)
 
int as_unpack_int64 (as_unpacker *pk, int64_t *i)
 
int64_t as_unpack_list_header_element_count (as_unpacker *pk)
 
int64_t as_unpack_map_header_element_count (as_unpacker *pk)
 
int as_unpack_nil (as_unpacker *pk)
 
bool as_unpack_peek_is_ext (const as_unpacker *pk)
 
as_val_t as_unpack_peek_type (const as_unpacker *pk)
 
int64_t as_unpack_size (as_unpacker *pk)
 
const uint8_t * as_unpack_str (as_unpacker *pk, uint32_t *sz_r)
 
int as_unpack_uint64 (as_unpacker *pk, uint64_t *i)
 
int as_unpack_val (as_unpacker *pk, as_val **val)
 
AS_EXTERN msgpack_compare_t as_val_cmp (const as_val *v1, const as_val *v2)
 

Macro Definition Documentation

◆ AS_PACKED_LIST_FLAG_NONE

#define AS_PACKED_LIST_FLAG_NONE   0x00

Definition at line 38 of file as_msgpack.h.

◆ AS_PACKED_LIST_FLAG_ORDERED

#define AS_PACKED_LIST_FLAG_ORDERED   0x01

Definition at line 39 of file as_msgpack.h.

◆ AS_PACKED_MAP_FLAG_K_ORDERED

#define AS_PACKED_MAP_FLAG_K_ORDERED   0x01

Definition at line 33 of file as_msgpack.h.

◆ AS_PACKED_MAP_FLAG_KV_ORDERED

#define AS_PACKED_MAP_FLAG_KV_ORDERED   (AS_PACKED_MAP_FLAG_K_ORDERED | AS_PACKED_MAP_FLAG_V_ORDERED)

Definition at line 36 of file as_msgpack.h.

◆ AS_PACKED_MAP_FLAG_NONE

#define AS_PACKED_MAP_FLAG_NONE   0x00

Definition at line 32 of file as_msgpack.h.

◆ AS_PACKED_MAP_FLAG_PRESERVE_ORDER

#define AS_PACKED_MAP_FLAG_PRESERVE_ORDER   0x08

Definition at line 35 of file as_msgpack.h.

◆ AS_PACKED_MAP_FLAG_V_ORDERED

#define AS_PACKED_MAP_FLAG_V_ORDERED   0x02

Definition at line 34 of file as_msgpack.h.

◆ AS_PACKED_PERSIST_INDEX

#define AS_PACKED_PERSIST_INDEX   0x10

Definition at line 41 of file as_msgpack.h.

◆ AS_PACKER_BUFFER_SIZE

#define AS_PACKER_BUFFER_SIZE   8192

Definition at line 30 of file as_msgpack.h.

Enumeration Type Documentation

◆ msgpack_compare_t

Enumerator
MSGPACK_COMPARE_ERROR 
MSGPACK_COMPARE_END 
MSGPACK_COMPARE_LESS 
MSGPACK_COMPARE_EQUAL 
MSGPACK_COMPARE_GREATER 

Definition at line 74 of file as_msgpack.h.

Function Documentation

◆ as_msgpack_init()

AS_EXTERN as_serializer * as_msgpack_init ( as_serializer * )

◆ as_msgpack_new()

AS_EXTERN as_serializer * as_msgpack_new ( void )

◆ as_pack_append()

AS_EXTERN int as_pack_append ( as_packer * pk,
const unsigned char * buf,
uint32_t sz )

◆ as_pack_bin()

int as_pack_bin ( as_packer * pk,
const uint8_t * buf,
uint32_t sz )

◆ as_pack_bin_size()

uint32_t as_pack_bin_size ( uint32_t buf_sz)

◆ as_pack_bool()

int as_pack_bool ( as_packer * pk,
bool val )

◆ as_pack_bool_size()

static uint32_t as_pack_bool_size ( void )
inlinestatic

Definition at line 108 of file as_msgpack.h.

◆ as_pack_buf_ext_header()

int as_pack_buf_ext_header ( uint8_t * buf,
uint32_t size,
uint32_t content_size,
uint8_t type )

◆ as_pack_bytes()

int as_pack_bytes ( as_packer * pk,
const uint8_t * buf,
uint32_t sz )

◆ as_pack_cmp_inf()

int as_pack_cmp_inf ( as_packer * pk)

◆ as_pack_cmp_inf_size()

static uint32_t as_pack_cmp_inf_size ( void )
inlinestatic

Definition at line 115 of file as_msgpack.h.

◆ as_pack_cmp_wildcard()

int as_pack_cmp_wildcard ( as_packer * pk)

◆ as_pack_cmp_wildcard_size()

static uint32_t as_pack_cmp_wildcard_size ( void )
inlinestatic

Definition at line 119 of file as_msgpack.h.

◆ as_pack_double()

int as_pack_double ( as_packer * pk,
double val )

◆ as_pack_double_size()

static uint32_t as_pack_double_size ( void )
inlinestatic

Definition at line 135 of file as_msgpack.h.

◆ as_pack_ext_header()

AS_EXTERN int as_pack_ext_header ( as_packer * pk,
uint32_t content_size,
uint8_t type )

Pack an ext type.

Returns
0 on success

◆ as_pack_ext_header_get_size()

uint32_t as_pack_ext_header_get_size ( uint32_t content_size)

Get size of an ext header.

Parameters
content_sizesize in bytes of ext contents
Returns
size of header in bytes

◆ as_pack_float()

int as_pack_float ( as_packer * pk,
float val )

Pack a float.

Returns
0 on success

◆ as_pack_float_size()

static uint32_t as_pack_float_size ( void )
inlinestatic

Definition at line 131 of file as_msgpack.h.

◆ as_pack_int64()

AS_EXTERN int as_pack_int64 ( as_packer * pk,
int64_t val )

◆ as_pack_int64_size()

uint32_t as_pack_int64_size ( int64_t val)

◆ as_pack_list_header()

AS_EXTERN int as_pack_list_header ( as_packer * pk,
uint32_t ele_count )

Pack a list header with ele_count.

Returns
0 on success

◆ as_pack_list_header_get_size()

uint32_t as_pack_list_header_get_size ( uint32_t ele_count)

Get packed header size for list with ele_count.

Returns
header size in bytes

◆ as_pack_map_header()

AS_EXTERN int as_pack_map_header ( as_packer * pk,
uint32_t ele_count )

Pack a map header with ele_count.

Returns
0 on success

◆ as_pack_map_header_get_size()

static uint32_t as_pack_map_header_get_size ( uint32_t ele_count)
inlinestatic

Get packed header size for map with ele_count.

Returns
header size in bytes

Definition at line 175 of file as_msgpack.h.

References as_pack_list_header_get_size().

◆ as_pack_nil()

AS_EXTERN int as_pack_nil ( as_packer * pk)

◆ as_pack_nil_size()

static uint32_t as_pack_nil_size ( void )
inlinestatic

Definition at line 104 of file as_msgpack.h.

◆ as_pack_str()

int as_pack_str ( as_packer * pk,
const uint8_t * buf,
uint32_t sz )

Pack a str.

Returns
0 on success

◆ as_pack_str_size()

uint32_t as_pack_str_size ( uint32_t str_sz)

◆ as_pack_uint64()

AS_EXTERN int as_pack_uint64 ( as_packer * pk,
uint64_t val )

◆ as_pack_uint64_size()

uint32_t as_pack_uint64_size ( uint64_t val)

◆ as_pack_val()

int as_pack_val ( as_packer * pk,
const as_val * val )
Returns
0 on success

◆ as_unpack_bin()

const uint8_t * as_unpack_bin ( as_unpacker * pk,
uint32_t * sz_r )

Unpack bin (or str).

Returns
NULL on failure

◆ as_unpack_blob_size()

int64_t as_unpack_blob_size ( as_unpacker * pk)

Get size of packed blob.

Returns
negative int on error, size on success

◆ as_unpack_boolean()

int as_unpack_boolean ( as_unpacker * pk,
bool * value )

Unpack boolean.

Returns
0 on success

◆ as_unpack_buf_compare()

msgpack_compare_t as_unpack_buf_compare ( const uint8_t * buf1,
uint32_t size1,
const uint8_t * buf2,
uint32_t size2 )

Compare two msgpack buffers.

◆ as_unpack_buf_is_less()

static bool as_unpack_buf_is_less ( const uint8_t * buf1,
uint32_t size1,
const uint8_t * buf2,
uint32_t size2 )
inlinestatic

Compare two msgpack buffers.

Returns
true if buf1 < buf2

Definition at line 283 of file as_msgpack.h.

References as_unpack_buf_compare(), and MSGPACK_COMPARE_LESS.

◆ as_unpack_buf_list_element_count()

int64_t as_unpack_buf_list_element_count ( const uint8_t * buf,
uint32_t size )

Unpack list element count from buffer.

◆ as_unpack_buf_map_element_count()

int64_t as_unpack_buf_map_element_count ( const uint8_t * buf,
uint32_t size )

Unpack map element count from buffer.

◆ as_unpack_buf_peek_type()

as_val_t as_unpack_buf_peek_type ( const uint8_t * buf,
uint32_t size )

◆ as_unpack_compare()

msgpack_compare_t as_unpack_compare ( as_unpacker * pk1,
as_unpacker * pk2 )

◆ as_unpack_double()

int as_unpack_double ( as_unpacker * pk,
double * x )

Unpack double.

Returns
0 on success

◆ as_unpack_ext()

int as_unpack_ext ( as_unpacker * pk,
as_msgpack_ext * ext )

Unpack extension type.

Returns
true on success

◆ as_unpack_int64()

int as_unpack_int64 ( as_unpacker * pk,
int64_t * i )

Unpack integer.

Returns
0 on success

◆ as_unpack_list_header_element_count()

int64_t as_unpack_list_header_element_count ( as_unpacker * pk)

Get element count of packed list.

Returns
negative int on failure, element count on success

◆ as_unpack_map_header_element_count()

int64_t as_unpack_map_header_element_count ( as_unpacker * pk)

Get element count of packed map.

Returns
negative int on failure, element count on success

◆ as_unpack_nil()

int as_unpack_nil ( as_unpacker * pk)

Unpack nil.

Returns
0 on success

◆ as_unpack_peek_is_ext()

bool as_unpack_peek_is_ext ( const as_unpacker * pk)

Check next element without consuming any bytes.

Returns
true if ext type

◆ as_unpack_peek_type()

as_val_t as_unpack_peek_type ( const as_unpacker * pk)

Check next element without consuming any bytes.

Returns
type of next element

◆ as_unpack_size()

int64_t as_unpack_size ( as_unpacker * pk)

Get size of packed value.

Returns
negative int on error, size on success

◆ as_unpack_str()

const uint8_t * as_unpack_str ( as_unpacker * pk,
uint32_t * sz_r )

Unpack str (or bin).

Returns
NULL on failure

◆ as_unpack_uint64()

int as_unpack_uint64 ( as_unpacker * pk,
uint64_t * i )

◆ as_unpack_val()

int as_unpack_val ( as_unpacker * pk,
as_val ** val )
Returns
0 on success

◆ as_val_cmp()

AS_EXTERN msgpack_compare_t as_val_cmp ( const as_val * v1,
const as_val * v2 )