IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 14, 2005, 5:02:53 PM (21 years ago)
Author:
desonia
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psTime.c

    r3182 r3220  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-02-10 02:36:41 $
     12 *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-02-15 03:02:53 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7474psF64 searchTables(psF64 index, psU64 column, psLookupStatusType *status, char *metadataTableNames[], psU32 nTables);
    7575
     76
    7677/** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null
    7778 *  terminated copy of the original input string. */
     
    133134    return cleanToken;
    134135}
     136
     137// get the psTime.config filename by checking environment variable first, then original installation area.
     138char* p_psGetConfigFileName()
     139{
     140    char* filename = getenv("PS_CONFIG_FILE");
     141
     142    if (filename == NULL) { // environment variable not found
     143        filename = PS_CONFIG_FILE_DEFAULT; // this should come from configure.ac
     144    }
     145
     146    return filename;
     147}
     148
    135149
    136150/** Searches time tables in priority order and performs interpolation if input index value is within a table.
     
    148162    // Check time metadata. Function call reports errors.
    149163    if(timeMetadata == NULL) {
    150         if(!p_psTimeInit(CONFIG_FILE))
     164        if(!p_psTimeInit(p_psGetConfigFileName()))
    151165            return 0.0;
    152166    }
     
    705719    // Check time metadata
    706720    if(timeMetadata == NULL) {
    707         if(!p_psTimeInit(CONFIG_FILE)) {
     721        if(!p_psTimeInit(p_psGetConfigFileName())) {
    708722            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND, "psTime.config");
    709723            return 0.0;
Note: See TracChangeset for help on using the changeset viewer.