Wheefun I/O Library  0.0.5
Useful I/O Primitives.
bcd.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 t 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 
36 #ifndef WFIO_NUM_IEEE754_H
37 #define WFIO_NUM_IEEE754_H
38 
39 #include <wfio/type.h>
40 
42 
43 typedef enum wfio_bcd_format_t {
44  WFIO_BCD_UNSIGNED
45 } wfio_bcd_format_t;
46 
54 typedef union wfio_bcd8_t {
58  struct {
60  wfio_uint8_t lo:4;
61 
63  wfio_uint8_t hi:4;
64  } digits;
65 
70  wfio_uint8_t ui;
71 
76  wfio_sint8_t si;
77 } wfio_bcd8_t;
78 
80 
81 #endif
union wfio_bcd8_t wfio_bcd8_t
A type corresponding to a single byte BCD value.
wfio_uint8_t hi
Definition: bcd.h:63
#define WFIO_C_BEGIN
Definition: host.h:477
wfio_uint8_t lo
Definition: bcd.h:60
A type corresponding to a single byte BCD value.
Definition: bcd.h:54
#define WFIO_C_END
Definition: host.h:485
struct wfio_bcd8_t::@14 digits
The literal encoding of this wfio_bcd8_t.
wfio_uint8_t ui
The raw 16-bit unsigned integer representation of this number.
Definition: bcd.h:70
Shared type definitions.
wfio_sint8_t si
The raw 16-bit signed integer representation of this number.
Definition: bcd.h:76