EVE 1.0
toc-ids.h
Go to the documentation of this file.
1 #include <toc/toc-app.h>
2 #include <sys/cc.h>
3 /**********************************************************************/
4 /*
5  * Copyright (c) 2013-2015, Jetro AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without modification,
9  * are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  * 3. The name of the author may not be used to endorse or promote products
17  * derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONRIBUTORS ``AS IS'' AND ANY EXPRESS
20  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
22  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
28  * OF SUCH DAMAGE.
29  *
30  * This file is part of the EVE platform.
31  */
32 
33 /**
34  * \file
35  * @brief TOC ID compile-time genarator
36  *
37  * @author DT, Jetro AS
38  */ /******************************************************************/
39 
40 #define RAM _
41 #define COMMAND _
42 #define BLE _
43 
44 #ifndef TOC_VAR__PREFIX
45  #error TOC prefix must be set
46 #endif
47 
48 #ifndef CC_CONCAT3
49  #define CC_CONCAT3(a, b, c) CC_CONCAT(a, CC_CONCAT(b, c))
50 #endif
51 
52 #ifndef CC_CONCAT4
53  #define CC_CONCAT4(a, b, c, d) CC_CONCAT(CC_CONCAT(a, b), CC_CONCAT(c, d))
54 #endif
55 
56 #define TOC_VAR_ID(x) CC_CONCAT3(TOC_VAR__PREFIX, __, x)
57 
58 #define TOC_VAR_ID_EX(pfix, name) CC_CONCAT4(TOC_VAR__PREFIX, pfix, _, name)
59 
60 #define TOC_VAR__BASE_ENTRY CC_CONCAT(TOC_VAR__PREFIX, _BASE)
61 
62 #define TOC_STRING_PARAM(name, text, clazz, pfix, ...) \
63  TOC_VAR_ID_EX(pfix, name),
64 
65 #define TOC_BINARY_PARAM(name, text, clazz, pfix, ...) \
66  TOC_VAR_ID_EX(pfix, name),
67 
68 #define TOC_INT_PARAM(name, text, clazz, mmin, mmax, pfix, ...) \
69  TOC_VAR_ID_EX(pfix, name),
70 
71 #define TOC_BOOL_PARAM(name, text, clzz, pfix, ...) \
72  TOC_VAR_ID_EX(pfix, name),
73 
74 #define TOC_STRUCT_PARAM(name, text, clazz, loc, end, pfix, ...) \
75  TOC_VAR_ID_EX(pfix, name),
76 
77 #define TOC_SERVICE(name) \
78  TOC_VAR_ID_EX(SERVICE, name),
79 
80 #define TOC_BEGIN()
81 #define TOC_END()
82 
83 enum
84 {
85  TOC_VAR__BASE_ENTRY = TOC_VAR__BASE - 1,
86  #include EVE_TOC_GEN_H
87 };
88 
89 #undef TOC_STRING_PARAM
90 #undef TOC_BINARY_PARAM
91 #undef TOC_INT_PARAM
92 #undef TOC_BOOL_PARAM
93 #undef TOC_STRUCT_PARAM
94 #undef TOC_SERVICE
95 #undef TOC_BEGIN
96 #undef TOC_END
97 #undef TOC_VAR_PREFIX
98 #undef RAM
99 #undef COMMAND
100 #undef BLE
TOC application API.