MySQL  8.0.27
Source Code Documentation
my_byteorder.h File Reference

Functions for reading and storing in machine-independent format. More...

#include "my_config.h"
#include "my_compiler.h"
#include <string.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include "little_endian.h"
#include "my_inttypes.h"
#include "template_utils.h"

Go to the source code of this file.

Functions

static int32 sint3korr (const uchar *A)
 
static uint32 uint3korr (const uchar *A)
 
static ulonglong uint5korr (const uchar *A)
 
static ulonglong uint6korr (const uchar *A)
 
static void int3store (uchar *T, uint A)
 int3store More...
 
static void int5store (uchar *T, ulonglong A)
 
static void int6store (uchar *T, ulonglong A)
 
int16 sint2korr (const char *pT)
 
uint16 uint2korr (const char *pT)
 
uint32 uint3korr (const char *pT)
 
int32 sint3korr (const char *pT)
 
uint32 uint4korr (const char *pT)
 
int32 sint4korr (const char *pT)
 
ulonglong uint6korr (const char *pT)
 
ulonglong uint8korr (const char *pT)
 
longlong sint8korr (const char *pT)
 
void int2store (char *pT, uint16 A)
 
void int3store (char *pT, uint A)
 
void int4store (char *pT, uint32 A)
 
void int5store (char *pT, ulonglong A)
 
void int6store (char *pT, ulonglong A)
 
void int8store (char *pT, ulonglong A)
 
void float4store (char *V, float M)
 
double float8get (const char *M)
 
void float8store (char *V, double M)
 
float floatget (const uchar *ptr)
 
void floatstore (uchar *ptr, float val)
 
double doubleget (const uchar *ptr)
 
void doublestore (uchar *ptr, double val)
 
uint16 ushortget (const uchar *ptr)
 
int16 shortget (const uchar *ptr)
 
void shortstore (uchar *ptr, int16 val)
 
int32 longget (const uchar *ptr)
 
void longstore (uchar *ptr, int32 val)
 
uint32 ulongget (const uchar *ptr)
 
longlong longlongget (const uchar *ptr)
 
void longlongstore (uchar *ptr, longlong val)
 
uint16 load16be (const char *ptr)
 
uint32 load32be (const char *ptr)
 
ALWAYS_INLINE char * store16be (char *ptr, uint16 val)
 
char * store32be (char *ptr, uint32 val)
 
uint16 load16be (const uchar *ptr)
 
uint32 load32be (const uchar *ptr)
 
ALWAYS_INLINE ucharstore16be (uchar *ptr, uint16 val)
 
ucharstore32be (uchar *ptr, uint32 val)
 

Detailed Description

Functions for reading and storing in machine-independent format.

The little-endian variants are 'korr' (assume 'corrector') variants for integer types, but 'get' (assume 'getter') for floating point types.

Function Documentation

◆ doubleget()

double doubleget ( const uchar ptr)
inline

◆ doublestore()

void doublestore ( uchar ptr,
double  val 
)
inline

◆ float4store()

void float4store ( char *  V,
float  M 
)
inline

◆ float8get()

double float8get ( const char *  M)
inline

◆ float8store()

void float8store ( char *  V,
double  M 
)
inline

◆ floatget()

float floatget ( const uchar ptr)
inline

◆ floatstore()

void floatstore ( uchar ptr,
float  val 
)
inline

◆ int2store()

void int2store ( char *  pT,
uint16  A 
)
inline

◆ int3store() [1/2]

void int3store ( char *  pT,
uint  A 
)
inline

◆ int3store() [2/2]

static void int3store ( uchar T,
uint  A 
)
inlinestatic

int3store

Stores an unsinged integer in a platform independent way

Parameters
TThe destination buffer. Must be at least 3 bytes long
AThe integer to store.

Example: A int <3> with the value 1 is stored as:

01 00 00

◆ int4store()

void int4store ( char *  pT,
uint32  A 
)
inline

◆ int5store() [1/2]

void int5store ( char *  pT,
ulonglong  A 
)
inline

◆ int5store() [2/2]

static void int5store ( uchar T,
ulonglong  A 
)
inlinestatic

◆ int6store() [1/2]

void int6store ( char *  pT,
ulonglong  A 
)
inline

◆ int6store() [2/2]

static void int6store ( uchar T,
ulonglong  A 
)
inlinestatic

◆ int8store()

void int8store ( char *  pT,
ulonglong  A 
)
inline

◆ load16be() [1/2]

uint16 load16be ( const char *  ptr)
inline

◆ load16be() [2/2]

uint16 load16be ( const uchar ptr)
inline

◆ load32be() [1/2]

uint32 load32be ( const char *  ptr)
inline

◆ load32be() [2/2]

uint32 load32be ( const uchar ptr)
inline

◆ longget()

int32 longget ( const uchar ptr)
inline

◆ longlongget()

longlong longlongget ( const uchar ptr)
inline

◆ longlongstore()

void longlongstore ( uchar ptr,
longlong  val 
)
inline

◆ longstore()

void longstore ( uchar ptr,
int32  val 
)
inline

◆ shortget()

int16 shortget ( const uchar ptr)
inline

◆ shortstore()

void shortstore ( uchar ptr,
int16  val 
)
inline

◆ sint2korr()

int16 sint2korr ( const char *  pT)
inline

◆ sint3korr() [1/2]

int32 sint3korr ( const char *  pT)
inline

◆ sint3korr() [2/2]

static int32 sint3korr ( const uchar A)
inlinestatic

◆ sint4korr()

int32 sint4korr ( const char *  pT)
inline

◆ sint8korr()

longlong sint8korr ( const char *  pT)
inline

◆ store16be() [1/2]

ALWAYS_INLINE char* store16be ( char *  ptr,
uint16  val 
)

◆ store16be() [2/2]

ALWAYS_INLINE uchar* store16be ( uchar ptr,
uint16  val 
)

◆ store32be() [1/2]

char* store32be ( char *  ptr,
uint32  val 
)
inline

◆ store32be() [2/2]

uchar* store32be ( uchar ptr,
uint32  val 
)
inline

◆ uint2korr()

uint16 uint2korr ( const char *  pT)
inline

◆ uint3korr() [1/2]

uint32 uint3korr ( const char *  pT)
inline

◆ uint3korr() [2/2]

static uint32 uint3korr ( const uchar A)
inlinestatic

◆ uint4korr()

uint32 uint4korr ( const char *  pT)
inline

◆ uint5korr()

static ulonglong uint5korr ( const uchar A)
inlinestatic

◆ uint6korr() [1/2]

ulonglong uint6korr ( const char *  pT)
inline

◆ uint6korr() [2/2]

static ulonglong uint6korr ( const uchar A)
inlinestatic

◆ uint8korr()

ulonglong uint8korr ( const char *  pT)
inline

◆ ulongget()

uint32 ulongget ( const uchar ptr)
inline

◆ ushortget()

uint16 ushortget ( const uchar ptr)
inline