Arbiter
Dependency manager library that supports decentralization
|
Go to the source code of this file.
Functions | |
int | ArbiterCompareVersionOrdering (const ArbiterSemanticVersion *lhs, const ArbiterSemanticVersion *rhs) |
Orders two semantic versions relative to each other. More... | |
ArbiterSelectedVersion * | ArbiterCreateSelectedVersion (const ArbiterSemanticVersion *semanticVersion, ArbiterUserValue metadata) |
Creates a selected version which corresponds to the given semantic version. More... | |
ArbiterSelectedVersionList * | ArbiterCreateSelectedVersionList (const ArbiterSelectedVersion *const *versions, size_t count) |
Creates a version list which wraps a C array of ArbiterSelectedVersion objects. More... | |
ArbiterSemanticVersion * | ArbiterCreateSemanticVersion (unsigned major, unsigned minor, unsigned patch, const char *prereleaseVersion, const char *buildMetadata) |
Creates a semantic version with the given components. More... | |
ArbiterSemanticVersion * | ArbiterCreateSemanticVersionFromString (const char *string) |
Attempts to parse the given NUL-terminated string into a semantic version, returning NULL if a parse failure occurs. More... | |
const char * | ArbiterGetBuildMetadata (const ArbiterSemanticVersion *version) |
Returns the build metadata string from a semantic version, or NULL if there is not one associated with the version. More... | |
unsigned | ArbiterGetMajorVersion (const ArbiterSemanticVersion *version) |
Returns the major version number (X.y.z) from a semantic version. More... | |
unsigned | ArbiterGetMinorVersion (const ArbiterSemanticVersion *version) |
Returns the minor version number (x.Y.z) from a semantic version. More... | |
unsigned | ArbiterGetPatchVersion (const ArbiterSemanticVersion *version) |
Returns the patch version number (x.y.Z) from a semantic version. More... | |
const char * | ArbiterGetPrereleaseVersion (const ArbiterSemanticVersion *version) |
Returns the prerelease version string from a semantic version, or NULL if there is not one associated with the version. More... | |
const void * | ArbiterSelectedVersionMetadata (const ArbiterSelectedVersion *version) |
Returns any metadata pointer which was provided to ArbiterCreateSelectedVersion(). More... | |
const ArbiterSemanticVersion * | ArbiterSelectedVersionSemanticVersion (const ArbiterSelectedVersion *version) |
Returns the semantic version which corresponds to the given selected version, or NULL if there is no semantic version component. More... | |
int ArbiterCompareVersionOrdering | ( | const ArbiterSemanticVersion * | lhs, |
const ArbiterSemanticVersion * | rhs | ||
) |
Orders two semantic versions relative to each other.
Returns -1 if lhs
is less than rhs
, 1 if lhs
is greater than rhs
, or 0 if the two versions have the same precedence (which may be the case even if their build metadata differs).
ArbiterSelectedVersion* ArbiterCreateSelectedVersion | ( | const ArbiterSemanticVersion * | semanticVersion, |
ArbiterUserValue | metadata | ||
) |
Creates a selected version which corresponds to the given semantic version.
semanticVersion
may be NULL to represent a selected version that has metadata but no semantic version component; for example, to use with ArbiterCreateRequirementUnversioned().
The returned version must be freed with ArbiterFree().
ArbiterSelectedVersionList* ArbiterCreateSelectedVersionList | ( | const ArbiterSelectedVersion *const * | versions, |
size_t | count | ||
) |
Creates a version list which wraps a C array of ArbiterSelectedVersion objects.
The objects in the C array can be safely freed after calling this function.
The returned list must be freed with ArbiterFree().
ArbiterSemanticVersion* ArbiterCreateSemanticVersion | ( | unsigned | major, |
unsigned | minor, | ||
unsigned | patch, | ||
const char * | prereleaseVersion, | ||
const char * | buildMetadata | ||
) |
Creates a semantic version with the given components.
The returned version must be freed with ArbiterFree().
ArbiterSemanticVersion* ArbiterCreateSemanticVersionFromString | ( | const char * | string | ) |
Attempts to parse the given NUL-terminated string into a semantic version, returning NULL if a parse failure occurs.
The returned version must be freed with ArbiterFree().
const char* ArbiterGetBuildMetadata | ( | const ArbiterSemanticVersion * | version | ) |
Returns the build metadata string from a semantic version, or NULL if there is not one associated with the version.
For example, in the version 1.0.0+20160814
, the build metadata string will be 20160814
.
The returned pointer is only guaranteed to remain valid for the current scope.
unsigned ArbiterGetMajorVersion | ( | const ArbiterSemanticVersion * | version | ) |
Returns the major version number (X.y.z) from a semantic version.
unsigned ArbiterGetMinorVersion | ( | const ArbiterSemanticVersion * | version | ) |
Returns the minor version number (x.Y.z) from a semantic version.
unsigned ArbiterGetPatchVersion | ( | const ArbiterSemanticVersion * | version | ) |
Returns the patch version number (x.y.Z) from a semantic version.
const char* ArbiterGetPrereleaseVersion | ( | const ArbiterSemanticVersion * | version | ) |
Returns the prerelease version string from a semantic version, or NULL if there is not one associated with the version.
For example, in the version 1.0.0-alpha.1
, the prerelease version string will be alpha.1
.
The returned pointer is only guaranteed to remain valid for the current scope.
const void* ArbiterSelectedVersionMetadata | ( | const ArbiterSelectedVersion * | version | ) |
Returns any metadata pointer which was provided to ArbiterCreateSelectedVersion().
The returned pointer is only guaranteed to remain valid for the current scope.
const ArbiterSemanticVersion* ArbiterSelectedVersionSemanticVersion | ( | const ArbiterSelectedVersion * | version | ) |
Returns the semantic version which corresponds to the given selected version, or NULL if there is no semantic version component.
The returned pointer is only guaranteed to remain valid for the current scope.