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) || defined(RDM_WINCE)
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(RDM_ASSERT)
203 
204  #define RDM_ASSERT(x)
205 #endif
206 
207 #if defined(RDM_ASSERT_ENABLED)
208  #define RDM_EVAL_ASSERT(x, y) RDM_ASSERT(x == y)
209 #else
210 
211  #define RDM_EVAL_ASSERT(x, y) x
212 #endif
213 
215 #define RDM_MIN(a, b) ((a) < (b) ? (a) : (b))
216 
217 #define RDM_MAX(a, b) ((a) > (b) ? (a) : (b))
218 
220 #define RDM_INT8_MIN ((int8_t) 0x80U)
221 
222 #define RDM_INT8_MAX ((int8_t) 0x7FU)
223 
224 #define RDM_UINT8_MAX ((uint8_t) 0xFFU)
225 
226 #define RDM_INT16_MIN ((int16_t) 0x8000U)
227 
228 #define RDM_INT16_MAX ((int16_t) 0x7FFFU)
229 
230 #define RDM_UINT16_MAX ((uint16_t) 0xFFFFU)
231 
232 #define RDM_INT32_MIN ((int32_t) 0x80000000U)
233 
234 #define RDM_INT32_MAX ((int32_t) 0x7FFFFFFFU)
235 
236 #define RDM_UINT32_MAX ((uint32_t) 0xFFFFFFFFU)
237 
238 #define RDM_INT64_MIN (-9223372036854775807LL - 1)
239 
240 #define RDM_INT64_MAX (9223372036854775807LL)
241 
242 #define RDM_UINT64_MAX ( 18446744073709551615ULL)
243 
245 #define RDM_INT64_FMT RDM_T("%") RDM_64BIT_CODE RDM_T("d")
246 
247 #define RDM_UINT64_FMT RDM_T("%") RDM_64BIT_CODE RDM_T("u")
248 
249 #define RDM_INT64_FMT_HEX RDM_T("%") RDM_64BIT_CODE RDM_T("X")
250 
251 #define RDM_UINT64_FMT_HEX RDM_T("%") RDM_64BIT_CODE RDM_T("X")
252 
253 #define RDM_INT64_FMT_SIZE(size) RDM_T("%") #size RDM_64BIT_CODE RDM_T("d")
254 
255 #define RDM_UINT64_FMT_SIZE(size) RDM_T("%") #size RDM_64BIT_CODE RDM_T("u")
256 
257 #define RDM_INT64_FMT_SIZE_HEX(size) RDM_T("%") #size RDM_64BIT_CODE RDM_T("X")
258 
259 #define RDM_UINT64_FMT_SIZE_HEX(size) RDM_T("%") #size RDM_64BIT_CODE RDM_T("X")
260 
261 #if !defined(RDM_DOXYGEN)
262 #define RDM_INT64_FMT_A "%" RDM_64BIT_CODE_A "d"
263 #define RDM_UINT64_FMT_A "%" RDM_64BIT_CODE_A "u"
264 #define RDM_INT64_FMT_HEX_A "%" RDM_64BIT_CODE_A "X"
265 #define RDM_UINT64_FMT_HEX_A "%" RDM_64BIT_CODE_A "X"
266 #define RDM_INT64_FMT_SIZE_A(size) "%" #size RDM_64BIT_CODE_A "d"
267 #define RDM_UINT64_FMT_SIZE_A(size) "%" #size RDM_64BIT_CODE_A "u"
268 #define RDM_INT64_FMT_SIZE_HEX_A(size) "%" #size RDM_64BIT_CODE_A "X"
269 #define RDM_UINT64_FMT_SIZE_HEX_A(size) "%" #size RDM_64BIT_CODE_A "X"
270 #endif
271 
272 #endif /* PSPTYPES_H_INCLUDED_ */
273 
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.