| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /*
- mpr-version.h -- Header for the Embedthis Version Library
- Copyright (c) All Rights Reserved. See copyright notice at the bottom of the file.
- */
- #ifndef _h_VERSION
- #define _h_VERSION 1
- /********************************* Includes ***********************************/
- #include "mpr.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- /********************************** Defines ***********************************/
- /**
- Version object
- @description The Version class provides the ability to manage SemVer version numbers
- @defgroup Version Version
- @stability Prototype
- */
- typedef struct MprVersion {
- cchar *full; /**< Original version string */
- cchar *baseVersion; /**< Base version portion without pre-release suffix */
- cchar *preVersion; /**< Pre-release version suffix */
- uint64 numberVersion; /**< Version string as a number (excludes prerelease suffix) */
- int major;
- int minor;
- int patch;
- bool ok; /**< Version is a valid a SemVer */
- } MprVersion;
- PUBLIC cchar *mprBumpVersion(cchar *version);
- MprVersion *mprCreateVersion(cchar *version);
- PUBLIC cchar *mprGetCompatibleVersion(cchar *version);
- PUBLIC int mprGetMajorVersion(cchar *version);
- PUBLIC int mprGetMinorVersion(cchar *version);
- PUBLIC int mprGetPatchVersion(cchar *version);
- PUBLIC cchar *mprGetPrereleaseVersion(cchar *version);
- PUBLIC cchar *mprGetVersionBase(cchar *version);
- PUBLIC int64 mprGetVersionNumber(cchar *version);
- PUBLIC bool mprIsVersionAcceptable(cchar *version, cchar *criteria);
- PUBLIC bool mprIsVersionSame(cchar *version, cchar *other);
- PUBLIC bool mprIsVersionValid(cchar *version);
- PUBLIC void mprSortVersions(MprVersion **versions, ssize nelt, int direction);
- PUBLIC bool mprIsVersionObjAcceptable(MprVersion *vp, cchar *criteria);
- #ifdef __cplusplus
- } /* extern C */
- #endif
- #endif /* _h_VERSION */
- /*
- Copyright (c) Embedthis Software. All Rights Reserved.
- This software is distributed under a commercial license. Consult the LICENSE.md
- distributed with this software for full details and copyrights.
- */
|