3 * @brief Global version information for eVaf applications and modules
6 * Copyright (c) 2011-2012 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
23 #include <QtCore/qglobal.h>
26 * Product's version number in the format major,minor,release
28 #ifndef VER_PRODUCT_VERSION
29 # define VER_PRODUCT_VERSION 0,1,1
33 * Product's version number in the human-readable format (shall end with \0)
35 #ifndef VER_PRODUCT_VERSION_STR
36 # define VER_PRODUCT_VERSION_STR "0.1.1\0"
40 * Product's name (shall end with \0)
42 #ifndef VER_PRODUCT_NAME_STR
43 # define VER_PRODUCT_NAME_STR "eVaf\0"
47 * Product's release date (shall end with \0)
49 #ifndef VER_PRODUCT_DATE_STR
50 # define VER_PRODUCT_DATE_STR "N/A\0"
54 * Legal copyright (shall end with \0)
56 #ifndef VER_LEGAL_COPYRIGHT_STR
57 # define VER_LEGAL_COPYRIGHT_STR "(C) 2011-2012 Enar Vaikene\0"
61 * Name of the company (shall end with \0)
63 #ifndef VER_COMPANY_NAME_STR
64 # define VER_COMPANY_NAME_STR "eVaf\0"
68 * Generic type for modules.
69 * The string version shall end with \0.
72 #define MT_GENERIC_STR "generic\0"
75 * Version info structure for modules.
77 * All the eVaf modules include this version info structure so that their version numbers,
78 * purposes etc can be retrieved before loading the module.
80 struct ModuleVersionInfo
85 * This value can be used to group modules by their purpose. For example, if all the communication
86 * modules had the same module type value, then this value can be used to determine, which modules
87 * should be shown in a list of available communication modules.
89 * The exact meaning of the type is up to the application. Generic modules should use the type
97 * A short name of the module.
99 char const * const name
;
102 * 4-digit version number of the module in the format major,minor,release,build
104 uint
const version
[4];
107 * Human-readable version number of the module.
109 char const * const versionStr
;
112 * Description of the module.
114 * A longer description explaining the purpose of the module.
116 char const * const description
;
119 * Name of the product.
121 * If the module is part of a product, then this field holds the name of the product.
123 char const * const prodName
;
126 * 3-digit product version number in the format major,minor,release
128 * If the module is part of a product, then this field holds the version number
131 uint
const prodVersion
[3];
134 * Human-readable product version number of the product.
136 char const * const prodVersionStr
;
139 * Human-readable release date of the product.
141 * If the module is part of a product, then this field holds the release date
144 char const * const prodDateStr
;
149 char const * const copyright
;
152 * Name of the company.
154 char const * const company
;
160 # define C_EXTERN_C extern "C"
167 * Function prototype that returns version information from a module.
169 * This is a typedef for a pointer to a function with the following signature:
171 * void queryVersionInfo(ModuleVersionInfo **);
174 * Every eVaf module is expected to export this function and the version info shall
175 * be available without any extra initialization.
177 * The function copies the address of the ModuleVersionInfo structure to the variable at ptr.
179 typedef void (* ModuleQueryVersionInfoFunction
)(ModuleVersionInfo
** ptr
);
182 * Macro that exports version information from modules.
184 * At least the following macros describing the module shall be defined for this macro to work properly:
185 * @li VER_MODULE_TYPE
186 * @li VER_MODULE_NAME_STR
187 * @li VER_FILE_VERSION
188 * @li VER_FILE_VERSION_STR
189 * @li VER_FILE_DESCRIPTION_STR
191 * Additional macros describing the product are:
192 * @li VER_PRODUCT_NAME_STR
193 * @li VER_PRODUCT_VERSION
194 * @li VER_PRODUCT_VERSION_STR
195 * @li VER_PRODUCT_DATE_STR
197 * And some legal stuff:
198 * @li VER_LEGAL_COPYRIGHT_STR
199 * @li VER_COMPANY_NAME_STR
201 #define VER_EXPORT_VERSION_INFO() \
202 C_EXTERN_C Q_DECL_EXPORT void moduleQueryVersionInfo(ModuleVersionInfo ** ptr) \
204 static ModuleVersionInfo ver = { VER_MODULE_TYPE, \
205 VER_MODULE_NAME_STR, \
206 { VER_FILE_VERSION }, \
207 VER_FILE_VERSION_STR, \
208 VER_FILE_DESCRIPTION_STR, \
209 VER_PRODUCT_NAME_STR, \
210 { VER_PRODUCT_VERSION }, \
211 VER_PRODUCT_VERSION_STR, \
212 VER_PRODUCT_DATE_STR, \
213 VER_LEGAL_COPYRIGHT_STR, \
214 VER_COMPANY_NAME_STR \
219 #endif // version_rc.h