/** * @file version_rc.h * @brief Global version information for eVaf applications and modules * @author Enar Vaikene * * Copyright (c) 2011-2012 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * * This file can be used under the terms of the GNU General Public License * version 3.0 as published by the Free Software Foundation and appearing in * the file LICENSE included in the packaging of this file. Please review the * the following information to ensure the GNU General Public License version * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. * * Alternatively, this file may be used in accordance with the Commercial License * Agreement provided with the Software. */ #ifndef __VERSION_RC_H #define __VERSION_RC_H #include /** * Product's version number in the format major,minor,release */ #ifndef VER_PRODUCT_VERSION # define VER_PRODUCT_VERSION 0,1,1 #endif /** * Product's version number in the human-readable format (shall end with \0) */ #ifndef VER_PRODUCT_VERSION_STR # define VER_PRODUCT_VERSION_STR "0.1.1\0" #endif /** * Product's name (shall end with \0) */ #ifndef VER_PRODUCT_NAME_STR # define VER_PRODUCT_NAME_STR "eVaf\0" #endif /** * Product's release date (shall end with \0) */ #ifndef VER_PRODUCT_DATE_STR # define VER_PRODUCT_DATE_STR "N/A\0" #endif /** * Legal copyright (shall end with \0) */ #ifndef VER_LEGAL_COPYRIGHT_STR # define VER_LEGAL_COPYRIGHT_STR "(C) 2011-2012 Enar Vaikene\0" #endif /** * Name of the company (shall end with \0) */ #ifndef VER_COMPANY_NAME_STR # define VER_COMPANY_NAME_STR "eVaf\0" #endif /** * Generic type for modules. * The string version shall end with \0. */ #define MT_GENERIC 0 #define MT_GENERIC_STR "generic\0" /** * Version info structure for modules. * * All the eVaf modules include this version info structure so that their version numbers, * purposes etc can be retrieved before loading the module. */ struct ModuleVersionInfo { /** * Type of the module. * * This value can be used to group modules by their purpose. For example, if all the communication * modules had the same module type value, then this value can be used to determine, which modules * should be shown in a list of available communication modules. * * The exact meaning of the type is up to the application. Generic modules should use the type * MT_GENERIC. */ uint const type; /** * Name of the module. * * A short name of the module. */ char const * const name; /** * 4-digit version number of the module in the format major,minor,release,build */ uint const version[4]; /** * Human-readable version number of the module. */ char const * const versionStr; /** * Description of the module. * * A longer description explaining the purpose of the module. */ char const * const description; /** * Name of the product. * * If the module is part of a product, then this field holds the name of the product. */ char const * const prodName; /** * 3-digit product version number in the format major,minor,release * * If the module is part of a product, then this field holds the version number * of the product. */ uint const prodVersion[3]; /** * Human-readable product version number of the product. */ char const * const prodVersionStr; /** * Human-readable release date of the product. * * If the module is part of a product, then this field holds the release date * of the product. */ char const * const prodDateStr; /** * Legal copyright. */ char const * const copyright; /** * Name of the company. */ char const * const company; }; #ifndef C_EXTERN_C # ifdef __cplusplus # define C_EXTERN_C extern "C" # else # define C_EXTERN_C # endif #endif /** * Function prototype that returns version information from a module. * * This is a typedef for a pointer to a function with the following signature: * @code * void queryVersionInfo(ModuleVersionInfo **); * @endcode * * Every eVaf module is expected to export this function and the version info shall * be available without any extra initialization. * * The function copies the address of the ModuleVersionInfo structure to the variable at ptr. */ typedef void (* ModuleQueryVersionInfoFunction)(ModuleVersionInfo ** ptr); /** * Macro that exports version information from modules. * * At least the following macros describing the module shall be defined for this macro to work properly: * @li VER_MODULE_TYPE * @li VER_MODULE_NAME_STR * @li VER_FILE_VERSION * @li VER_FILE_VERSION_STR * @li VER_FILE_DESCRIPTION_STR * * Additional macros describing the product are: * @li VER_PRODUCT_NAME_STR * @li VER_PRODUCT_VERSION * @li VER_PRODUCT_VERSION_STR * @li VER_PRODUCT_DATE_STR * * And some legal stuff: * @li VER_LEGAL_COPYRIGHT_STR * @li VER_COMPANY_NAME_STR */ #define VER_EXPORT_VERSION_INFO() \ C_EXTERN_C Q_DECL_EXPORT void moduleQueryVersionInfo(ModuleVersionInfo ** ptr) \ { \ static ModuleVersionInfo ver = { VER_MODULE_TYPE, \ VER_MODULE_NAME_STR, \ { VER_FILE_VERSION }, \ VER_FILE_VERSION_STR, \ VER_FILE_DESCRIPTION_STR, \ VER_PRODUCT_NAME_STR, \ { VER_PRODUCT_VERSION }, \ VER_PRODUCT_VERSION_STR, \ VER_PRODUCT_DATE_STR, \ VER_LEGAL_COPYRIGHT_STR, \ VER_COMPANY_NAME_STR \ }; \ *ptr = &ver; \ } #endif // version_rc.h