Ordo  0.3.4
Symmetric Cryptography Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
endianness.h
Go to the documentation of this file.
1 /*===-- misc/endianness.h -------------------------------*- PUBLIC-*- H -*-===*/
9 /*===----------------------------------------------------------------------===*/
10 
11 #ifndef ORDO_ENDIANNESS_H
12 #define ORDO_ENDIANNESS_H
13 
15 #include "ordo/common/interface.h"
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 /*===----------------------------------------------------------------------===*/
23 
24 #define tole16 ordo_tole16
25 #define tobe16 ordo_tobe16
26 #define fmle16 ordo_fmle16
27 #define fmbe16 ordo_fmbe16
28 #define tole32 ordo_tole32
29 #define tobe32 ordo_tobe32
30 #define fmle32 ordo_fmle32
31 #define fmbe32 ordo_fmbe32
32 #define tole64 ordo_tole64
33 #define tobe64 ordo_tobe64
34 #define fmle64 ordo_fmle64
35 #define fmbe64 ordo_fmbe64
36 
37 /*===----------------------------------------------------------------------===*/
38 
39 /* tole16 == host --> little-endian (16 bits) */
40 /* fmbe32 == host <-- big-endian (32 bits) */
41 /* etc. */
42 
43 ORDO_PUBLIC uint16_t tole16(uint16_t x);
44 ORDO_PUBLIC uint16_t tobe16(uint16_t x);
45 ORDO_PUBLIC uint16_t fmle16(uint16_t x);
46 ORDO_PUBLIC uint16_t fmbe16(uint16_t x);
47 
48 ORDO_PUBLIC uint32_t tole32(uint32_t x);
49 ORDO_PUBLIC uint32_t tobe32(uint32_t x);
50 ORDO_PUBLIC uint32_t fmle32(uint32_t x);
51 ORDO_PUBLIC uint32_t fmbe32(uint32_t x);
52 
53 ORDO_PUBLIC uint64_t tole64(uint64_t x);
54 ORDO_PUBLIC uint64_t tobe64(uint64_t x);
55 ORDO_PUBLIC uint64_t fmle64(uint64_t x);
56 ORDO_PUBLIC uint64_t fmbe64(uint64_t x);
57 
58 /*===----------------------------------------------------------------------===*/
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif