Zero  0.1.0
Functions
w_endian.h File Reference
#include "shore-config.h"
#include <cstdint>

Go to the source code of this file.

Functions

void serialize16_be (void *dest, uint16_t value)
 
void serialize32_be (void *dest, uint32_t value)
 
void serialize64_be (void *dest, uint64_t value)
 
uint16_t deserialize16_ho (const void *buf)
 
uint32_t deserialize32_ho (const void *buf)
 
uint64_t deserialize64_ho (const void *buf)
 
void serialize_be (void *dest, uint16_t value)
 
void serialize_be (void *dest, uint32_t value)
 
void serialize_be (void *dest, uint64_t value)
 
void deserialize_ho (uint16_t &value)
 
void deserialize_ho (uint32_t &value)
 
void deserialize_ho (uint64_t &value)
 

Function Documentation

§ deserialize16_ho()

uint16_t deserialize16_ho ( const void *  buf)
inline

convert a big-endian byte array (which can be compared by memcmp) to a 16bit unsigned integer.

§ deserialize32_ho()

uint32_t deserialize32_ho ( const void *  buf)
inline

convert a big-endian byte array (which can be compared by memcmp) to a 32bit unsigned integer.

§ deserialize64_ho()

uint64_t deserialize64_ho ( const void *  buf)
inline

convert a big-endian byte array (which can be compared by memcmp) to a 64bit unsigned integer.

§ deserialize_ho() [1/3]

void deserialize_ho ( uint16_t &  value)
inline

§ deserialize_ho() [2/3]

void deserialize_ho ( uint32_t &  value)
inline

§ deserialize_ho() [3/3]

void deserialize_ho ( uint64_t &  value)
inline

§ serialize16_be()

void serialize16_be ( void *  dest,
uint16_t  value 
)
inline

A few helper functions about endianness. convert a 16bit unsigned integer to big-endian byte array (which can be compared by memcmp).

§ serialize32_be()

void serialize32_be ( void *  dest,
uint32_t  value 
)
inline

convert a 32bit unsigned integer to big-endian byte array (which can be compared by memcmp).

§ serialize64_be()

void serialize64_be ( void *  dest,
uint64_t  value 
)
inline

convert a 64bit unsigned integer to big-endian byte array (which can be compared by memcmp).

§ serialize_be() [1/3]

void serialize_be ( void *  dest,
uint16_t  value 
)
inline

§ serialize_be() [2/3]

void serialize_be ( void *  dest,
uint32_t  value 
)
inline

§ serialize_be() [3/3]

void serialize_be ( void *  dest,
uint64_t  value 
)
inline