Changeset 10286
- Timestamp:
- Nov 29, 2006, 11:33:09 AM (20 years ago)
- Location:
- trunk/psLib/src/sys
- Files:
-
- 4 edited
-
psConfigure.c (modified) (2 diffs)
-
psConfigure.h (modified) (2 diffs)
-
psString.c (modified) (2 diffs)
-
psString.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psConfigure.c
r10284 r10286 13 13 * @author Robert DeSonia, MHPCC 14 14 * 15 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $16 * @date $Date: 2006-11-29 2 0:24:19 $15 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-11-29 21:33:09 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 34 34 static FILE *memCheckFile = NULL; // File to which to write results of mem check 35 35 36 static const char *cvsTag = "$Name: not supported by cvs2svn $"; // CVS tag name 37 36 38 psString psLibVersion(void) 37 39 { 38 psString version = NULL; 39 psStringAppend(&version, "%s-v%s",PACKAGE_NAME,PACKAGE_VERSION); 40 psString version = NULL; // Version, to return 41 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 42 return version; 43 } 44 45 psString psLibVersionLong(void) 46 { 47 psString version = psLibVersion(); // Version, to return 48 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 49 50 psStringAppend(&version, " (cvs tag %s) compiled %s at %s with" 51 #ifdef OMIT_PSDB 52 "out" 53 #endif 54 " psDB", tag, __DATE__, __TIME__); 55 56 psFree(tag); 40 57 return version; 41 58 } -
trunk/psLib/src/sys/psConfigure.h
r9538 r10286 13 13 * @author Robert DeSonia, MHPCC 14 14 * 15 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $16 * @date $Date: 2006-1 0-13 21:13:48$15 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-11-29 21:33:09 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 30 30 * Returns the current psLib version name as a string. 31 31 * 32 * @return char*: String with version name.32 * @return psString: String with version name. 33 33 */ 34 34 psString psLibVersion( 35 35 void 36 36 ); 37 38 /** Get current psLib version (full identification) 39 * 40 * Returns the current psLib version name and other information identifying the compilation. 41 * 42 * @return psString: String with identity. 43 */ 44 psString psLibVersionLong(void); 45 37 46 38 47 /** Initializes persistent memory. -
trunk/psLib/src/sys/psString.c
r9538 r10286 13 13 * @author David Robbins, MHPCC 14 14 * 15 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $16 * @date $Date: 2006-1 0-13 21:13:48$15 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-11-29 21:33:09 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 379 379 return msg; 380 380 } 381 382 383 psString psStringStripCVS(const char *string, const char *tagName) 384 { 385 PS_ASSERT_STRING_NON_EMPTY(string, NULL); 386 PS_ASSERT_STRING_NON_EMPTY(tagName, NULL); 387 388 psString tagString = NULL; // Tag string, e.g., "$Name:" from "Name" 389 psStringAppend(&tagString, "$%s:", tagName); 390 char *p = strstr(string, tagString); // The start of the real tag 391 psFree(tagString); 392 if (!p) { 393 return psStringCopy("UNKNOWN"); 394 } 395 396 psString tag = psStringCopy(string + 6); // The tag, without the leading tagString 397 p = strrchr(tag, '$'); // The closing dollar sign 398 if (p) { 399 *p = 0; 400 } 401 psStringStrip(tag); 402 if (*tag == 0) { 403 psFree(tag); 404 return psStringCopy("UNKNOWN"); 405 } 406 407 return tag; 408 } 409 -
trunk/psLib/src/sys/psString.h
r9939 r10286 14 14 * @author David Robbins, MHPCC 15 15 * 16 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $17 * @date $Date: 2006-11- 10 00:31:12$16 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2006-11-29 21:33:09 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 208 208 ); 209 209 210 /// Given a CVS keyword string, strip off the CVS-specific keyword to get the value 211 psString psStringStripCVS(const char *string, ///< The string, something like "$CVSKEYWORD: Value$" 212 const char *tagName ///< The name of the tag to remove, something like "CVSKEYWORD" 213 ); 210 214 211 215 #define PS_ASSERT_STRING_NON_EMPTY(NAME, RVAL) \
Note:
See TracChangeset
for help on using the changeset viewer.
