1 /* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
3 Copyright (c) 2014-2015 Datalight, Inc.
4 All Rights Reserved Worldwide.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; use version 2 of the License.
10 This program is distributed in the hope that it will be useful,
11 but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
12 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 /* Businesses and individuals that for commercial or other reasons cannot
20 comply with the terms of the GPLv2 license may obtain a commercial license
21 before incorporating Reliance Edge into proprietary software for
22 distribution in any form. Visit http://www.datalight.com/reliance-edge for
26 @brief Compile-time validity checks for the REDCONF macros.
28 #ifndef REDCONFIGCHK_H
29 #define REDCONFIGCHK_H
31 #ifdef RED_CONFIG_MINCOMPAT_VER
32 #if (RED_VERSION_VAL & 0xFFFFFF00U) < (RED_CONFIG_MINCOMPAT_VER & 0xFFFFFF00U)
33 /* This indicates that your configuration files were generated by a
34 version of the Reliance Edge Configuration Utility that is designed
35 for a more recent version of Reliance Edge and is no longer compatible
36 with this version. You can update to the most recent version of
37 Reliance Edge or contact RelianceEdgeSupport@datalight.com to obtain
38 the correct legacy version of the Configuration Utility.
40 #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."
44 #ifndef REDCONF_READ_ONLY
45 #error "Configuration error: REDCONF_READ_ONLY must be defined."
47 #ifndef REDCONF_API_POSIX
48 #error "Configuration error: REDCONF_API_POSIX must be defined."
50 #ifndef REDCONF_API_FSE
51 #error "Configuration error: REDCONF_API_FSE must be defined."
54 #if REDCONF_API_POSIX == 1
55 #ifndef REDCONF_API_POSIX_FORMAT
56 #error "Configuration error: REDCONF_API_POSIX_FORMAT must be defined."
58 #ifndef REDCONF_API_POSIX_UNLINK
59 #error "Configuration error: REDCONF_API_POSIX_UNLINK must be defined."
61 #ifndef REDCONF_API_POSIX_MKDIR
62 #error "Configuration error: REDCONF_API_POSIX_MKDIR must be defined."
64 #ifndef REDCONF_API_POSIX_RMDIR
65 #error "Configuration error: REDCONF_API_POSIX_RMDIR must be defined."
67 #ifndef REDCONF_API_POSIX_RENAME
68 #error "Configuration error: REDCONF_API_POSIX_RENAME must be defined."
70 #ifndef REDCONF_API_POSIX_LINK
71 #error "Configuration error: REDCONF_API_POSIX_LINK must be defined."
73 #ifndef REDCONF_API_POSIX_FTRUNCATE
74 #error "Configuration error: REDCONF_API_POSIX_FTRUNCATE must be defined."
76 #ifndef REDCONF_API_POSIX_READDIR
77 #error "Configuration error: REDCONF_API_POSIX_READDIR must be defined."
79 #ifndef REDCONF_NAME_MAX
80 #error "Configuration error: REDCONF_NAME_MAX must be defined."
82 #ifndef REDCONF_PATH_SEPARATOR
83 #error "Configuration error: REDCONF_PATH_SEPARATOR must be defined."
85 #ifndef REDCONF_RENAME_ATOMIC
86 #error "Configuration error: REDCONF_RENAME_ATOMIC must be defined."
88 #ifndef REDCONF_HANDLE_COUNT
89 #error "Configuration error: REDCONF_HANDLE_COUNT must be defined."
92 #if REDCONF_API_FSE == 1
93 #ifndef REDCONF_API_FSE_FORMAT
94 #error "Configuration error: REDCONF_API_FSE_FORMAT must be defined."
96 #ifndef REDCONF_API_FSE_TRUNCATE
97 #error "Configuration error: REDCONF_API_FSE_TRUNCATE must be defined."
99 #ifndef REDCONF_API_FSE_TRANSMASKSET
100 #error "Configuration error: REDCONF_API_FSE_TRANSMASKSET must be defined."
102 #ifndef REDCONF_API_FSE_TRANSMASKGET
103 #error "Configuration error: REDCONF_API_FSE_TRANSMASKGET must be defined."
107 #ifndef REDCONF_TASK_COUNT
108 #error "Configuration error: REDCONF_TASK_COUNT must be defined."
110 #ifndef REDCONF_ENDIAN_BIG
111 #error "Configuration error: REDCONF_ENDIAN_BIG must be defined."
113 #ifndef REDCONF_ALIGNMENT_SIZE
114 #error "Configuration error: REDCONF_ALIGNMENT_SIZE must be defined."
116 #ifndef REDCONF_CRC_ALGORITHM
117 #error "Configuration error: REDCONF_CRC_ALGORITHM must be defined."
119 #ifndef REDCONF_INODE_TIMESTAMPS
120 #error "Configuration error: REDCONF_INODE_TIMESTAMPS must be defined."
122 #ifndef REDCONF_ATIME
123 #error "Configuration error: REDCONF_ATIME must be defined."
125 #ifndef REDCONF_DIRECT_POINTERS
126 #error "Configuration error: REDCONF_DIRECT_POINTERS must be defined."
128 #ifndef REDCONF_INDIRECT_POINTERS
129 #error "Configuration error: REDCONF_INDIRECT_POINTERS must be defined."
131 #ifndef REDCONF_INODE_BLOCKS
132 #error "Configuration error: REDCONF_INODE_BLOCKS must be defined."
134 #ifndef REDCONF_IMAP_EXTERNAL
135 #error "Configuration error: REDCONF_IMAP_EXTERNAL must be defined."
137 #ifndef REDCONF_IMAP_INLINE
138 #error "Configuration error: REDCONF_IMAP_INLINE must be defined."
140 #ifndef REDCONF_OUTPUT
141 #error "Configuration error: REDCONF_OUTPUT must be defined."
143 #ifndef REDCONF_ASSERTS
144 #error "Configuration error: REDCONF_ASSERTS must be defined."
146 #ifndef REDCONF_TRANSACT_DEFAULT
147 #error "Configuration error: REDCONF_TRANSACT_DEFAULT must be defined."
149 #ifndef REDCONF_BUFFER_COUNT
150 #error "Configuration error: REDCONF_BUFFER_COUNT must be defined."
152 #ifndef REDCONF_BLOCK_SIZE
153 #error "Configuration error: REDCONF_BLOCK_SIZE must be defined."
155 #ifndef REDCONF_VOLUME_COUNT
156 #error "Configuration error: REDCONF_VOLUME_COUNT must be defined."
158 #ifndef REDCONF_DISCARDS
159 /* Reliance Edge 1.0.5 and below did not have REDCONF_DISCARDS. You can
160 fix this error by downloading the latest version of the Configuration
161 Utility (assuming you are using the latest version of Reliance Edge)
162 from http://www.datalight.com/reliance-edge, loading your redconf.c
163 and redconf.h files, and saving them again, replacing the original
166 #error "Configuration error: your redconf.h is not compatible. Update your redconf files with a compatible version of the configuration utility."
168 #ifndef REDCONF_IMAGE_BUILDER
169 #error "Configuration error: REDCONF_IMAGE_BUILDER must be defined."
171 #ifndef REDCONF_CHECKER
172 #error "Configuration error: REDCONF_CHECKER must be defined."
176 #if (REDCONF_READ_ONLY != 0) && (REDCONF_READ_ONLY != 1)
177 #error "Configuration error: REDCONF_READ_ONLY must be either 0 or 1"
180 #if (REDCONF_API_POSIX != 0) && (REDCONF_API_POSIX != 1)
181 #error "Configuration error: REDCONF_API_POSIX must be either 0 or 1."
183 #if (REDCONF_API_FSE != 0) && (REDCONF_API_FSE != 1)
184 #error "Configuration error: REDCONF_API_FSE must be either 0 or 1."
187 #if (REDCONF_API_FSE == 0) && (REDCONF_API_POSIX == 0)
188 #error "Configuration error: either REDCONF_API_FSE or REDCONF_API_POSIX must be set to 1."
191 #if REDCONF_API_POSIX == 1
192 #if REDCONF_API_FSE != 0
193 #error "Configuration error: REDCONF_API_FSE must be 0 if REDCONF_API_POSIX is 1"
196 #if (REDCONF_API_POSIX_FORMAT != 0) && (REDCONF_API_POSIX_FORMAT != 1)
197 #error "Configuration error: REDCONF_API_POSIX_FORMAT must be either 0 or 1."
200 #if (REDCONF_API_POSIX_UNLINK != 0) && (REDCONF_API_POSIX_UNLINK != 1)
201 #error "Configuration error: REDCONF_API_POSIX_UNLINK must be either 0 or 1."
204 #if (REDCONF_API_POSIX_MKDIR != 0) && (REDCONF_API_POSIX_MKDIR != 1)
205 #error "Configuration error: REDCONF_API_POSIX_MKDIR must be either 0 or 1."
208 #if (REDCONF_API_POSIX_RMDIR != 0) && (REDCONF_API_POSIX_RMDIR != 1)
209 #error "Configuration error: REDCONF_API_POSIX_RMDIR must be either 0 or 1."
212 #if (REDCONF_API_POSIX_RENAME != 0) && (REDCONF_API_POSIX_RENAME != 1)
213 #error "Configuration error: REDCONF_API_POSIX_RENAME must be either 0 or 1."
216 #if (REDCONF_API_POSIX_LINK != 0) && (REDCONF_API_POSIX_LINK != 1)
217 #error "Configuration error: REDCONF_API_POSIX_LINK must be either 0 or 1."
220 #if (REDCONF_API_POSIX_FTRUNCATE != 0) && (REDCONF_API_POSIX_FTRUNCATE != 1)
221 #error "Configuration error: REDCONF_API_POSIX_FTRUNCATE must be either 0 or 1."
224 #if (REDCONF_API_POSIX_READDIR != 0) && (REDCONF_API_POSIX_READDIR != 1)
225 #error "Configuration error: REDCONF_API_POSIX_READDIR must be either 0 or 1."
228 #if (REDCONF_NAME_MAX < 1U) || (REDCONF_NAME_MAX > (REDCONF_BLOCK_SIZE - 4U))
229 #error "Configuration error: invalid value of REDCONF_NAME_MAX"
232 #if (REDCONF_PATH_SEPARATOR < 1) || (REDCONF_PATH_SEPARATOR > 127)
233 #error "Configuration error: invalid value of REDCONF_PATH_SEPARATOR"
236 #if (REDCONF_RENAME_ATOMIC != 0) && (REDCONF_RENAME_ATOMIC != 1)
237 #error "Configuration error: REDCONF_RENAME_ATOMIC must be either 0 or 1."
240 #if (REDCONF_HANDLE_COUNT < 1U) || (REDCONF_HANDLE_COUNT > 4096U)
241 #error "Configuration error: invalid value of REDCONF_HANDLE_COUNT"
244 #if REDCONF_API_FSE == 1
245 #if (REDCONF_API_FSE_FORMAT != 0) && (REDCONF_API_FSE_FORMAT != 1)
246 #error "Configuration error: REDCONF_API_FSE_FORMAT must be either 0 or 1."
249 #if (REDCONF_API_FSE_TRUNCATE != 0) && (REDCONF_API_FSE_TRUNCATE != 1)
250 #error "Configuration error: REDCONF_API_FSE_TRUNCATE must be either 0 or 1."
253 #if (REDCONF_API_FSE_TRANSMASKSET != 0) && (REDCONF_API_FSE_TRANSMASKSET != 1)
254 #error "Configuration error: REDCONF_API_FSE_TRANSMASKSET must be either 0 or 1."
257 #if (REDCONF_API_FSE_TRANSMASKGET != 0) && (REDCONF_API_FSE_TRANSMASKGET != 1)
258 #error "Configuration error: REDCONF_API_FSE_TRANSMASKGET must be either 0 or 1."
262 #if REDCONF_TASK_COUNT < 1U
263 #error "Configuration error: invalid value of REDCONF_TASK_COUNT"
266 #if (REDCONF_ENDIAN_BIG != 0) && (REDCONF_ENDIAN_BIG != 1)
267 #error "Configuration error: REDCONF_ENDIAN_BIG must be either 0 or 1."
270 #if (REDCONF_ALIGNMENT_SIZE != 1U) && (REDCONF_ALIGNMENT_SIZE != 2U) && (REDCONF_ALIGNMENT_SIZE != 4U) && (REDCONF_ALIGNMENT_SIZE != 8U)
271 #error "Configuration error: invalid value REDCONF_ALIGNMENT_SIZE"
274 /* REDCONF_CRC_ALGORITHM checked in crc.c
277 #if (REDCONF_INODE_TIMESTAMPS != 0) && (REDCONF_INODE_TIMESTAMPS != 1)
278 #error "Configuration error: REDCONF_INODE_TIMESTAMPS must be either 0 or 1."
281 #if (REDCONF_ATIME != 0) && (REDCONF_ATIME != 1)
282 #error "Configuration error: REDCONF_ATIME must be either 0 or 1."
285 #if (REDCONF_INODE_TIMESTAMPS == 0) && (REDCONF_ATIME == 1)
286 #error "Configuration error: REDCONF_ATIME must be 0 when REDCONF_INODE_TIMESTAMPS is 0."
289 /* REDCONF_DIRECT_POINTERS and REDCONF_INDIRECT_POINTERS checked in rednodes.h
292 #if (REDCONF_INODE_BLOCKS != 0) && (REDCONF_INODE_BLOCKS != 1)
293 #error "Configuration error: REDCONF_INODE_BLOCKS must be either 0 or 1."
296 /* Further validity checking of imap specs done in RelCoreInit()
298 #if (REDCONF_IMAP_EXTERNAL != 0) && (REDCONF_IMAP_EXTERNAL != 1)
299 #error "Configuration error: REDCONF_IMAP_EXTERNAL must be either 0 or 1."
301 #if (REDCONF_IMAP_INLINE != 0) && (REDCONF_IMAP_INLINE != 1)
302 #error "Configuration error: REDCONF_IMAP_INLINE must be either 0 or 1."
304 #if (REDCONF_IMAP_INLINE == 0) && (REDCONF_IMAP_EXTERNAL == 0)
305 #error "Configuration error: At least one of REDCONF_IMAP_INLINE and REDCONF_IMAP_EXTERNAL must be set"
308 #if (REDCONF_OUTPUT != 0) && (REDCONF_OUTPUT != 1)
309 #error "Configuration error: REDCONF_OUTPUT must be either 0 or 1."
312 #if (REDCONF_ASSERTS != 0) && (REDCONF_ASSERTS != 1)
313 #error "Configuration error: REDCONF_ASSERTS must be either 0 or 1."
316 /* REDCONF_BLOCK_SIZE checked in redmacs.h
319 #if (REDCONF_VOLUME_COUNT < 1U) || (REDCONF_VOLUME_COUNT > 255U)
320 #error "REDCONF_VOLUME_COUNT must be an integer between 1 and 255"
323 #if (REDCONF_DISCARDS != 0) && (REDCONF_DISCARDS != 1)
324 #error "Configuration error: REDCONF_DISCARDS must be either 0 or 1."
327 /* REDCONF_BUFFER_COUNT lower limit checked in buffer.c
329 #if REDCONF_BUFFER_COUNT > 255U
330 #error "REDCONF_BUFFER_COUNT cannot be greater than 255"
333 #if (REDCONF_IMAGE_BUILDER != 0) && (REDCONF_IMAGE_BUILDER != 1)
334 #error "Configuration error: REDCONF_IMAGE_BUILDER must be either 0 or 1."
337 #if (REDCONF_CHECKER != 0) && (REDCONF_CHECKER != 1)
338 #error "Configuration error: REDCONF_CHECKER must be either 0 or 1."
342 #if (REDCONF_DISCARDS == 1) && (RED_KIT == RED_KIT_GPL)
343 #error "REDCONF_DISCARDS not supported in Reliance Edge under GPL. Contact sales@datalight.com to upgrade."