41 pVersionInfo->
rev = 0;
53 pVersionInfo->
major = (encodedVersion >> 24) & 0xFF;
54 pVersionInfo->
minor = (encodedVersion >> 16) & 0xFF;
55 pVersionInfo->
rev = (encodedVersion >> 8) & 0xFF;
56 pVersionInfo->
build = (encodedVersion >> 0) & 0xFF;
107 return encodedVersion;
174 result = pVersionA->
rev - pVersionB->
rev;
236 SBG_ASSERT((pVersionInfo) && (pBuffer) && (sizeOfBuffer>0));
247 if (sizeOfBuffer >= 19)
252 sprintf(pBuffer,
"%u.%u.%u-", pVersionInfo->
major, pVersionInfo->
minor, pVersionInfo->
build);
260 strcat(pBuffer,
"dev");
263 strcat(pBuffer,
"alpha");
266 strcat(pBuffer,
"beta");
269 strcat(pBuffer,
"rc");
272 strcat(pBuffer,
"stable");
275 strcat(pBuffer,
"hotfix");
296 if (sizeOfBuffer >= 16)
301 sprintf(pBuffer,
"%u.%u.%u.%u", pVersionInfo->
major, pVersionInfo->
minor, pVersionInfo->
rev, pVersionInfo->
build);
354 char qualifierStr[32];
368 memset(pVersionInfo, 0x00,
sizeof(
SbgVersion));
373 if (sscanf(pVersionStr,
"%u.%u.%u.%u", &major, &minor, &rev, &build) == 4)
388 else if (sscanf(pVersionStr,
"%u.%u.%u-%s", &major, &minor, &build, qualifierStr) == 4)
405 if (!strcmp(qualifierStr,
"dev"))
412 else if (!strcmp(qualifierStr,
"alpha"))
419 else if (!strcmp(qualifierStr,
"beta"))
426 else if (!strcmp(qualifierStr,
"rc"))
433 else if (!strcmp(qualifierStr,
"stable"))
440 else if (!strcmp(qualifierStr,
"hotfix"))
Helper methods and definitions used to handle version.
void sbgVersionDecode(uint32 encodedVersion, SbgVersion *pVersionInfo)
#define SBG_VERSION_SOFT_SCHEME_QUALIFIER_MASK
#define SBG_VERSION_SOFT_SCHEME_BUILD_SHIFT
#define SBG_VERSION_SOFT_SCHEME_MINOR_SHIFT
SbgErrorCode sbgVersionFromString(const char *pVersionStr, SbgVersion *pVersionInfo)
enum _SbgVersionCmpThresold SbgVersionCmpThresold
#define SBG_VERSION_SOFT_SCHEME_MINOR_MASK
SbgErrorCode sbgVersionToString(const SbgVersion *pVersionInfo, char *pBuffer, uint32 sizeOfBuffer)
uint32 sbgVersionEncode(const SbgVersion *pVersionInfo)
SbgErrorCode sbgVersionToStringEncoded(uint32 version, char *pBuffer, uint32 sizeOfBuffer)
SbgErrorCode sbgVersionFromStringEncoded(const char *pVersionStr, uint32 *pVersion)
#define SBG_VERSION_SOFT_SCHEME_MAJOR_SHIFT
enum _SbgVersionQualifier SbgVersionQualifier
Main header file for SBG Systems common C library.
#define SBG_VERSION_SOFT_SCHEME
int32 sbgVersionCompare(const SbgVersion *pVersionA, const SbgVersion *pVersionB, SbgVersionCmpThresold thresold)
#define SBG_ASSERT(expression)
#define SBG_VERSION_SOFTWARE(major, minor, build, qualifier)
#define SBG_VERSION_SOFT_SCHEME_BUILD_MASK
enum _SbgErrorCode SbgErrorCode
#define SBG_VERSION_BASIC(major, minor, rev, build)
#define SBG_VERSION_SOFT_SCHEME_MAJOR_MASK
SbgVersionQualifier qualifier
#define SBG_VERSION_SOFT_SCHEME_QUALIFIER_SHIFT