Functions
sbgVersion.c File Reference
#include "sbgVersion.h"
#include <sbgCommon.h>
Include dependency graph for sbgVersion.c:

Go to the source code of this file.

Functions

int32 sbgVersionCompare (const SbgVersion *pVersionA, const SbgVersion *pVersionB, SbgVersionCmpThresold thresold)
 
void sbgVersionDecode (uint32 encodedVersion, SbgVersion *pVersionInfo)
 
uint32 sbgVersionEncode (const SbgVersion *pVersionInfo)
 
SbgErrorCode sbgVersionFromString (const char *pVersionStr, SbgVersion *pVersionInfo)
 
SbgErrorCode sbgVersionFromStringEncoded (const char *pVersionStr, uint32 *pVersion)
 
SbgErrorCode sbgVersionToString (const SbgVersion *pVersionInfo, char *pBuffer, uint32 sizeOfBuffer)
 
SbgErrorCode sbgVersionToStringEncoded (uint32 version, char *pBuffer, uint32 sizeOfBuffer)
 

Function Documentation

int32 sbgVersionCompare ( const SbgVersion pVersionA,
const SbgVersion pVersionB,
SbgVersionCmpThresold  thresold 
)

Compare two version information structures and return if the version A is greater, less or equal than the version B. The computation is roughly result = version A - version B We can define how far we will check if the version A is greater than the version B. For example, we can only check the major or major and minor fields.

Parameters
[in]pVersionAThe first version to compare.
[in]pVersionBThe second version to compare.
[in]thresoldThe comparaison thresold to know if we are checking the major, minor, revision, build, ...
Returns
A positive value if the version A is greater than B, a negative one if version A is less than B and 0 if the two versions are the same (according to the thresold).

Definition at line 124 of file sbgVersion.c.

void sbgVersionDecode ( uint32  encodedVersion,
SbgVersion pVersionInfo 
)

Fill a SbgVersion structure based on an uint32 that stores the 'compiled' version information.

Parameters
[in]encodedVersionThe version information stored within a uint32.
[out]pVersionInfoPointer on an allocated SbgVersion structure to fill.

Definition at line 13 of file sbgVersion.c.

uint32 sbgVersionEncode ( const SbgVersion pVersionInfo)

Construct a uint32 containing a version information based on a SbgVersion structure.

Parameters
[in]pVersionInfoPointer on a read only version structure to encode.
Returns
The encoded version information on an uint32 or 0 if an error has occurred.

Definition at line 70 of file sbgVersion.c.

SbgErrorCode sbgVersionFromString ( const char *  pVersionStr,
SbgVersion pVersionInfo 
)

Convert a human readable string to a version structure.

Parameters
[in]pVersionStrThe string containing the version to convert.
[out]pVersionInfoPointer to a version structure to store the parsed version info.
Returns
SBG_NO_ERROR if the version information has been converted from a string.

Definition at line 351 of file sbgVersion.c.

SbgErrorCode sbgVersionFromStringEncoded ( const char *  pVersionStr,
uint32 pVersion 
)

Convert an encoded version number to a human readable string.

Parameters
[in]pVersionStrThe string containing the version to convert.
[out]pVersionReturned encoded version value parsed from the string.
Returns
SBG_NO_ERROR if the version information has been converted from a string.

Definition at line 472 of file sbgVersion.c.

SbgErrorCode sbgVersionToString ( const SbgVersion pVersionInfo,
char *  pBuffer,
uint32  sizeOfBuffer 
)

Convert a version information to a human readable string.

Parameters
[in]pVersionInfoPointer on a read only version structure to convert to a human readable string.
[out]pBufferBuffer to store the version as a human readable null terminated string.
[in]sizeOfBufferMaximum buffer size including the null terminated char.
Returns
SBG_NO_ERROR if the version information has been converted to a string. SBG_BUFFER_OVERFLOW is the buffer isn't big enough to store the converted version string.

Definition at line 229 of file sbgVersion.c.

SbgErrorCode sbgVersionToStringEncoded ( uint32  version,
char *  pBuffer,
uint32  sizeOfBuffer 
)

Convert an encoded version number to a human readable string.

Parameters
[in]versionEncoded version value to to convert to a human readable string.
[out]pBufferBuffer to store the version as a human readable null terminated string.
[in]sizeOfBufferMaximum buffer size including the null terminated char.
Returns
SBG_NO_ERROR if the version information has been converted to a string. SBG_BUFFER_OVERFLOW is the buffer isn't big enough to store the converted version string.

Definition at line 326 of file sbgVersion.c.



sbg_driver
Author(s):
autogenerated on Sun Jan 27 2019 03:42:20