LispBM
lbm_types.h
Go to the documentation of this file.
1 
2 /*
3  Copyright 2019, 2022 Joel Svensson svenssonjoel@yahoo.se
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef LISPBM_TYPES_H_
20 #define LISPBM_TYPES_H_
21 
22 #include <stdint.h>
23 #include <stdbool.h>
24 #include <inttypes.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 /* Addresses that are put into lbm_values or into
31  * lbm_memory must have this alignment. */
32 #ifndef LBM64
33 #define LBM_STORABLE_ADDRESS_ALIGNMENT 4
34 #else
35 #define LBM_STORABLE_ADDRESS_ALIGNMENT 8
36 #endif
37 
38 #ifndef LBM64
43 typedef uint32_t lbm_value;
45 typedef uint32_t lbm_type;
46 
47 typedef uint32_t lbm_uint;
48 typedef int32_t lbm_int;
49 typedef float lbm_float;
50 
51 #define PRI_VALUE PRIu32
52 #define PRI_TYPE PRIu32
53 #define PRI_UINT PRIu32
54 #define PRI_INT PRId32
55 #define PRI_HEX PRIx32
56 #define PRI_FLOAT "f"
57 
58 typedef int32_t lbm_cid;
59 
60 #else
64 typedef uint64_t lbm_value;
66 typedef uint64_t lbm_type;
67 
68 typedef uint64_t lbm_uint;
69 typedef int64_t lbm_int;
70 typedef double lbm_float;
71 
72 #define PRI_VALUE PRIu64
73 #define PRI_TYPE PRIu64
74 #define PRI_UINT PRIu64
75 #define PRI_INT PRId64
76 #define PRI_HEX PRIx64
77 #define PRI_FLOAT "lf"
78 
82 typedef int64_t lbm_cid;
83 #endif
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 #endif
uint32_t lbm_type
Definition: lbm_types.h:45
uint32_t lbm_value
Definition: lbm_types.h:43