- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppStats/src/ppStatsVersion.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/ppStats/src/ppStatsVersion.c
r13993 r23352 1 1 #include "ppStatsInternal.h" 2 2 3 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name 3 #ifndef PPSTATS_VERSION 4 #error "PPSTATS_VERSION is not set" 5 #endif 6 #ifndef PPSTATS_BRANCH 7 #error "PPSTATS_BRANCH is not set" 8 #endif 9 #ifndef PPSTATS_SOURCE 10 #error "PPSTATS_SOURCE is not set" 11 #endif 12 13 #define xstr(s) str(s) 14 #define str(s) #s 4 15 5 16 psString ppStatsVersion(void) 6 17 { 7 psString version = NULL; // Version, to return 8 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 9 return version; 18 char *value = NULL; 19 psStringAppend(&value, "%s@%s", xstr(PPSTATS_BRANCH), xstr(PPSTATS_VERSION)); 20 return value; 21 } 22 23 psString ppStatsSource(void) 24 { 25 return psStringCopy(xstr(PPSTATS_SOURCE)); 10 26 } 11 27 12 28 psString ppStatsVersionLong(void) 13 29 { 14 psString version = ppStatsVersion(); // Version, to return 15 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 16 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); 17 psFree(tag); 30 psString version = ppStatsVersion(); // Version, to return 31 psString source = ppStatsSource(); // Source 32 33 psStringPrepend(&version, "ppStats "); 34 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 35 psFree(source); 36 37 #ifdef __OPTIMIZE__ 38 psStringAppend(&version, " optimised"); 39 #else 40 psStringAppend(&version, " unoptimised"); 41 #endif 42 18 43 return version; 44 }; 45 46 bool ppStatsVersionHeader(psMetadata *header) 47 { 48 PS_ASSERT_METADATA_NON_NULL(header, false); 49 50 psString version = ppStatsVersion(); // Software version 51 psString source = ppStatsSource(); // Software source 52 53 psStringPrepend(&version, "ppStats version: "); 54 psStringPrepend(&source, "ppStats source: "); 55 56 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, version); 57 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, source); 58 59 psFree(version); 60 psFree(source); 61 62 return true; 19 63 }
Note:
See TracChangeset
for help on using the changeset viewer.
