Wheefun I/O Library  0.0.5
Useful I/O Primitives.
misctype.h
Go to the documentation of this file.
1 /* WFIO - the Wheefun IO Library
2  Copyright (C) 2018 Phillip Kilgore
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <https://www.gnu.org/licenses/>.
16 
17  Additionally, you should have recieved a copy of the GNU Classpath
18  exception, which amends the license to generally permit linking against
19  the software provided herein.
20 */
21 
33 #ifndef WFIO_MISCTYPE_H
34 #define WFIO_MISCTYPE_H
35 
36 #include <wfio/host.h>
37 #include <stddef.h>
38 
40 
47 typedef struct wfio_undefined_t {
48  char dummy;
50 
51 /* Endian Manipulation */
52 
53 /* Todo: use WFCNFO */
54 #ifndef WFIO_ENDIAN_DEFINED
55 #include <wfio/bits/endian.h>
56 #endif
57 
61 typedef enum wfio_endian_t {
76 
92 
108 
124 
125  /* For specific platforms */
126 
134 
142 
150 
157 
165 
166  /* For this platform */
167 
174  #if defined(WFIO_ENDIAN_HOST_IS_BIG)
176  #elif defined(WFIO_ENDIAN_HOST_IS_LIL)
178  #elif defined(WFIO_ENDIAN_HOST_IS_LIL16)
180  #elif defined(WFIO_ENDIAN_HOST_IS_BIGLIL)
182  #else
183  WFIO_ENDIAN_HOST_REPORTED
184  #endif
185  ,
186 
193  #if defined(WFIO_ENDIAN_HOST_IS_BIG)
195  #elif defined(WFIO_ENDIAN_HOST_IS_LIL)
197  #elif defined(WFIO_ENDIAN_HOST_IS_LIL16)
199  #elif defined(WFIO_ENDIAN_HOST_IS_BIGLIL)
201  #else
202  WFIO_ENDIAN_HOST_REPORTED
203  #endif
204  ,
205 
213  #if defined(WFIO_ENDIAN_FLT_IS_BIG)
215  #elif defined(WFIO_ENDIAN_FLT_IS_LIL)
217  #elif defined(WFIO_ENDIAN_HOST_IS_LIL16)
219  #elif defined(WFIO_ENDIAN_HOST_IS_BIGLIL)
221  #else
222  WFIO_ENDIAN_FLT_REPORTED
223  #endif
224 } wfio_endian_t;
225 
227 
228 #ifdef __cplusplus
229 namespace wfio {
232 
235 
236 }
237 #endif
238 
239 #endif
The root namespace for WFIO.
Definition: bin.h:879
::wfio_undefined_t undefined_t
A structure indicating no definition.
Definition: misctype.h:231
An endian representing 16-bit words in little endian.
Definition: misctype.h:123
#define WFIO_C_BEGIN
Definition: host.h:477
An endian representing the byte order on the Java virtual machine.
Definition: misctype.h:164
The endian of floating point numbers.
Definition: misctype.h:212
An endian representing the least-significant byte first.
Definition: misctype.h:75
WFIO_C_BEGIN struct wfio_undefined_t wfio_undefined_t
A structure indicating no definition.
Host environment detection.
The reverse endianness of this system.
Definition: misctype.h:192
#define WFIO_C_END
Definition: host.h:485
An endian representing the byte order on TCP/IP networks.
Definition: misctype.h:156
An endian representing 16-bit words in little endian.
Definition: misctype.h:107
An endian representing the byte order on the Java virtual machine.
Definition: misctype.h:149
wfio_endian_t
A categorization of the byte-order of multibyte integers.
Definition: misctype.h:61
The endianness of this system.
Definition: misctype.h:173
An endian representing the byte order on an Intel x86 machine.
Definition: misctype.h:133
::wfio_endian_t endian_t
A categorization of the byte-order of multibyte integers.
Definition: misctype.h:234
An endian representing the least-significant byte first.
Definition: misctype.h:91
A structure indicating no definition.
Definition: misctype.h:47
An endian representing the byte order on a PowerPC machine.
Definition: misctype.h:141