MySQL 8.0.40
Source Code Documentation
byteorder.h File Reference

The file contains functions to convert the byte encoding of integer values to and from little-endian and big-endian byte order. More...

#include <stdint.h>
#include "binlog_config.h"
#include "my_compiler.h"
#include "my_config.h"
#include <endian.h>

Go to the source code of this file.

Macros

#define HAVE_MYSYS   1
 

Functions

uint16_t le16toh (uint16_t x)
 Converting a 16 bit integer from little-endian byte order to host byteorder. More...
 
uint32_t le32toh (uint32_t x)
 Converting a 32 bit integer from little-endian byte order to host byteorder. More...
 
uint32_t be32toh (uint32_t x)
 Converting a 32 bit integer from big-endian byte order to host byteorder. More...
 
uint64_t le64toh (uint64_t x)
 Converting a 64 bit integer from little-endian byte order to host byteorder. More...
 

Detailed Description

The file contains functions to convert the byte encoding of integer values to and from little-endian and big-endian byte order.

Macro Definition Documentation

◆ HAVE_MYSYS

#define HAVE_MYSYS   1

Function Documentation

◆ be32toh()

uint32_t be32toh ( uint32_t  x)
inline

Converting a 32 bit integer from big-endian byte order to host byteorder.

Parameters
x32-bit integer in big endian byte order
Returns
32-bit integer in host byte order

◆ le16toh()

uint16_t le16toh ( uint16_t  x)
inline

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

Parameters
x16-bit integer in little endian byte order
Returns
16-bit integer in host byte order

◆ le32toh()

uint32_t le32toh ( uint32_t  x)
inline

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

Parameters
x32-bit integer in little endian byte order
Returns
32-bit integer in host 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