APIs for packing data into a MessagePack message. More...

Functions

zos_result_t msgpack_write_int (msgpack_context_t *context, int32_t value)
 Pack a signed integer (8-32bits) More...
 
zos_result_t msgpack_write_uint (msgpack_context_t *context, uint32_t value)
 Pack an unsigned integer (8-32bits) More...
 
zos_result_t msgpack_write_long (msgpack_context_t *context, int64_t *value_ptr)
 Pack a signed long integer (8-64bits) More...
 
zos_result_t msgpack_write_ulong (msgpack_context_t *context, uint64_t *value_ptr)
 Pack an unsigned long integer (8-64bits) More...
 
zos_result_t msgpack_write_float (msgpack_context_t *context, float value)
 Pack a float. More...
 
zos_result_t msgpack_write_double (msgpack_context_t *context, double *value_ptr)
 Pack a double. More...
 
zos_result_t msgpack_write_nil (msgpack_context_t *context)
 Pack a NULL. More...
 
zos_result_t msgpack_write_bool (msgpack_context_t *context, zos_bool_t value)
 Pack a boolean value. More...
 
zos_result_t msgpack_write_str (msgpack_context_t *context, const char *str)
 Pack a string value. More...
 
zos_result_t msgpack_write_str_marker (msgpack_context_t *context, uint32_t size)
 Begin packing a string value. More...
 
zos_result_t msgpack_write_bin (msgpack_context_t *context, const void *data, uint32_t length)
 Pack a binary string value. More...
 
zos_result_t msgpack_write_bin_marker (msgpack_context_t *context, uint32_t size)
 Begin packing a binary string value. More...
 
zos_result_t msgpack_write_context (msgpack_context_t *context, const msgpack_context_t *value_context)
 Write a previously written msgpack_context_t. More...
 
zos_result_t msgpack_write_dict_marker (msgpack_context_t *context, uint32_t size)
 Begin packing a dictionary (aka map) More...
 
zos_result_t msgpack_write_array_marker (msgpack_context_t *context, uint32_t size)
 Begin packing an array (aka map) More...
 
zos_result_t msgpack_write_dict_nil (msgpack_context_t *context, const char *key)
 Pack a NULL to the current dictionary. More...
 
zos_result_t msgpack_write_dict_bool (msgpack_context_t *context, const char *key, zos_bool_t value)
 Pack a boolean to the current dictionary. More...
 
zos_result_t msgpack_write_dict_int (msgpack_context_t *context, const char *key, int32_t value)
 Pack a signed integer (8-32bits) to the current dictionary. More...
 
zos_result_t msgpack_write_dict_uint (msgpack_context_t *context, const char *key, uint32_t value)
 Pack an unsigned integer (8-32bits) to the current dictionary. More...
 
zos_result_t msgpack_write_dict_long (msgpack_context_t *context, const char *key, int64_t *value_ptr)
 Pack a signed integer (8-64bits) to the current dictionary. More...
 
zos_result_t msgpack_write_dict_ulong (msgpack_context_t *context, const char *key, uint64_t *value_ptr)
 Pack an unsigned integer (8-64bits) to the current dictionary. More...
 
zos_result_t msgpack_write_dict_float (msgpack_context_t *context, const char *key, float value)
 Pack a float into to the current dictionary. More...
 
zos_result_t msgpack_write_dict_double (msgpack_context_t *context, const char *key, double *value_ptr)
 Pack a double into to the current dictionary. More...
 
zos_result_t msgpack_write_dict_str (msgpack_context_t *context, const char *key, const char *value)
 Pack a string into to the current dictionary. More...
 
zos_result_t msgpack_write_dict_bin (msgpack_context_t *context, const char *key, const void *value, uint32_t length)
 Pack a binary string into to the current dictionary. More...
 
zos_result_t msgpack_write_dict_dict (msgpack_context_t *context, const char *key, uint32_t dict_count)
 Pack a dictionary marker into to the current dictionary. More...
 
zos_result_t msgpack_write_dict_array (msgpack_context_t *context, const char *key, uint32_t array_count)
 Pack a array marker into to the current dictionary. More...
 
zos_result_t msgpack_write_dict_context (msgpack_context_t *context, const char *key, const msgpack_context_t *value_context)
 Pack a previous written context into to the current dictionary. More...
 

Detailed Description

APIs for packing data into a MessagePack message.

Function Documentation

zos_result_t msgpack_write_array_marker ( msgpack_context_t context,
uint32_t  size 
)

Begin packing an array (aka map)

This writes the number of values that will go into the array to the given msgpack_context_t. The array values MUST be immediately written after calling this function.

The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
sizeNumber of array values that will immediately follow
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_bin ( msgpack_context_t context,
const void *  data,
uint32_t  length 
)

Pack a binary string value.

This packs a binary string value into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
dataBinary string value to write
lengthLength of binary string
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_bin_marker ( msgpack_context_t context,
uint32_t  size 
)

Begin packing a binary string value.

This writes the binary string size to the given msgpack_context_t. The binary string value MUST be immediately written after calling this function. This function is useful if the binary string needs to be written in chunks.

The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
sizeSize of the binary string value that will be immediately follow
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_bool ( msgpack_context_t context,
zos_bool_t  value 
)

Pack a boolean value.

This packs a boolean value into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
valueBoolean value to write
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_context ( msgpack_context_t context,
const msgpack_context_t value_context 
)

Write a previously written msgpack_context_t.

This writes the contents of a previously written msgpack_context_t to the supplied context. The previously written context MUST have been initialized with a buffer (not a writer)

The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
value_contextPreviously written context to write to this context
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_array ( msgpack_context_t context,
const char *  key,
uint32_t  array_count 
)

Pack a array marker into to the current dictionary.

This packs a new array marker with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
array_countNumber of entries that will go in new array within the current dictionary
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_bin ( msgpack_context_t context,
const char *  key,
const void *  value,
uint32_t  length 
)

Pack a binary string into to the current dictionary.

This packs a binary string value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
valuebinary string value
lengthLength of binary string
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_bool ( msgpack_context_t context,
const char *  key,
zos_bool_t  value 
)

Pack a boolean to the current dictionary.

This packs a boolean value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
valueBoolean value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_context ( msgpack_context_t context,
const char *  key,
const msgpack_context_t value_context 
)

Pack a previous written context into to the current dictionary.

This packs a previously written msgpack_context_t with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized. The previously written context MUST have been initialized with a buffer (not a writer)

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
value_contextPreviously written context to write to supplied context
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_dict ( msgpack_context_t context,
const char *  key,
uint32_t  dict_count 
)

Pack a dictionary marker into to the current dictionary.

This packs a new dictionary marker with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
dict_countNumber of key/value pairs that will go in new dictionary within the current dictionary
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_double ( msgpack_context_t context,
const char *  key,
double *  value_ptr 
)

Pack a double into to the current dictionary.

This packs a double value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
value_ptrPointer to double value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_float ( msgpack_context_t context,
const char *  key,
float  value 
)

Pack a float into to the current dictionary.

This packs a float value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
valuefloat value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_int ( msgpack_context_t context,
const char *  key,
int32_t  value 
)

Pack a signed integer (8-32bits) to the current dictionary.

This packs a signed integer value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
valuesigned integer value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_long ( msgpack_context_t context,
const char *  key,
int64_t *  value_ptr 
)

Pack a signed integer (8-64bits) to the current dictionary.

This packs a signed integer value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
value_ptrPointer to signed integer value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_marker ( msgpack_context_t context,
uint32_t  size 
)

Begin packing a dictionary (aka map)

This writes the number of key/values that will go into the dictionary to the given msgpack_context_t. The dictionary key/values MUST be immediately written after calling this function.

The msgpack_context_t should have been previously initialized.

Note
The msgpack_write_dict_xxx APIs may be used to write the dictionary key/values.
Parameters
contextPreviously initialize msgpack_context_t
sizeNumber of dictionary key/values that will immediately follow
Returns
Result of function, see zos_result_t
Examples:
cloud/s2cdemo/main.c.
zos_result_t msgpack_write_dict_nil ( msgpack_context_t context,
const char *  key 
)

Pack a NULL to the current dictionary.

This packs a NULL value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_str ( msgpack_context_t context,
const char *  key,
const char *  value 
)

Pack a string into to the current dictionary.

This packs a string value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
valuestring value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_dict_uint ( msgpack_context_t context,
const char *  key,
uint32_t  value 
)

Pack an unsigned integer (8-32bits) to the current dictionary.

This packs an unsigned integer value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
valueunsigned integer value
Returns
Result of function, see zos_result_t
Examples:
cloud/s2cdemo/main.c.
zos_result_t msgpack_write_dict_ulong ( msgpack_context_t context,
const char *  key,
uint64_t *  value_ptr 
)

Pack an unsigned integer (8-64bits) to the current dictionary.

This packs an unsigned integer value with the corresponding dictionary key into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

msgpack_write_dict_marker() MUST have been previously called to specify the dictionary.

Parameters
contextPreviously initialize msgpack_context_t
keyDictionary key of written value
value_ptrPointer to unsigned integer value
Returns
Result of function, see zos_result_t
Examples:
cloud/s2cdemo/main.c.
zos_result_t msgpack_write_double ( msgpack_context_t context,
double *  value_ptr 
)

Pack a double.

This packs the supplied double into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
value_ptrPointer to double value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_float ( msgpack_context_t context,
float  value 
)

Pack a float.

This packs the float into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
valuefloat value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_int ( msgpack_context_t context,
int32_t  value 
)

Pack a signed integer (8-32bits)

This packs the supplied integer into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
valuesigned integer value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_long ( msgpack_context_t context,
int64_t *  value_ptr 
)

Pack a signed long integer (8-64bits)

This packs the supplied integer into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
value_ptrPointer to signed integer value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_nil ( msgpack_context_t context)

Pack a NULL.

This packs a NULL value into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_str ( msgpack_context_t context,
const char *  str 
)

Pack a string value.

This packs a string value into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
strString value to write
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_str_marker ( msgpack_context_t context,
uint32_t  size 
)

Begin packing a string value.

This writes the string size to the given msgpack_context_t. The string value MUST be immediately written after calling this function. This function is useful if the string needs to be written in chunks.

The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
sizeSize of the string value that will be immediately follow
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_uint ( msgpack_context_t context,
uint32_t  value 
)

Pack an unsigned integer (8-32bits)

This packs the supplied integer into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
valueunsigned integer value
Returns
Result of function, see zos_result_t
zos_result_t msgpack_write_ulong ( msgpack_context_t context,
uint64_t *  value_ptr 
)

Pack an unsigned long integer (8-64bits)

This packs the supplied integer into the given msgpack_context_t. The msgpack_context_t should have been previously initialized.

Parameters
contextPreviously initialize msgpack_context_t
value_ptrPointer to unsigned integer value
Returns
Result of function, see zos_result_t