ubjsc  0.6
Enterprise-grade C library for manipulating UBJSON
ubjs_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Tomasz Sieprawski
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all
12  * copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20  * SOFTWARE.
21  **/
28 #ifndef HAVE_UBJS_COMMON
29 #define HAVE_UBJS_COMMON
30 
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #endif
35 
36 #include <stdint.h>
37 #include <inttypes.h>
38 #include "ubjs_exports.h"
39 
40 
45 typedef float float32_t;
46 
51 typedef double float64_t;
52 
59 typedef enum ubjs_bool
60 {
63 } ubjs_bool;
64 
73 typedef enum ubjs_result
74 {
77 } ubjs_result;
78 
83 #define MARKER_OPTIMIZE_COUNT 35
84 
88 #define MARKER_OPTIMIZE_TYPE 36
89 
93 #define MARKER_CHAR 67
94 
98 #define MARKER_FLOAT64 68
99 
103 #define MARKER_FALSE 70
104 
108 #define MARKER_HPN 72
109 
113 #define MARKER_INT16 73
114 
118 #define MARKER_INT64 76
119 
123 #define MARKER_NOOP 78
124 
128 #define MARKER_STR 83
129 
133 #define MARKER_TRUE 84
134 
138 #define MARKER_UINT8 85
139 
143 #define MARKER_NULL 90
144 
148 #define MARKER_ARRAY_BEGIN 91
149 
153 #define MARKER_ARRAY_END 93
154 
158 #define MARKER_FLOAT32 100
159 
163 #define MARKER_INT8 105
164 
168 #define MARKER_INT32 108
169 
173 #define MARKER_OBJECT_BEGIN 123
174 
178 #define MARKER_OBJECT_END 125
179 
180 #ifdef __cplusplus
181 }
182 #endif
183 
184 #endif
ubjs_bool
Wrapper around regular C-like booleans.
Definition: ubjs_common.h:59
ubjs_result
Enum that defines the result of a method.
Definition: ubjs_common.h:73
Definition: ubjs_common.h:62
Definition: ubjs_common.h:76
Definition: ubjs_common.h:61
double float64_t
Typedef to have consistency in naming all int/float types.
Definition: ubjs_common.h:51
Definition: ubjs_common.h:75
float float32_t
Typedef to have consistency in naming all int/float types.
Definition: ubjs_common.h:45