1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
|
/* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
Copyright (c) 2014-2015 Datalight, Inc.
All Rights Reserved Worldwide.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; use version 2 of the License.
This program is distributed in the hope that it will be useful,
but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* Businesses and individuals that for commercial or other reasons cannot
comply with the terms of the GPLv2 license may obtain a commercial license
before incorporating Reliance Edge into proprietary software for
distribution in any form. Visit http://www.datalight.com/reliance-edge for
more information.
*/
/** @file
@brief Compile-time validity checks for the REDCONF macros.
*/
#ifndef REDCONFIGCHK_H
#define REDCONFIGCHK_H
#ifdef RED_CONFIG_MINCOMPAT_VER
#if (RED_VERSION_VAL & 0xFFFFFF00U) < (RED_CONFIG_MINCOMPAT_VER & 0xFFFFFF00U)
/* This indicates that your configuration files were generated by a
version of the Reliance Edge Configuration Utility that is designed
for a more recent version of Reliance Edge and is no longer compatible
with this version. You can update to the most recent version of
Reliance Edge or contact RelianceEdgeSupport@datalight.com to obtain
the correct legacy version of the Configuration Utility.
*/
#error "Your configuration is not compatible with this version of Reliance Edge. Please download the latest version of Reliance Edge or recreate your configuration with an older version of the Configuration Utility."
#endif
#endif
#ifndef REDCONF_READ_ONLY
#error "Configuration error: REDCONF_READ_ONLY must be defined."
#endif
#ifndef REDCONF_API_POSIX
#error "Configuration error: REDCONF_API_POSIX must be defined."
#endif
#ifndef REDCONF_API_FSE
#error "Configuration error: REDCONF_API_FSE must be defined."
#endif
#if REDCONF_API_POSIX == 1
#ifndef REDCONF_API_POSIX_FORMAT
#error "Configuration error: REDCONF_API_POSIX_FORMAT must be defined."
#endif
#ifndef REDCONF_API_POSIX_UNLINK
#error "Configuration error: REDCONF_API_POSIX_UNLINK must be defined."
#endif
#ifndef REDCONF_API_POSIX_MKDIR
#error "Configuration error: REDCONF_API_POSIX_MKDIR must be defined."
#endif
#ifndef REDCONF_API_POSIX_RMDIR
#error "Configuration error: REDCONF_API_POSIX_RMDIR must be defined."
#endif
#ifndef REDCONF_API_POSIX_RENAME
#error "Configuration error: REDCONF_API_POSIX_RENAME must be defined."
#endif
#ifndef REDCONF_API_POSIX_LINK
#error "Configuration error: REDCONF_API_POSIX_LINK must be defined."
#endif
#ifndef REDCONF_API_POSIX_FTRUNCATE
#error "Configuration error: REDCONF_API_POSIX_FTRUNCATE must be defined."
#endif
#ifndef REDCONF_API_POSIX_READDIR
#error "Configuration error: REDCONF_API_POSIX_READDIR must be defined."
#endif
#ifndef REDCONF_NAME_MAX
#error "Configuration error: REDCONF_NAME_MAX must be defined."
#endif
#ifndef REDCONF_PATH_SEPARATOR
#error "Configuration error: REDCONF_PATH_SEPARATOR must be defined."
#endif
#ifndef REDCONF_RENAME_ATOMIC
#error "Configuration error: REDCONF_RENAME_ATOMIC must be defined."
#endif
#ifndef REDCONF_HANDLE_COUNT
#error "Configuration error: REDCONF_HANDLE_COUNT must be defined."
#endif
#endif
#if REDCONF_API_FSE == 1
#ifndef REDCONF_API_FSE_FORMAT
#error "Configuration error: REDCONF_API_FSE_FORMAT must be defined."
#endif
#ifndef REDCONF_API_FSE_TRUNCATE
#error "Configuration error: REDCONF_API_FSE_TRUNCATE must be defined."
#endif
#ifndef REDCONF_API_FSE_TRANSMASKSET
#error "Configuration error: REDCONF_API_FSE_TRANSMASKSET must be defined."
#endif
#ifndef REDCONF_API_FSE_TRANSMASKGET
#error "Configuration error: REDCONF_API_FSE_TRANSMASKGET must be defined."
#endif
#endif
#ifndef REDCONF_TASK_COUNT
#error "Configuration error: REDCONF_TASK_COUNT must be defined."
#endif
#ifndef REDCONF_ENDIAN_BIG
#error "Configuration error: REDCONF_ENDIAN_BIG must be defined."
#endif
#ifndef REDCONF_ALIGNMENT_SIZE
#error "Configuration error: REDCONF_ALIGNMENT_SIZE must be defined."
#endif
#ifndef REDCONF_CRC_ALGORITHM
#error "Configuration error: REDCONF_CRC_ALGORITHM must be defined."
#endif
#ifndef REDCONF_INODE_TIMESTAMPS
#error "Configuration error: REDCONF_INODE_TIMESTAMPS must be defined."
#endif
#ifndef REDCONF_ATIME
#error "Configuration error: REDCONF_ATIME must be defined."
#endif
#ifndef REDCONF_DIRECT_POINTERS
#error "Configuration error: REDCONF_DIRECT_POINTERS must be defined."
#endif
#ifndef REDCONF_INDIRECT_POINTERS
#error "Configuration error: REDCONF_INDIRECT_POINTERS must be defined."
#endif
#ifndef REDCONF_INODE_BLOCKS
#error "Configuration error: REDCONF_INODE_BLOCKS must be defined."
#endif
#ifndef REDCONF_IMAP_EXTERNAL
#error "Configuration error: REDCONF_IMAP_EXTERNAL must be defined."
#endif
#ifndef REDCONF_IMAP_INLINE
#error "Configuration error: REDCONF_IMAP_INLINE must be defined."
#endif
#ifndef REDCONF_OUTPUT
#error "Configuration error: REDCONF_OUTPUT must be defined."
#endif
#ifndef REDCONF_ASSERTS
#error "Configuration error: REDCONF_ASSERTS must be defined."
#endif
#ifndef REDCONF_TRANSACT_DEFAULT
#error "Configuration error: REDCONF_TRANSACT_DEFAULT must be defined."
#endif
#ifndef REDCONF_BUFFER_COUNT
#error "Configuration error: REDCONF_BUFFER_COUNT must be defined."
#endif
#ifndef REDCONF_BLOCK_SIZE
#error "Configuration error: REDCONF_BLOCK_SIZE must be defined."
#endif
#ifndef REDCONF_VOLUME_COUNT
#error "Configuration error: REDCONF_VOLUME_COUNT must be defined."
#endif
#ifndef REDCONF_DISCARDS
/* Reliance Edge 1.0.5 and below did not have REDCONF_DISCARDS. You can
fix this error by downloading the latest version of the Configuration
Utility (assuming you are using the latest version of Reliance Edge)
from http://www.datalight.com/reliance-edge, loading your redconf.c
and redconf.h files, and saving them again, replacing the original
files.
*/
#error "Configuration error: your redconf.h is not compatible. Update your redconf files with a compatible version of the configuration utility."
#endif
#ifndef REDCONF_IMAGE_BUILDER
#error "Configuration error: REDCONF_IMAGE_BUILDER must be defined."
#endif
#ifndef REDCONF_CHECKER
#error "Configuration error: REDCONF_CHECKER must be defined."
#endif
#if (REDCONF_READ_ONLY != 0) && (REDCONF_READ_ONLY != 1)
#error "Configuration error: REDCONF_READ_ONLY must be either 0 or 1"
#endif
#if (REDCONF_API_POSIX != 0) && (REDCONF_API_POSIX != 1)
#error "Configuration error: REDCONF_API_POSIX must be either 0 or 1."
#endif
#if (REDCONF_API_FSE != 0) && (REDCONF_API_FSE != 1)
#error "Configuration error: REDCONF_API_FSE must be either 0 or 1."
#endif
#if (REDCONF_API_FSE == 0) && (REDCONF_API_POSIX == 0)
#error "Configuration error: either REDCONF_API_FSE or REDCONF_API_POSIX must be set to 1."
#endif
#if REDCONF_API_POSIX == 1
#if REDCONF_API_FSE != 0
#error "Configuration error: REDCONF_API_FSE must be 0 if REDCONF_API_POSIX is 1"
#endif
#if (REDCONF_API_POSIX_FORMAT != 0) && (REDCONF_API_POSIX_FORMAT != 1)
#error "Configuration error: REDCONF_API_POSIX_FORMAT must be either 0 or 1."
#endif
#if (REDCONF_API_POSIX_UNLINK != 0) && (REDCONF_API_POSIX_UNLINK != 1)
#error "Configuration error: REDCONF_API_POSIX_UNLINK must be either 0 or 1."
#endif
#if (REDCONF_API_POSIX_MKDIR != 0) && (REDCONF_API_POSIX_MKDIR != 1)
#error "Configuration error: REDCONF_API_POSIX_MKDIR must be either 0 or 1."
#endif
#if (REDCONF_API_POSIX_RMDIR != 0) && (REDCONF_API_POSIX_RMDIR != 1)
#error "Configuration error: REDCONF_API_POSIX_RMDIR must be either 0 or 1."
#endif
#if (REDCONF_API_POSIX_RENAME != 0) && (REDCONF_API_POSIX_RENAME != 1)
#error "Configuration error: REDCONF_API_POSIX_RENAME must be either 0 or 1."
#endif
#if (REDCONF_API_POSIX_LINK != 0) && (REDCONF_API_POSIX_LINK != 1)
#error "Configuration error: REDCONF_API_POSIX_LINK must be either 0 or 1."
#endif
#if (REDCONF_API_POSIX_FTRUNCATE != 0) && (REDCONF_API_POSIX_FTRUNCATE != 1)
#error "Configuration error: REDCONF_API_POSIX_FTRUNCATE must be either 0 or 1."
#endif
#if (REDCONF_API_POSIX_READDIR != 0) && (REDCONF_API_POSIX_READDIR != 1)
#error "Configuration error: REDCONF_API_POSIX_READDIR must be either 0 or 1."
#endif
#if (REDCONF_NAME_MAX < 1U) || (REDCONF_NAME_MAX > (REDCONF_BLOCK_SIZE - 4U))
#error "Configuration error: invalid value of REDCONF_NAME_MAX"
#endif
#if (REDCONF_PATH_SEPARATOR < 1) || (REDCONF_PATH_SEPARATOR > 127)
#error "Configuration error: invalid value of REDCONF_PATH_SEPARATOR"
#endif
#if (REDCONF_RENAME_ATOMIC != 0) && (REDCONF_RENAME_ATOMIC != 1)
#error "Configuration error: REDCONF_RENAME_ATOMIC must be either 0 or 1."
#endif
#if (REDCONF_HANDLE_COUNT < 1U) || (REDCONF_HANDLE_COUNT > 4096U)
#error "Configuration error: invalid value of REDCONF_HANDLE_COUNT"
#endif
#endif
#if REDCONF_API_FSE == 1
#if (REDCONF_API_FSE_FORMAT != 0) && (REDCONF_API_FSE_FORMAT != 1)
#error "Configuration error: REDCONF_API_FSE_FORMAT must be either 0 or 1."
#endif
#if (REDCONF_API_FSE_TRUNCATE != 0) && (REDCONF_API_FSE_TRUNCATE != 1)
#error "Configuration error: REDCONF_API_FSE_TRUNCATE must be either 0 or 1."
#endif
#if (REDCONF_API_FSE_TRANSMASKSET != 0) && (REDCONF_API_FSE_TRANSMASKSET != 1)
#error "Configuration error: REDCONF_API_FSE_TRANSMASKSET must be either 0 or 1."
#endif
#if (REDCONF_API_FSE_TRANSMASKGET != 0) && (REDCONF_API_FSE_TRANSMASKGET != 1)
#error "Configuration error: REDCONF_API_FSE_TRANSMASKGET must be either 0 or 1."
#endif
#endif
#if REDCONF_TASK_COUNT < 1U
#error "Configuration error: invalid value of REDCONF_TASK_COUNT"
#endif
#if (REDCONF_ENDIAN_BIG != 0) && (REDCONF_ENDIAN_BIG != 1)
#error "Configuration error: REDCONF_ENDIAN_BIG must be either 0 or 1."
#endif
#if (REDCONF_ALIGNMENT_SIZE != 1U) && (REDCONF_ALIGNMENT_SIZE != 2U) && (REDCONF_ALIGNMENT_SIZE != 4U) && (REDCONF_ALIGNMENT_SIZE != 8U)
#error "Configuration error: invalid value REDCONF_ALIGNMENT_SIZE"
#endif
/* REDCONF_CRC_ALGORITHM checked in crc.c
*/
#if (REDCONF_INODE_TIMESTAMPS != 0) && (REDCONF_INODE_TIMESTAMPS != 1)
#error "Configuration error: REDCONF_INODE_TIMESTAMPS must be either 0 or 1."
#endif
#if (REDCONF_ATIME != 0) && (REDCONF_ATIME != 1)
#error "Configuration error: REDCONF_ATIME must be either 0 or 1."
#endif
#if (REDCONF_INODE_TIMESTAMPS == 0) && (REDCONF_ATIME == 1)
#error "Configuration error: REDCONF_ATIME must be 0 when REDCONF_INODE_TIMESTAMPS is 0."
#endif
/* REDCONF_DIRECT_POINTERS and REDCONF_INDIRECT_POINTERS checked in rednodes.h
*/
#if (REDCONF_INODE_BLOCKS != 0) && (REDCONF_INODE_BLOCKS != 1)
#error "Configuration error: REDCONF_INODE_BLOCKS must be either 0 or 1."
#endif
/* Further validity checking of imap specs done in RelCoreInit()
*/
#if (REDCONF_IMAP_EXTERNAL != 0) && (REDCONF_IMAP_EXTERNAL != 1)
#error "Configuration error: REDCONF_IMAP_EXTERNAL must be either 0 or 1."
#endif
#if (REDCONF_IMAP_INLINE != 0) && (REDCONF_IMAP_INLINE != 1)
#error "Configuration error: REDCONF_IMAP_INLINE must be either 0 or 1."
#endif
#if (REDCONF_IMAP_INLINE == 0) && (REDCONF_IMAP_EXTERNAL == 0)
#error "Configuration error: At least one of REDCONF_IMAP_INLINE and REDCONF_IMAP_EXTERNAL must be set"
#endif
#if (REDCONF_OUTPUT != 0) && (REDCONF_OUTPUT != 1)
#error "Configuration error: REDCONF_OUTPUT must be either 0 or 1."
#endif
#if (REDCONF_ASSERTS != 0) && (REDCONF_ASSERTS != 1)
#error "Configuration error: REDCONF_ASSERTS must be either 0 or 1."
#endif
/* REDCONF_BLOCK_SIZE checked in redmacs.h
*/
#if (REDCONF_VOLUME_COUNT < 1U) || (REDCONF_VOLUME_COUNT > 255U)
#error "REDCONF_VOLUME_COUNT must be an integer between 1 and 255"
#endif
#if (REDCONF_DISCARDS != 0) && (REDCONF_DISCARDS != 1)
#error "Configuration error: REDCONF_DISCARDS must be either 0 or 1."
#endif
/* REDCONF_BUFFER_COUNT lower limit checked in buffer.c
*/
#if REDCONF_BUFFER_COUNT > 255U
#error "REDCONF_BUFFER_COUNT cannot be greater than 255"
#endif
#if (REDCONF_IMAGE_BUILDER != 0) && (REDCONF_IMAGE_BUILDER != 1)
#error "Configuration error: REDCONF_IMAGE_BUILDER must be either 0 or 1."
#endif
#if (REDCONF_CHECKER != 0) && (REDCONF_CHECKER != 1)
#error "Configuration error: REDCONF_CHECKER must be either 0 or 1."
#endif
#if (REDCONF_DISCARDS == 1) && (RED_KIT == RED_KIT_GPL)
#error "REDCONF_DISCARDS not supported in Reliance Edge under GPL. Contact sales@datalight.com to upgrade."
#endif
#endif
|