IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 29, 2006, 11:33:09 AM (20 years ago)
Author:
Paul Price
Message:

Adding function to return long version information, including CVS tag name, whether psDB was included, and the date and time of compilation. Added function to strip CVS keywords from the keyword/value string.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psString.c

    r9538 r10286  
    1313 *  @author David Robbins, MHPCC
    1414 *
    15  *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2006-10-13 21:13:48 $
     15 *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2006-11-29 21:33:09 $
    1717 *
    1818 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    379379    return msg;
    380380}
     381
     382
     383psString 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
Note: See TracChangeset for help on using the changeset viewer.