MySQL 9.1.0
Source Code Documentation
byte_order_helpers.h File Reference

Experimental API header Conversions between different number representations. More...

#include <bitset>
#include <sstream>
#include <vector>
#include "my_byteorder.h"
#include <endian.h>

Go to the source code of this file.

Functions

uint64_t le64toh (uint64_t x)
 Converting a 64 bit integer from little-endian byte order to host byteorder. More...
 
uint64_t htole64 (uint64_t x)
 Converting a 64 bit integer from host's byte order to little-endian byte order. More...
 

Detailed Description

Experimental API header Conversions between different number representations.

MySQL writes binary data in LE, therefore this header defines the following conversions: host -> LE (for writing) LE -> host (for reading)

Function Documentation

◆ htole64()

uint64_t htole64 ( uint64_t  x)
inline

Converting a 64 bit integer from host's byte order to little-endian byte order.

Parameters
x64-bit integer in host's byte order
Returns
64-bit integer in little endian byte order

◆ le64toh()

uint64_t le64toh ( uint64_t  x)
inline

Converting a 64 bit integer from little-endian byte order to host byteorder.

Parameters
x64-bit integer in little endian byte order
Returns
64-bit integer in host byte order