3 * @brief Global version information for eVaf applications and modules
6 * Copyright (c) 2011 Enar Vaikene
8 * This file is part of the eVaf C++ cross-platform application development framework.
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
20 #ifndef __VERSION_RC_H
21 #define __VERSION_RC_H
24 * Product's version number in the format major,minor,release
26 #ifndef VER_PRODUCT_VERSION
27 # define VER_PRODUCT_VERSION 0,1,1
31 * Product's version number in the human-readable format (shall end with \0)
33 #ifndef VER_PRODUCT_VERSION_STR
34 # define VER_PRODUCT_VERSION_STR "0.1.1\0"
38 * Product's name (shall end with \0)
40 #ifndef VER_PRODUCT_NAME_STR
41 # define VER_PRODUCT_NAME_STR "eVaf\0"
45 * Product's release date (shall end with \0)
47 #ifndef VER_PRODUCT_DATE_STR
48 # define VER_PRODUCT_DATE_STR "N/A\0"
52 * Legal copyright (shall end with \0)
54 #ifndef VER_LEGAL_COPYRIGHT_STR
55 # define VER_LEGAL_COPYRIGHT_STR "(C) 2011 Enar Vaikene\0"
59 * Name of the company (shall end with \0)
61 #ifndef VER_COMPANY_NAME_STR
62 # define VER_COMPANY_NAME_STR "N/A\0"
66 * Generic type for modules.
67 * The string version shall end with \0.
70 #define MT_GENERIC_STR "generic\0"
73 * Version info structure for modules.
75 * All the eVaf modules include this version info structure so that their version numbers,
76 * purposes etc can be retrieved before loading the module.
78 struct ModuleVersionInfo
83 * This value can be used to group modules by their purpose. For example, if all the communication
84 * modules had the same module type value, then this value can be used to determine, which modules
85 * should be shown in a list of available communication modules.
87 * The exact meaning of the type is up to the application. Generic modules should use the type
95 * A short name of the module.
97 char const * const name
;
100 * 4-digit version number of the module in the format major,minor,release,build
102 uint
const version
[4];
105 * Human-readable version number of the module.
107 char const * const versionStr
;
110 * Description of the module.
112 * A longer description explaining the purpose of the module.
114 char const * const description
;
117 * Name of the product.
119 * If the module is part of a product, then this field holds the name of the product.
121 char const * const prodName
;
124 * 3-digit product version number in the format major,minor,release
126 * If the module is part of a product, then this field holds the version number
129 uint
const prodVersion
[3];
132 * Human-readable product version number of the product.
134 char const * const prodVersionStr
;
137 * Human-readable release date of the product.
139 * If the module is part of a product, then this field holds the release date
142 char const * const prodDateStr
;
147 char const * const copyright
;
150 * Name of the company.
152 char const * const company
;
158 # define C_EXTERN_C extern "C"
165 * Function prototype that returns version information from a module.
167 * This is a typedef for a pointer to a function with the following signature:
169 * void queryVersionInfo(ModuleVersionInfo **);
172 * Every eVaf module is expected to export this function and the version info shall
173 * be available without any extra initialization.
175 * The function copies the address of the ModuleVersionInfo structure to the variable at ptr.
177 typedef void (* ModuleQueryVersionInfoFunction
)(ModuleVersionInfo
** ptr
);
180 * Macro that exports version information from modules.
182 * At least the following macros describing the module shall be defined for this macro to work properly:
183 * @li VER_MODULE_TYPE
184 * @li VER_MODULE_NAME_STR
185 * @li VER_FILE_VERSION
186 * @li VER_FILE_VERSION_STR
187 * @li VER_FILE_DESCRIPTION_STR
189 * Additional macros describing the product are:
190 * @li VER_PRODUCT_NAME_STR
191 * @li VER_PRODUCT_VERSION
192 * @li VER_PRODUCT_VERSION_STR
193 * @li VER_PRODUCT_DATE_STR
195 * And some legal stuff:
196 * @li VER_LEGAL_COPYRIGHT_STR
197 * @li VER_COMPANY_NAME_STR
199 #define VER_EXPORT_VERSION_INFO() \
200 C_EXTERN_C Q_DECL_EXPORT void moduleQueryVersionInfo(ModuleVersionInfo ** ptr) \
202 static ModuleVersionInfo ver = { VER_MODULE_TYPE, \
203 VER_MODULE_NAME_STR, \
204 { VER_FILE_VERSION }, \
205 VER_FILE_VERSION_STR, \
206 VER_FILE_DESCRIPTION_STR, \
207 VER_PRODUCT_NAME_STR, \
208 { VER_PRODUCT_VERSION }, \
209 VER_PRODUCT_VERSION_STR, \
210 VER_PRODUCT_DATE_STR, \
211 VER_LEGAL_COPYRIGHT_STR, \
212 VER_COMPANY_NAME_STR \
217 #endif // version_rc.h