Products Support Documentation Download
psptypes.h
Go to the documentation of this file.
1 /*
2  * Raima Database Manager
3  *
4  * Copyright (C) 2016 Raims Inc., All rights reserved.
5  *
6  * Use of this software, whether in source code format, or in executable,
7  * binary object code form, is governed by the Raima LICENSE which
8  * is fully described in the LICENSE.TXT file, included within this
9  * distribution of files.
10  */
11 
15 #if !defined(PSPTYPES_H_INCLUDED_)
16 #define PSPTYPES_H_INCLUDED_
17 
18 #include "pspplat.h"
19 
20 #if defined(_lint)
21  #include "psptypes-lint.h"
22 #endif
23 
24 #if defined(RDM_DOXYGEN)
25  #include "psptypes-doxygen.h"
26 #else
27  #if defined(RDM_WINDOWS)
28  #include "psptypes-win.h"
29  #elif defined (RDM_VXWORKS)
30  #include "psptypes-vxworks.h"
31  #elif defined (RDM_INTEGRITY)
32  #include "psptypes-integrity.h"
33  #elif defined(RDM_UNIX)
34  #include "psptypes-unix.h"
35  #elif defined(RDM_NO_OS)
36  #include "psptypes-noos.h"
37  #endif
38 
39  #include <stddef.h>
40  #include <stdio.h>
41  #include <stdlib.h>
42  #include <stdarg.h>
43  #include <string.h>
44  #include <limits.h>
45  #include <ctype.h>
46  #include <setjmp.h>
47 #endif
48 
49 #ifndef RDM_UNREF
50 #define RDM_UNREF(a) ((void) a)
51 #endif
52 
53 #ifndef RDM_UNSET
54 #define RDM_UNSET(a) = a
55 #endif
56 
62 typedef enum
63 {
64  RDM_FALSE = 0,
65  RDM_TRUE = 1
66 } RDM_BOOL_T;
67 
70 typedef enum
71 {
72  RDM_LT = -1,
73  RDM_EQ = 0,
74  RDM_GT = 1
75 } RDM_COMPARE;
76 
77 typedef struct RDM_ENCRYPT_S *RDM_ENCRYPT;
86 typedef enum
87 {
94 } RDM_ENC_TYPE;
95 
96 #define EXTERNAL_FCN_PTR EXTERNAL_FCN *
97 
98 #if !defined(RDM_STARTUP_HOOK)
99 
103  #define RDM_STARTUP_HOOK
104 #endif
105 #if !defined(RDM_SHUTDOWN_HOOK)
106 
110  #define RDM_SHUTDOWN_HOOK
111 #endif
112 
113 #if defined(RDM_DOXYGEN)
114 
119 #define RDM_CHAR_T RDM_CHAR_T
120 #else
121 #define RDM_CHAR_T char
122 #endif
123 
124 #if defined(_UNICODE) && !defined(RDM_NO_UNICODE)
125 #define RDM_T(text) L##text
126 #define RDM_TCHAR_T wchar_t
127 #define RDM_TSTR_FMT "%ls"
128 #else
129 
130 #define RDM_T(text) text
131 #if defined(RDM_DOXYGEN)
132 
134 #define RDM_TCHAR_T RDM_TCHAR_T
135 #else
136 #define RDM_TCHAR_T char
137 #endif
138 #define RDM_TSTR_FMT "%s"
139 #endif
140 
141 #if defined(RDM_NO_UNICODE)
142 #define RDM_T_FUNC(func) func
143 #else
144 #if defined(_UNICODE)
145 #define RDM_T_FUNC(func) func ## W
146 #else
147 #define RDM_T_FUNC(func) func ## A
148 #endif
149 #endif
150 
151 #if !defined(RDM_STARTUP_EXAMPLE)
152 
159  #define RDM_STARTUP_EXAMPLE(name) \
160  int32_t name##_main(int32_t argc, const RDM_TCHAR_T *const *argv); \
161  int main(int argc, const RDM_TCHAR_T *const *argv) { \
162  int32_t status; \
163  \
164  RDM_STARTUP_HOOK \
165  status = name##_main(argc, argv); \
166  RDM_SHUTDOWN_HOOK \
167  return status; \
168  }
169 #endif
170 
171 #if !defined(RDM_DOXYGEN)
172 #if !defined(RDM_STARTUP_TEST)
173  #define RDM_STARTUP_TEST(name) \
174  int32_t name##_main(int32_t argc, const char *const *argv); \
175  int main(int argc, const char *const *argv) { \
176  int32_t status; \
177  \
178  RDM_STARTUP_HOOK \
179  status = name##_main(argc, argv); \
180  RDM_SHUTDOWN_HOOK \
181  return status; \
182  }
183 #endif
184 #endif
185 
186 #if !defined(RDM_STARTUP_EXAMPLE_CR)
187 
195  #define RDM_STARTUP_EXAMPLE_CR(name) RDM_STARTUP_EXAMPLE(name)
196 #endif
197 
200 #define RDM_LEN(x) (sizeof(x) / sizeof(x[0]))
201 
202 #if defined(NDEBUG) || defined(RDM_NO_ASSERT)
203 #define RDM_ASSERT(x)
204 #elif defined(RDM_ASSERT_INFINITE_LOOP)
205 #define RDM_ASSERT(x) {if (!(x)) {int asserted = 1; while (asserted);}}
206 #define RDM_ASSERT_ENABLED
207 #else
208 #include <assert.h>
210 #define RDM_ASSERT(x) assert(x)
211 #define RDM_ASSERT_ENABLED
212 #endif
213 
214 #if defined(RDM_ASSERT_ENABLED)
215  #define RDM_EVAL_ASSERT(x, y) RDM_ASSERT(x == y)
216 #else
217 
218  #define RDM_EVAL_ASSERT(x, y) x
219 #endif
220 
222 #define RDM_MIN(a, b) ((a) < (b) ? (a) : (b))
223 
224 #define RDM_MAX(a, b) ((a) > (b) ? (a) : (b))
225 
227 #define RDM_INT8_MIN ((int8_t) 0x80U)
228 
229 #define RDM_INT8_MAX ((int8_t) 0x7FU)
230 
231 #define RDM_UINT8_MAX ((uint8_t) 0xFFU)
232 
233 #define RDM_INT16_MIN ((int16_t) 0x8000U)
234 
235 #define RDM_INT16_MAX ((int16_t) 0x7FFFU)
236 
237 #define RDM_UINT16_MAX ((uint16_t) 0xFFFFU)
238 
239 #define RDM_INT32_MIN ((int32_t) 0x80000000U)
240 
241 #define RDM_INT32_MAX ((int32_t) 0x7FFFFFFFU)
242 
243 #define RDM_UINT32_MAX ((uint32_t) 0xFFFFFFFFU)
244 
245 #define RDM_INT64_MIN (-9223372036854775807LL - 1)
246 
247 #define RDM_INT64_MAX (9223372036854775807LL)
248 
249 #define RDM_UINT64_MAX ( 18446744073709551615ULL)
250 
252 #define RDM_INT64_FMT RDM_T("%") RDM_64BIT_CODE RDM_T("d")
253 
254 #define RDM_UINT64_FMT RDM_T("%") RDM_64BIT_CODE RDM_T("u")
255 
256 #define RDM_INT64_FMT_HEX RDM_T("%") RDM_64BIT_CODE RDM_T("X")
257 
258 #define RDM_UINT64_FMT_HEX RDM_T("%") RDM_64BIT_CODE RDM_T("X")
259 
260 #define RDM_INT64_FMT_SIZE(size) RDM_T("%") #size RDM_64BIT_CODE RDM_T("d")
261 
262 #define RDM_UINT64_FMT_SIZE(size) RDM_T("%") #size RDM_64BIT_CODE RDM_T("u")
263 
264 #define RDM_INT64_FMT_SIZE_HEX(size) RDM_T("%") #size RDM_64BIT_CODE RDM_T("X")
265 
266 #define RDM_UINT64_FMT_SIZE_HEX(size) RDM_T("%") #size RDM_64BIT_CODE RDM_T("X")
267 
268 #if !defined(RDM_DOXYGEN)
269 #define RDM_INT64_FMT_A "%" RDM_64BIT_CODE_A "d"
270 #define RDM_UINT64_FMT_A "%" RDM_64BIT_CODE_A "u"
271 #define RDM_INT64_FMT_HEX_A "%" RDM_64BIT_CODE_A "X"
272 #define RDM_UINT64_FMT_HEX_A "%" RDM_64BIT_CODE_A "X"
273 #define RDM_INT64_FMT_SIZE_A(size) "%" #size RDM_64BIT_CODE_A "d"
274 #define RDM_UINT64_FMT_SIZE_A(size) "%" #size RDM_64BIT_CODE_A "u"
275 #define RDM_INT64_FMT_SIZE_HEX_A(size) "%" #size RDM_64BIT_CODE_A "X"
276 #define RDM_UINT64_FMT_SIZE_HEX_A(size) "%" #size RDM_64BIT_CODE_A "X"
277 #endif
278 
279 #endif /* PSPTYPES_H_INCLUDED_ */
280 
Header for the Platform Support Package - Platform dependent types for INTEGRITY. ...
RDM_BOOL_T
Definition: psptypes.h:62
Header for the Platform Support Package - Platform dependent types for no operating systems...
Header for the Platform Support Package - Platform dependent types for VxWorks.
Header for the Platform Support Package - Platform dependent types used by Doxygen instead of the pla...
RDM_COMPARE
Definition: psptypes.h:70
Header for the Platform Support Package - Main defines for the ABI.
Header for the Platform Support Package - Platform dependent types for Windows.
RDM_ENC_TYPE
Definition: psptypes.h:86
Header for the Platform Support Package - Platform dependent types for Unix.
struct RDM_ENCRYPT_S * RDM_ENCRYPT
Definition: psptypes.h:77
Header for the Platform Support Package - PC-Lint.