Serialization helper.
More...
VTM_API int vtm_pack_float |
( |
float |
in, |
|
|
uint32_t * |
out |
|
) |
| |
Serializes a float value so that it can be stored in 4 bytes.
- Parameters
-
| in | the float that should be packed |
[out] | out | holds the serialized data |
- Returns
- VTM_OK if the packing was successful
-
VTM_E_INVALID_ARG if input is NaN
VTM_API int vtm_pack_double |
( |
double |
in, |
|
|
uint64_t * |
out |
|
) |
| |
Serializes a double value so that it can be stored in 8 bytes.
- Parameters
-
| in | the double that should be packed |
[out] | out | holds the serialized data |
- Returns
- VTM_OK if the packing was successful
-
VTM_E_INVALID_ARG if input is NaN
VTM_API int vtm_unpack_float |
( |
uint32_t |
in, |
|
|
float * |
out |
|
) |
| |
Deserializes a 4 byte packed float value.
- Parameters
-
| in | the packed data |
[out] | out | the unpacked float value |
- Returns
- VTM_OK if the unpacking was successful
-
VTM_ERROR if an error occured
VTM_API int vtm_unpack_double |
( |
uint64_t |
in, |
|
|
double * |
out |
|
) |
| |
Deserializes a 8 byte packed double value.
- Parameters
-
| in | the packed data |
[out] | out | the unpacked double value |
- Returns
- VTM_OK if the unpacking was successful
-
VTM_ERROR if an error occured