Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bpm-sw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
bpm
bpm-sw
Commits
38a3ed06
Commit
38a3ed06
authored
Jun 18, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
{include,src/revision}/*: add build version functions
parent
4575640c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
1 deletion
+61
-1
revision.h
include/revision.h
+18
-0
revision.c
src/revision/revision.c
+43
-1
No files found.
include/revision.h
View file @
38a3ed06
...
...
@@ -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
}
...
...
src/revision/revision.c
View file @
38a3ed06
...
...
@@ -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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment