]> begriffs open source - freertos/blob - FreeRTOS-Plus/Source/Reliance-Edge/include/redconfigchk.h
Update Reliance Edge fail safe file system to the latest version.
[freertos] / FreeRTOS-Plus / Source / Reliance-Edge / include / redconfigchk.h
1 /*             ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
2
3                    Copyright (c) 2014-2015 Datalight, Inc.
4                        All Rights Reserved Worldwide.
5
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.
9
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.
14
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.
18 */
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
23     more information.
24 */
25 /** @file
26     @brief Compile-time validity checks for the REDCONF macros.
27 */
28 #ifndef REDCONFIGCHK_H
29 #define REDCONFIGCHK_H
30
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.
39     */
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."
41   #endif
42 #endif
43
44 #ifndef REDCONF_READ_ONLY
45   #error "Configuration error: REDCONF_READ_ONLY must be defined."
46 #endif
47 #ifndef REDCONF_API_POSIX
48   #error "Configuration error: REDCONF_API_POSIX must be defined."
49 #endif
50 #ifndef REDCONF_API_FSE
51   #error "Configuration error: REDCONF_API_FSE must be defined."
52 #endif
53
54 #if REDCONF_API_POSIX == 1
55   #ifndef REDCONF_API_POSIX_FORMAT
56     #error "Configuration error: REDCONF_API_POSIX_FORMAT must be defined."
57   #endif
58   #ifndef REDCONF_API_POSIX_UNLINK
59     #error "Configuration error: REDCONF_API_POSIX_UNLINK must be defined."
60   #endif
61   #ifndef REDCONF_API_POSIX_MKDIR
62     #error "Configuration error: REDCONF_API_POSIX_MKDIR must be defined."
63   #endif
64   #ifndef REDCONF_API_POSIX_RMDIR
65     #error "Configuration error: REDCONF_API_POSIX_RMDIR must be defined."
66   #endif
67   #ifndef REDCONF_API_POSIX_RENAME
68     #error "Configuration error: REDCONF_API_POSIX_RENAME must be defined."
69   #endif
70   #ifndef REDCONF_API_POSIX_LINK
71     #error "Configuration error: REDCONF_API_POSIX_LINK must be defined."
72   #endif
73   #ifndef REDCONF_API_POSIX_FTRUNCATE
74     #error "Configuration error: REDCONF_API_POSIX_FTRUNCATE must be defined."
75   #endif
76   #ifndef REDCONF_API_POSIX_READDIR
77     #error "Configuration error: REDCONF_API_POSIX_READDIR must be defined."
78   #endif
79   #ifndef REDCONF_NAME_MAX
80     #error "Configuration error: REDCONF_NAME_MAX must be defined."
81   #endif
82   #ifndef REDCONF_PATH_SEPARATOR
83     #error "Configuration error: REDCONF_PATH_SEPARATOR must be defined."
84   #endif
85   #ifndef REDCONF_RENAME_ATOMIC
86     #error "Configuration error: REDCONF_RENAME_ATOMIC must be defined."
87   #endif
88   #ifndef REDCONF_HANDLE_COUNT
89     #error "Configuration error: REDCONF_HANDLE_COUNT must be defined."
90   #endif
91 #endif
92 #if REDCONF_API_FSE == 1
93   #ifndef REDCONF_API_FSE_FORMAT
94     #error "Configuration error: REDCONF_API_FSE_FORMAT must be defined."
95   #endif
96   #ifndef REDCONF_API_FSE_TRUNCATE
97     #error "Configuration error: REDCONF_API_FSE_TRUNCATE must be defined."
98   #endif
99   #ifndef REDCONF_API_FSE_TRANSMASKSET
100     #error "Configuration error: REDCONF_API_FSE_TRANSMASKSET must be defined."
101   #endif
102   #ifndef REDCONF_API_FSE_TRANSMASKGET
103     #error "Configuration error: REDCONF_API_FSE_TRANSMASKGET must be defined."
104   #endif
105 #endif
106
107 #ifndef REDCONF_TASK_COUNT
108   #error "Configuration error: REDCONF_TASK_COUNT must be defined."
109 #endif
110 #ifndef REDCONF_ENDIAN_BIG
111   #error "Configuration error: REDCONF_ENDIAN_BIG must be defined."
112 #endif
113 #ifndef REDCONF_ALIGNMENT_SIZE
114   #error "Configuration error: REDCONF_ALIGNMENT_SIZE must be defined."
115 #endif
116 #ifndef REDCONF_CRC_ALGORITHM
117   #error "Configuration error: REDCONF_CRC_ALGORITHM must be defined."
118 #endif
119 #ifndef REDCONF_INODE_TIMESTAMPS
120   #error "Configuration error: REDCONF_INODE_TIMESTAMPS must be defined."
121 #endif
122 #ifndef REDCONF_ATIME
123   #error "Configuration error: REDCONF_ATIME must be defined."
124 #endif
125 #ifndef REDCONF_DIRECT_POINTERS
126   #error "Configuration error: REDCONF_DIRECT_POINTERS must be defined."
127 #endif
128 #ifndef REDCONF_INDIRECT_POINTERS
129   #error "Configuration error: REDCONF_INDIRECT_POINTERS must be defined."
130 #endif
131 #ifndef REDCONF_INODE_BLOCKS
132   #error "Configuration error: REDCONF_INODE_BLOCKS must be defined."
133 #endif
134 #ifndef REDCONF_IMAP_EXTERNAL
135   #error "Configuration error: REDCONF_IMAP_EXTERNAL must be defined."
136 #endif
137 #ifndef REDCONF_IMAP_INLINE
138   #error "Configuration error: REDCONF_IMAP_INLINE must be defined."
139 #endif
140 #ifndef REDCONF_OUTPUT
141   #error "Configuration error: REDCONF_OUTPUT must be defined."
142 #endif
143 #ifndef REDCONF_ASSERTS
144   #error "Configuration error: REDCONF_ASSERTS must be defined."
145 #endif
146 #ifndef REDCONF_TRANSACT_DEFAULT
147   #error "Configuration error: REDCONF_TRANSACT_DEFAULT must be defined."
148 #endif
149 #ifndef REDCONF_BUFFER_COUNT
150   #error "Configuration error: REDCONF_BUFFER_COUNT must be defined."
151 #endif
152 #ifndef REDCONF_BLOCK_SIZE
153   #error "Configuration error: REDCONF_BLOCK_SIZE must be defined."
154 #endif
155 #ifndef REDCONF_VOLUME_COUNT
156   #error "Configuration error: REDCONF_VOLUME_COUNT must be defined."
157 #endif
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
164         files.
165     */
166   #error "Configuration error: your redconf.h is not compatible. Update your redconf files with a compatible version of the configuration utility."
167 #endif
168 #ifndef REDCONF_IMAGE_BUILDER
169   #error "Configuration error: REDCONF_IMAGE_BUILDER must be defined."
170 #endif
171 #ifndef REDCONF_CHECKER
172   #error "Configuration error: REDCONF_CHECKER must be defined."
173 #endif
174
175
176 #if (REDCONF_READ_ONLY != 0) && (REDCONF_READ_ONLY != 1)
177   #error "Configuration error: REDCONF_READ_ONLY must be either 0 or 1"
178 #endif
179
180 #if (REDCONF_API_POSIX != 0) && (REDCONF_API_POSIX != 1)
181   #error "Configuration error: REDCONF_API_POSIX must be either 0 or 1."
182 #endif
183 #if (REDCONF_API_FSE != 0) && (REDCONF_API_FSE != 1)
184   #error "Configuration error: REDCONF_API_FSE must be either 0 or 1."
185 #endif
186
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."
189 #endif
190
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"
194   #endif
195
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."
198   #endif
199
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."
202   #endif
203
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."
206   #endif
207
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."
210   #endif
211
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."
214   #endif
215
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."
218   #endif
219
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."
222   #endif
223
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."
226   #endif
227
228   #if (REDCONF_NAME_MAX < 1U) || (REDCONF_NAME_MAX > (REDCONF_BLOCK_SIZE - 4U))
229     #error "Configuration error: invalid value of REDCONF_NAME_MAX"
230   #endif
231
232   #if (REDCONF_PATH_SEPARATOR < 1) || (REDCONF_PATH_SEPARATOR > 127)
233     #error "Configuration error: invalid value of REDCONF_PATH_SEPARATOR"
234   #endif
235
236   #if (REDCONF_RENAME_ATOMIC != 0) && (REDCONF_RENAME_ATOMIC != 1)
237     #error "Configuration error: REDCONF_RENAME_ATOMIC must be either 0 or 1."
238   #endif
239
240   #if (REDCONF_HANDLE_COUNT < 1U) || (REDCONF_HANDLE_COUNT > 4096U)
241     #error "Configuration error: invalid value of REDCONF_HANDLE_COUNT"
242   #endif
243 #endif
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."
247   #endif
248
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."
251   #endif
252
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."
255   #endif
256
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."
259   #endif
260 #endif
261
262 #if REDCONF_TASK_COUNT < 1U
263   #error "Configuration error: invalid value of REDCONF_TASK_COUNT"
264 #endif
265
266 #if (REDCONF_ENDIAN_BIG != 0) && (REDCONF_ENDIAN_BIG != 1)
267   #error "Configuration error: REDCONF_ENDIAN_BIG must be either 0 or 1."
268 #endif
269
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"
272 #endif
273
274 /*  REDCONF_CRC_ALGORITHM checked in crc.c
275 */
276
277 #if (REDCONF_INODE_TIMESTAMPS != 0) && (REDCONF_INODE_TIMESTAMPS != 1)
278   #error "Configuration error: REDCONF_INODE_TIMESTAMPS must be either 0 or 1."
279 #endif
280
281 #if (REDCONF_ATIME != 0) && (REDCONF_ATIME != 1)
282   #error "Configuration error: REDCONF_ATIME must be either 0 or 1."
283 #endif
284
285 #if (REDCONF_INODE_TIMESTAMPS == 0) && (REDCONF_ATIME == 1)
286   #error "Configuration error: REDCONF_ATIME must be 0 when REDCONF_INODE_TIMESTAMPS is 0."
287 #endif
288
289 /*  REDCONF_DIRECT_POINTERS and REDCONF_INDIRECT_POINTERS checked in rednodes.h
290 */
291
292 #if (REDCONF_INODE_BLOCKS != 0) && (REDCONF_INODE_BLOCKS != 1)
293   #error "Configuration error: REDCONF_INODE_BLOCKS must be either 0 or 1."
294 #endif
295
296 /*  Further validity checking of imap specs done in RelCoreInit()
297 */
298 #if (REDCONF_IMAP_EXTERNAL != 0) && (REDCONF_IMAP_EXTERNAL != 1)
299   #error "Configuration error: REDCONF_IMAP_EXTERNAL must be either 0 or 1."
300 #endif
301 #if (REDCONF_IMAP_INLINE != 0) && (REDCONF_IMAP_INLINE != 1)
302   #error "Configuration error: REDCONF_IMAP_INLINE must be either 0 or 1."
303 #endif
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"
306 #endif
307
308 #if (REDCONF_OUTPUT != 0) && (REDCONF_OUTPUT != 1)
309   #error "Configuration error: REDCONF_OUTPUT must be either 0 or 1."
310 #endif
311
312 #if (REDCONF_ASSERTS != 0) && (REDCONF_ASSERTS != 1)
313   #error "Configuration error: REDCONF_ASSERTS must be either 0 or 1."
314 #endif
315
316 /*  REDCONF_BLOCK_SIZE checked in redmacs.h
317 */
318
319 #if (REDCONF_VOLUME_COUNT < 1U) || (REDCONF_VOLUME_COUNT > 255U)
320   #error "REDCONF_VOLUME_COUNT must be an integer between 1 and 255"
321 #endif
322
323 #if (REDCONF_DISCARDS != 0) && (REDCONF_DISCARDS != 1)
324   #error "Configuration error: REDCONF_DISCARDS must be either 0 or 1."
325 #endif
326
327 /*  REDCONF_BUFFER_COUNT lower limit checked in buffer.c
328 */
329 #if REDCONF_BUFFER_COUNT > 255U
330   #error "REDCONF_BUFFER_COUNT cannot be greater than 255"
331 #endif
332
333 #if (REDCONF_IMAGE_BUILDER != 0) && (REDCONF_IMAGE_BUILDER != 1)
334   #error "Configuration error: REDCONF_IMAGE_BUILDER must be either 0 or 1."
335 #endif
336
337 #if (REDCONF_CHECKER != 0) && (REDCONF_CHECKER != 1)
338   #error "Configuration error: REDCONF_CHECKER must be either 0 or 1."
339 #endif
340
341
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."
344 #endif
345
346
347 #endif
348
349