Changeset 3220 for trunk/psLib/src
- Timestamp:
- Feb 14, 2005, 5:02:53 PM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 4 edited
-
astro/psTime.c (modified) (5 diffs)
-
astro/psTime.h (modified) (2 diffs)
-
astronomy/psTime.c (modified) (5 diffs)
-
astronomy/psTime.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psTime.c
r3182 r3220 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.5 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02-1 0 02:36:41$12 * @version $Revision: 1.52 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-15 03:02:53 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 74 74 psF64 searchTables(psF64 index, psU64 column, psLookupStatusType *status, char *metadataTableNames[], psU32 nTables); 75 75 76 76 77 /** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null 77 78 * terminated copy of the original input string. */ … … 133 134 return cleanToken; 134 135 } 136 137 // get the psTime.config filename by checking environment variable first, then original installation area. 138 char* 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 135 149 136 150 /** Searches time tables in priority order and performs interpolation if input index value is within a table. … … 148 162 // Check time metadata. Function call reports errors. 149 163 if(timeMetadata == NULL) { 150 if(!p_psTimeInit( CONFIG_FILE))164 if(!p_psTimeInit(p_psGetConfigFileName())) 151 165 return 0.0; 152 166 } … … 705 719 // Check time metadata 706 720 if(timeMetadata == NULL) { 707 if(!p_psTimeInit( CONFIG_FILE)) {721 if(!p_psTimeInit(p_psGetConfigFileName())) { 708 722 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND, "psTime.config"); 709 723 return 0.0; -
trunk/psLib/src/astro/psTime.h
r2725 r3220 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $13 * @date $Date: 200 4-12-16 18:52:51$12 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-15 03:02:53 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 284 284 ); 285 285 286 /** Get the filename of the psLib configuration file. 287 * 288 * @return char* If a PS_CONFIG_FILE environment variable exists, 289 * that is returned, otherwise the default location 290 * dependent on the installation location. 291 */ 292 char* p_psGetConfigFileName(); 293 286 294 /// @} 287 295 -
trunk/psLib/src/astronomy/psTime.c
r3182 r3220 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.5 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02-1 0 02:36:41$12 * @version $Revision: 1.52 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-15 03:02:53 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 74 74 psF64 searchTables(psF64 index, psU64 column, psLookupStatusType *status, char *metadataTableNames[], psU32 nTables); 75 75 76 76 77 /** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null 77 78 * terminated copy of the original input string. */ … … 133 134 return cleanToken; 134 135 } 136 137 // get the psTime.config filename by checking environment variable first, then original installation area. 138 char* 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 135 149 136 150 /** Searches time tables in priority order and performs interpolation if input index value is within a table. … … 148 162 // Check time metadata. Function call reports errors. 149 163 if(timeMetadata == NULL) { 150 if(!p_psTimeInit( CONFIG_FILE))164 if(!p_psTimeInit(p_psGetConfigFileName())) 151 165 return 0.0; 152 166 } … … 705 719 // Check time metadata 706 720 if(timeMetadata == NULL) { 707 if(!p_psTimeInit( CONFIG_FILE)) {721 if(!p_psTimeInit(p_psGetConfigFileName())) { 708 722 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND, "psTime.config"); 709 723 return 0.0; -
trunk/psLib/src/astronomy/psTime.h
r2725 r3220 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $13 * @date $Date: 200 4-12-16 18:52:51$12 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-15 03:02:53 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 284 284 ); 285 285 286 /** Get the filename of the psLib configuration file. 287 * 288 * @return char* If a PS_CONFIG_FILE environment variable exists, 289 * that is returned, otherwise the default location 290 * dependent on the installation location. 291 */ 292 char* p_psGetConfigFileName(); 293 286 294 /// @} 287 295
Note:
See TracChangeset
for help on using the changeset viewer.
