diff options
author | Bardur Arantsson <bardur@scientician.net> | 2010-01-10 19:11:13 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2010-01-10 19:32:02 +0100 |
commit | fc7620691b3dff4b502042d889fd75bb85170c16 (patch) | |
tree | 372f8a18d127d06127b51bb3601ffdf97c8bbff8 /src/variable.c | |
parent | 3d46b09fe21dfdea43b0e4e224363ecb67a0fb9b (diff) |
Refactor version string construction to a function.
Diffstat (limited to 'src/variable.c')
-rw-r--r-- | src/variable.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/variable.c b/src/variable.c index 453c5209..8527405f 100644 --- a/src/variable.c +++ b/src/variable.c @@ -1626,3 +1626,21 @@ s32b max_gods = MAX_GODS_INIT; * Timers */ timer_type *gl_timers = NULL; + +/** + * Get the version string. + */ +const char *get_version_string() +{ + static char version_str[80]; + static bool initialized = 0; + if (!initialized) { + sprintf(version_str, "%s %ld.%ld.%ld%s", + game_module, + (long int) VERSION_MAJOR, + (long int) VERSION_MINOR, + (long int) VERSION_PATCH, IS_CVS); + initialized = TRUE; + } + return version_str; +} |