diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-12-03 13:55:47 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-12-03 13:55:47 +0000 |
commit | 6b112e7c0d44cc89949c13a2c60f8dd83a14758e (patch) | |
tree | 41abcc4bd10163a16cf081408d238e9f23cbb5c0 /src/datestamp.c | |
parent | deb435450d8b449db32c988d5fa3c83a6bb9e8d4 (diff) |
Fix CCTK_CompileDate() to return the day as a 2-digit number. This makes this
routine return a format consistent with CCTK_CurrentDate().
Closes PR Cactus/822.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2473 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/datestamp.c')
-rw-r--r-- | src/datestamp.c | 82 |
1 files changed, 52 insertions, 30 deletions
diff --git a/src/datestamp.c b/src/datestamp.c index fb71f08a..5b070b4d 100644 --- a/src/datestamp.c +++ b/src/datestamp.c @@ -3,9 +3,9 @@ @date Mon May 11 10:20:58 1998 @author Paul Walker @desc - + Functions to return the Cactus compile time and version. @enddesc - #version $Header$ + #version $Id$ @@*/ #include <stdio.h> @@ -19,60 +19,68 @@ const char *CCTKi_version_src_datestamp_c(void); const char *CCTKi_version_src_datestamp_c(void) { return rcsid; } /*@@ - @routine CCTKi_DataStamp + @routine CCTKi_DateStamp @date Mon May 11 10:20:58 1998 @author Paul Walker @desc - + Prints the date stamp when Cactus was compiled + as a formatted string to stdout. @enddesc - @calls - @calledby - @history - - @endhistory - @@*/ -void CCTKi_DateStamp(void) +void CCTKi_DateStamp (void) { printf (" Compiled on %s at %s\n", __DATE__, __TIME__); } + /*@@ @routine CCTK_CompileTime @date Mon May 11 10:20:58 1998 @author Paul Walker @desc - + Returns a pointer to a formatted string with the time stamp + when Cactus was compiled. @enddesc - @calls - @calledby - @history - - @endhistory + @returntype const char * + @returndesc + pointer to the static time stamp string buffer + @endreturndesc @@*/ -const char *CCTK_CompileTime(void) +const char *CCTK_CompileTime (void) { return (__TIME__); } + /*@@ @routine CCTK_CompileDate @date Mon May 11 10:20:58 1998 @author Paul Walker @desc - + Returns a pointer to a formatted string with the date stamp + when Cactus was compiled. @enddesc - @calls - @calledby - @history - - @endhistory + @returntype const char * + @returndesc + pointer to the static date stamp string buffer + @endreturndesc @@*/ -const char *CCTK_CompileDate(void) +const char *CCTK_CompileDate (void) { - return (__DATE__); + static char date[sizeof (__DATE__) + 1]; + + + /* make the day really a 2-digit number to be consistent with + CCTK_CurrentDate() */ + strcpy (date, __DATE__); + if (date[4] == ' ') + { + date[4] = '0'; + } + + return (date); } @@ -83,22 +91,36 @@ const char *CCTK_CompileDate(void) #define REALSTRINGIFY(a) #a -const char *CCTK_FullVersion(void) + /*@@ + @routine CCTK_FullVersion CCTK_MajorVersion CCTK_MinorVersion + @date Mon May 11 10:20:58 1998 + @author Paul Walker + @desc + Returns a pointer to a formatted string with the current Cactus + version. + @enddesc + + @returntype const char * + @returndesc + pointer to the static version string buffer + @endreturndesc +@@*/ +const char *CCTK_FullVersion (void) { return (STRINGIFY(CCTK_VERSION)); } -const char *CCTK_MajorVersion(void) +const char *CCTK_MajorVersion (void) { return (STRINGIFY(CCTK_VERSION_MAJOR)); } -const char *CCTK_MinorVersion(void) +const char *CCTK_MinorVersion (void) { return (STRINGIFY(CCTK_VERSION_MINOR)); } -const char *CCTK_MicroVersion(void) +const char *CCTK_MicroVersion (void) { return (STRINGIFY(CCTK_VERSION_OTHER)); } |