49 #define SBG_VERSION_SOFT_SCHEME (0x00000001u << 31) 51 #define SBG_VERSION_SOFT_SCHEME_QUALIFIER_MASK (0x07) 52 #define SBG_VERSION_SOFT_SCHEME_QUALIFIER_SHIFT (28) 54 #define SBG_VERSION_SOFT_SCHEME_MAJOR_MASK (0x3F) 55 #define SBG_VERSION_SOFT_SCHEME_MAJOR_SHIFT (22) 57 #define SBG_VERSION_SOFT_SCHEME_MINOR_MASK (0x3F) 58 #define SBG_VERSION_SOFT_SCHEME_MINOR_SHIFT (16) 60 #define SBG_VERSION_SOFT_SCHEME_BUILD_MASK (0xFFFF) 61 #define SBG_VERSION_SOFT_SCHEME_BUILD_SHIFT (0) 68 typedef enum _SbgVersionQualifier 118 #define SBG_VERSION_BASIC(major, minor, rev, build) ( (((uint32_t)(major)) << 24) | \ 119 (((uint32_t)(minor)) << 16) | \ 120 (((uint32_t)(rev)) << 8) | \ 121 (((uint32_t)(build))) ) 131 #define SBG_VERSION_SOFTWARE(major, minor, build, qualifier) ( SBG_VERSION_SOFT_SCHEME | \ 132 ((((uint32_t)(qualifier)) & SBG_VERSION_SOFT_SCHEME_QUALIFIER_MASK) << SBG_VERSION_SOFT_SCHEME_QUALIFIER_SHIFT) | \ 133 ((((uint32_t)(major)) & SBG_VERSION_SOFT_SCHEME_MAJOR_MASK) << SBG_VERSION_SOFT_SCHEME_MAJOR_SHIFT) | \ 134 ((((uint32_t)(minor)) & SBG_VERSION_SOFT_SCHEME_MINOR_MASK) << SBG_VERSION_SOFT_SCHEME_MINOR_SHIFT) | \ 135 ((((uint32_t)(build)) & SBG_VERSION_SOFT_SCHEME_BUILD_MASK) << SBG_VERSION_SOFT_SCHEME_BUILD_SHIFT) ) 326 return versionInfo.
major;
347 return versionInfo.
minor;
368 return versionInfo.
rev;
389 return (uint8_t)versionInfo.
build;
struct _SbgVersion SbgVersion
#define SBG_COMMON_LIB_API
SBG_COMMON_LIB_API SbgErrorCode sbgVersionFromString(const char *pVersionStr, SbgVersion *pVersionInfo)
SBG_INLINE bool sbgVersionIsUsingSoftwareScheme(uint32_t encodedVersion)
SBG_INLINE uint8_t SBG_VERSION_GET_MAJOR(uint32_t encodedVersion)
SBG_COMMON_LIB_API SbgErrorCode sbgVersionToStringEncoded(uint32_t version, char *pBuffer, uint32_t sizeOfBuffer)
SBG_COMMON_LIB_API int32_t sbgVersionCompareEncoded(uint32_t versionA, uint32_t versionB, SbgVersionCmpThresold thresold)
SBG_COMMON_LIB_API SbgErrorCode sbgVersionFromStringEncoded(const char *pVersionStr, uint32_t *pVersion)
enum _SbgVersionCmpThresold SbgVersionCmpThresold
SBG_COMMON_LIB_API int32_t sbgVersionIsWithinRange(const SbgVersion *pLowerVersion, const SbgVersion *pHigherVersion, const SbgVersion *pVersion)
SBG_COMMON_LIB_API int32_t sbgVersionCompare(const SbgVersion *pVersionA, const SbgVersion *pVersionB, SbgVersionCmpThresold thresold)
SBG_INLINE uint8_t SBG_VERSION_GET_REV(uint32_t encodedVersion)
SBG_DEPRECATED(SBG_INLINE uint32_t SBG_VERSION(uint8_t major, uint8_t minor, uint8_t rev, uint8_t build))
enum _SbgVersionQualifier SbgVersionQualifier
Main header file for SBG Systems common C library.
SBG_COMMON_LIB_API int32_t sbgVersionIsWithinRangeEncoded(uint32_t lowerVersion, uint32_t higherVersion, uint32_t version)
SBG_COMMON_LIB_API SbgErrorCode sbgVersionToString(const SbgVersion *pVersionInfo, char *pBuffer, uint32_t sizeOfBuffer)
SBG_COMMON_LIB_API void sbgVersionDecode(uint32_t encodedVersion, SbgVersion *pVersionInfo)
SBG_INLINE uint8_t SBG_VERSION_GET_MINOR(uint32_t encodedVersion)
SBG_COMMON_LIB_API uint32_t sbgVersionEncode(const SbgVersion *pVersionInfo)
SBG_INLINE uint32_t SBG_VERSION(uint8_t major, uint8_t minor, uint8_t rev, uint8_t build)
enum _SbgErrorCode SbgErrorCode
#define SBG_VERSION_BASIC(major, minor, rev, build)
SbgVersionQualifier qualifier
SBG_INLINE uint8_t SBG_VERSION_GET_BUILD(uint32_t encodedVersion)