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;
75 // do not display compile target anymore, as it is almost always "SDL" now
76 if (program_init_string == NULL)
78 program_init_string = checked_malloc(strlen(PROGRAM_TITLE_STRING) + 1 +
79 strlen(getProgramVersionString()) + 1);
81 sprintf(program_init_string, "%s %s",
82 PROGRAM_TITLE_STRING, getProgramVersionString());
85 if (program_init_string == NULL)
87 program_init_string = checked_malloc(strlen(PROGRAM_TITLE_STRING) + 1 +
88 strlen(getProgramVersionString()) + 1 +
89 strlen(TARGET_STRING) + 1);
91 sprintf(program_init_string, "%s %s %s",
92 PROGRAM_TITLE_STRING, getProgramVersionString(), TARGET_STRING);
96 return program_init_string;
99 char *getWindowTitleString()
102 static char *window_title_string = NULL;
104 if (window_title_string == NULL)
106 window_title_string = checked_malloc(strlen(getProgramInitString()) + 1 +
107 strlen(getCompileDateString()) + 2 +1);
109 sprintf(window_title_string, "%s [%s]",
110 getProgramInitString(), getCompileDateString());
113 return window_title_string;
115 return getProgramInitString();