Commit 38a3ed06 authored by Lucas Russo's avatar Lucas Russo

{include,src/revision}/*: add build version functions

parent 4575640c
......@@ -16,6 +16,7 @@ extern const char *build_revision;
extern const char *build_date;
extern const char *build_user_name;
extern const char *build_user_email;
extern const char *build_version;
/* Clone the build revision. Returns the cloned string is successfully or NULL
* on error */
......@@ -23,6 +24,8 @@ char *revision_clone_build_revision (void);
/* Copies the build revision into a pre-allocated buffer. Returns a negative number
* on error and the number of copied bytes otherwise */
int revision_copy_build_revision (char *dest, size_t size);
/* Returns a const reference to build revision */
const char *revision_get_build_revision (void);
/* Clone the build date. Returns the cloned string is successfully or NULL
* on error */
......@@ -30,6 +33,8 @@ char *revision_clone_build_date (void);
/* Copies the build date into a pre-allocated buffer. Returns a negative number
* on error and the number of copied bytes otherwise */
int revision_copy_build_date (char *dest, size_t size);
/* Returns a const reference to build version */
const char *revision_get_build_date (void);
/* Clone the build user name. Returns the cloned string is successfully or NULL
* on error */
......@@ -37,6 +42,8 @@ char *revision_clone_build_user_name (void);
/* Copies the build user name into a pre-allocated buffer. Returns a negative number
* on error and the number of copied bytes otherwise */
int revision_copy_build_user_name (char *dest, size_t size);
/* Returns a const reference to build user name */
const char *revision_get_build_user_name (void);
/* Clone the build user email. Returns the cloned string is successfully or NULL
* on error */
......@@ -44,6 +51,17 @@ char *revision_clone_build_user_email (void);
/* Copies the build user email into a pre-allocated buffer. Returns a negative number
* on error and the number of copied bytes otherwise */
int revision_copy_build_user_email (char *dest, size_t size);
/* Returns a const reference to build user email */
const char *revision_get_build_user_email (void);
/* Clone the build version. Returns the cloned string is successfully or NULL
* on error */
char *revision_clone_build_version (void);
/* Copies the build version into a pre-allocated buffer. Returns a negative number
* on error and the number of copied bytes otherwise */
int revision_copy_build_version (char *dest, size_t size);
/* Returns a const reference to build version */
const char *revision_get_build_version (void);
#ifdef __cplusplus
}
......
......@@ -11,8 +11,11 @@ const char *build_revision = GIT_REVISION;
const char *build_date = __DATE__ " " __TIME__;
const char *build_user_name = GIT_USER_NAME;
const char *build_user_email = GIT_USER_EMAIL;
const char *build_version = BPM_VERSION_MAJOR_STR"."BPM_VERSION_MINOR_STR"."BPM_VERSION_PATCH_STR;
char *revision_clone_build_rev (void)
/************************* Clone functions ***********************************/
char *revision_clone_build_revision (void)
{
return hutils_clone_str (build_revision);
}
......@@ -32,6 +35,40 @@ char *revision_clone_build_user_email (void)
return hutils_clone_str (build_user_email);
}
char *revision_clone_build_version (void)
{
return hutils_clone_str (build_version);
}
/************************* Get Const functions ********************************/
const char *revision_get_build_revision (void)
{
return build_revision;
}
const char *revision_get_build_date (void)
{
return build_date;
}
const char *revision_get_build_user_name (void)
{
return build_user_name;
}
const char *revision_get_build_user_email (void)
{
return build_user_email;
}
const char *revision_get_build_version (void)
{
return build_version;
}
/*************************** Copy functions **********************************/
int revision_copy_build_revision (char *dest, size_t size)
{
return hutils_copy_str (dest, build_revision, size);
......@@ -51,3 +88,8 @@ int revision_copy_build_user_email (char *dest, size_t size)
{
return hutils_copy_str (dest, build_user_email, size);
}
int revision_copy_build_version (char *dest, size_t size)
{
return hutils_copy_str (dest, build_version, size);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment