1#ifndef MY_BYTEORDER_INCLUDED
2#define MY_BYTEORDER_INCLUDED
40#ifdef HAVE_ARPA_INET_H
48#if defined(_WIN32) && defined(WIN32_LEAN_AND_MEAN)
65 return ((
int32)(((A[2]) & 128)
105 *(T + 1) = (
uchar)(A >> 8);
106 *(T + 2) = (
uchar)(A >> 16);
111 *(T + 1) = (
uchar)(A >> 8);
112 *(T + 2) = (
uchar)(A >> 16);
113 *(T + 3) = (
uchar)(A >> 24);
114 *(T + 4) = (
uchar)(A >> 32);
119 *(T + 1) = (
uchar)(A >> 8);
120 *(T + 2) = (
uchar)(A >> 16);
121 *(T + 3) = (
uchar)(A >> 24);
122 *(T + 4) = (
uchar)(A >> 32);
123 *(T + 5) = (
uchar)(A >> 40);
129 return sint2korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
133 return uint2korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
137 return uint3korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
141 return sint3korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
145 return uint4korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
149 return sint4korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
153 return uint6korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
157 return uint8korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
161 return sint8korr(
static_cast<const uchar *
>(
static_cast<const void *
>(pT)));
199 return float8get(
static_cast<const uchar *
>(
static_cast<const void *
>(
M)));
212 memcpy(&val, ptr,
sizeof(val));
217 memcpy(ptr, &val,
sizeof(val));
222 memcpy(&val, ptr,
sizeof(val));
227 memcpy(ptr, &val,
sizeof(val));
232 memcpy(&val, ptr,
sizeof(val));
238 memcpy(&val, ptr,
sizeof(val));
243 memcpy(ptr, &val,
sizeof(val));
248 memcpy(&val, ptr,
sizeof(val));
256 memcpy(&val, ptr,
sizeof(val));
262 memcpy(&val, ptr,
sizeof(val));
267 memcpy(ptr, &val,
sizeof(val));
279 memcpy(&val, ptr,
sizeof(val));
285 memcpy(&val, ptr,
sizeof(val));
292 val = _byteswap_ushort(val);
296 memcpy(ptr, &val,
sizeof(val));
297 return ptr +
sizeof(val);
302 memcpy(ptr, &val,
sizeof(val));
303 return ptr +
sizeof(val);
309 return load16be(pointer_cast<const char *>(ptr));
313 return load32be(pointer_cast<const char *>(ptr));
317 return pointer_cast<uchar *>(
store16be(pointer_cast<char *>(ptr), val));
321 return pointer_cast<uchar *>(
store32be(pointer_cast<char *>(ptr), val));
Endianness-independent definitions (little_endian.h contains optimized versions if you know you are o...
#define M
Definition: ctype-tis620.cc:73
Data in little-endian format.
static int32 sint3korr(const uchar *A)
Definition: my_byteorder.h:64
ALWAYS_INLINE char * store16be(char *ptr, uint16 val)
Definition: my_byteorder.h:289
void float8store(char *V, double M)
Definition: my_byteorder.h:202
double float8get(const char *M)
Definition: my_byteorder.h:198
double doubleget(const uchar *ptr)
Definition: my_byteorder.h:220
void longlongstore(uchar *ptr, longlong val)
Definition: my_byteorder.h:266
void float4store(char *V, float M)
Definition: my_byteorder.h:194
float floatget(const uchar *ptr)
Definition: my_byteorder.h:210
int32 longget(const uchar *ptr)
Definition: my_byteorder.h:246
longlong longlongget(const uchar *ptr)
Definition: my_byteorder.h:260
void shortstore(uchar *ptr, int16 val)
Definition: my_byteorder.h:242
static void int6store(uchar *T, ulonglong A)
Definition: my_byteorder.h:117
void int4store(char *pT, uint32 A)
Definition: my_byteorder.h:172
int16 sint2korr(const char *pT)
Definition: my_byteorder.h:128
uint16 load16be(const char *ptr)
Definition: my_byteorder.h:277
int16 shortget(const uchar *ptr)
Definition: my_byteorder.h:236
ulonglong uint8korr(const char *pT)
Definition: my_byteorder.h:156
static ulonglong uint6korr(const uchar *A)
Definition: my_byteorder.h:83
static void int5store(uchar *T, ulonglong A)
Definition: my_byteorder.h:109
static void int3store(uchar *T, uint A)
int3store
Definition: my_byteorder.h:103
void int8store(char *pT, ulonglong A)
Definition: my_byteorder.h:184
char * store32be(char *ptr, uint32 val)
Definition: my_byteorder.h:300
static uint32 uint3korr(const uchar *A)
Definition: my_byteorder.h:72
uint32 uint4korr(const char *pT)
Definition: my_byteorder.h:144
int32 sint4korr(const char *pT)
Definition: my_byteorder.h:148
uint16 uint2korr(const char *pT)
Definition: my_byteorder.h:132
void longstore(uchar *ptr, int32 val)
Definition: my_byteorder.h:252
longlong sint8korr(const char *pT)
Definition: my_byteorder.h:160
uint16 ushortget(const uchar *ptr)
Definition: my_byteorder.h:230
static ulonglong uint5korr(const uchar *A)
Definition: my_byteorder.h:77
void floatstore(uchar *ptr, float val)
Definition: my_byteorder.h:216
uint32 ulongget(const uchar *ptr)
Definition: my_byteorder.h:254
uint32 load32be(const char *ptr)
Definition: my_byteorder.h:283
void int2store(char *pT, uint16 A)
Definition: my_byteorder.h:164
void doublestore(uchar *ptr, double val)
Definition: my_byteorder.h:226
Header for compiler-dependent features.
#define ALWAYS_INLINE
Definition: my_compiler.h:109
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
unsigned char uchar
Definition: my_inttypes.h:51
long long int longlong
Definition: my_inttypes.h:54
int16_t int16
Definition: my_inttypes.h:63
int32_t int32
Definition: my_inttypes.h:65
uint16_t uint16
Definition: my_inttypes.h:64
uint32_t uint32
Definition: my_inttypes.h:66
unsigned int uint
Definition: uca9-dump.cc:74