1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * (c) 1995-2006 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
14 #include "libgame/libgame.h"
20 #define USE_EXTENDED_VERSION 1
23 char *getCompileDateString()
25 return COMPILE_DATE_STRING;
28 char *getProgramReleaseVersionString()
30 static char program_version_string[32];
32 #if USE_EXTENDED_VERSION
33 sprintf(program_version_string, "%d.%d.%d.%d",
34 PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH,
35 PROGRAM_VERSION_BUILD);
37 sprintf(program_version_string, "%d.%d.%d",
38 PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH);
41 return program_version_string;
44 char *getProgramFullVersionString()
46 static char program_version_string[32];
48 #if USE_EXTENDED_VERSION
49 sprintf(program_version_string, "%d.%d.%d.%d",
50 PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH,
51 PROGRAM_VERSION_BUILD);
53 sprintf(program_version_string, "%d.%d.%d-%d",
54 PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH,
55 PROGRAM_VERSION_BUILD);
58 return program_version_string;
61 char *getProgramVersionString()
64 return getProgramFullVersionString();
66 return getProgramReleaseVersionString();
70 char *getProgramInitString()
72 static char *program_init_string = NULL;
74 if (program_init_string == NULL)
76 program_init_string = checked_malloc(strlen(PROGRAM_TITLE_STRING) + 1 +
77 strlen(getProgramVersionString()) +1 +
78 strlen(TARGET_STRING) + 1);
80 sprintf(program_init_string, "%s %s %s",
81 PROGRAM_TITLE_STRING, getProgramVersionString(), TARGET_STRING);
84 return program_init_string;
87 char *getWindowTitleString()
90 static char *window_title_string = NULL;
92 if (window_title_string == NULL)
94 window_title_string = checked_malloc(strlen(getProgramInitString()) + 1 +
95 strlen(getCompileDateString()) + 2 +1);
97 sprintf(window_title_string, "%s [%s]",
98 getProgramInitString(), getCompileDateString());
101 return window_title_string;
103 return getProgramInitString();