// ----------------------------------------------------------------------------- /// @file Version.c /// @brief Description // ----------------------------------------------------------------------------- // Micro-Key bv // Industrieweg 28, 9804 TG Noordhorn // Postbus 92, 9800 AB Zuidhorn // The Netherlands // Tel: +31 594 503020 // Fax: +31 594 505825 // Email: support@microkey.nl // Web: www.microkey.nl // ----------------------------------------------------------------------------- /// $Revision$ /// $Author$ /// $Date$ // (c) 2017 Micro-Key bv // ----------------------------------------------------------------------------- /// @file Version.c /// @ingroup {group_name} // ----------------------------------------------------------------------------- // Include files // ----------------------------------------------------------------------------- #include "Version.h" // ----------------------------------------------------------------------------- // Constant and macro definitions // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // Type definitions // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // File-scope variables // ----------------------------------------------------------------------------- static struct Version* instance = NULL; static struct Version thisVersion; // ----------------------------------------------------------------------------- // Function declarations // ----------------------------------------------------------------------------- static ErrorStatus Version_construct(struct Version* self); // ----------------------------------------------------------------------------- // Function definitions // ----------------------------------------------------------------------------- struct Version* Version_getInstance(void) { ErrorStatus returnValue = SUCCESS; if (instance == NULL) { instance = &thisVersion; returnValue = Version_construct(instance); if (returnValue != SUCCESS) { instance = NULL; } } return instance; } static ErrorStatus Version_construct(struct Version* self) { ErrorStatus returnValue = SUCCESS; self->major = RELEASE_MAJOR; self->minor = RELEASE_MINOR; self->branch = RELEASE_BRANCH; self->patch = RELEASE_PATCH; return returnValue; }