Changeset 3220
- Timestamp:
- Feb 14, 2005, 5:02:53 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 13 edited
-
config/psTime.config.template (modified) (1 diff)
-
configure.ac (modified) (1 diff)
-
etc/pslib/psTime.config.template (modified) (1 diff)
-
src/astro/psTime.c (modified) (5 diffs)
-
src/astro/psTime.h (modified) (2 diffs)
-
src/astronomy/psTime.c (modified) (5 diffs)
-
src/astronomy/psTime.h (modified) (2 diffs)
-
test/astronomy/Makefile.am (modified) (1 diff)
-
test/astronomy/test.psTime.config2.template (modified) (1 diff)
-
test/astronomy/test.psTime.config3.template (modified) (1 diff)
-
test/astronomy/tst_psTime_04.c (modified) (2 diffs)
-
test/dataIO/Makefile.am (modified) (1 diff)
-
test/fileUtils/Makefile.am (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/config/psTime.config.template
r3182 r3220 1 1 # This configuration file specifies values required for time calculations by psLib. 2 psLib.time.tables.dir STR PREFIX/ data# Directory for time tables2 psLib.time.tables.dir STR PREFIX/share/pslib # Directory for time tables 3 3 psLib.time.tables.n S32 4 # Number of time tables 4 4 psLib.time.tables.files STR ser7.dat eopc01_1900_2004.dat finals_all.dat tai_utc.dat # These are the table file names -
trunk/psLib/configure.ac
r3219 r3220 150 150 151 151 CFLAGS="${CFLAGS=} -Wall -Werror" 152 CFLAGS="${CFLAGS=} -DCONFIG_FILE=\\\"$sysconfdir/pslib/psTime.config\\\"" 153 CFLAGS="${CFLAGS=} -DXML_CONFIG_FILE=\\\"$sysconfdir/pslib/psTime.xml\\\"" 154 CFLAGS="${CFLAGS=} -DUTC_DAT_FILE=\\\"$datadir/pslib/tai_utc.dat\\\"" 152 CFLAGS="${CFLAGS=} -DPS_CONFIG_FILE_DEFAULT=\\\"$sysconfdir/pslib/psTime.config\\\"" 155 153 156 154 -
trunk/psLib/etc/pslib/psTime.config.template
r3182 r3220 1 1 # This configuration file specifies values required for time calculations by psLib. 2 psLib.time.tables.dir STR PREFIX/ data# Directory for time tables2 psLib.time.tables.dir STR PREFIX/share/pslib # Directory for time tables 3 3 psLib.time.tables.n S32 4 # Number of time tables 4 4 psLib.time.tables.files STR ser7.dat eopc01_1900_2004.dat finals_all.dat tai_utc.dat # These are the table file names -
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 -
trunk/psLib/test/astronomy/Makefile.am
r3152 r3220 12 12 13 13 AM_LDFLAGS = -L$(top_builddir)/src $(PSLIB_LIBS) 14 AM_CFLAGS = -DXML_CONFIG_FILE="\"$(top_srcdir)/etc/pslib/psTime.xml\"" 14 15 15 16 check_PROGRAMS = tst_psTime_01 \ -
trunk/psLib/test/astronomy/test.psTime.config2.template
r3056 r3220 1 1 # This configuration file specifies values required for time calculations by psLib. 2 psLib.time.tables.dir STR PREFIX/ data# Directory for time tables2 psLib.time.tables.dir STR PREFIX/share/pslib # Directory for time tables 3 3 psLib.time.tables.n S32 4 # Number of time tables 4 4 psLib.time.tables.files STR eopc01_1900_2004.dat finals_all.dat tai_utc.dat # These are the table file names -
trunk/psLib/test/astronomy/test.psTime.config3.template
r3056 r3220 1 1 # This configuration file specifies values required for time calculations by psLib. 2 psLib.time.tables.dir STR PREFIX/ data# Directory for time tables2 psLib.time.tables.dir STR PREFIX/share/pslib # Directory for time tables 3 3 psLib.time.tables.n S32 4 # Number of time tables 4 4 psLib.time.tables.files STR ser7.dat eopc01_1900_2004.dat finals_all.dat tai_utc.dat # These are the table file names -
trunk/psLib/test/astronomy/tst_psTime_04.c
r3115 r3220 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-02- 03 00:54:12$16 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-02-15 03:02:53 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 30 30 // Test A - Initialize time 31 31 printPositiveTestHeader(stdout, "psTime", "Test A - Initialize time"); 32 psLibInit(true, CONFIG_FILE);32 psLibInit(true, p_psGetConfigFileName()); 33 33 psLibFinalize(); 34 34 printFooter(stdout, "psTime", "Test A - Initialize time", true); -
trunk/psLib/test/dataIO/Makefile.am
r3127 r3220 14 14 15 15 AM_LDFLAGS = -L$(top_builddir)/src $(PSLIB_LIBS) 16 AM_CFLAGS = -DUTC_DAT_FILE="\"$(top_srcdir)/share/pslib/tai_utc.dat\"" 16 17 17 18 check_PROGRAMS = \ -
trunk/psLib/test/fileUtils/Makefile.am
r3127 r3220 14 14 15 15 AM_LDFLAGS = -L$(top_builddir)/src $(PSLIB_LIBS) 16 AM_CFLAGS = -DUTC_DAT_FILE="\"$(top_srcdir)/share/pslib/tai_utc.dat\"" 16 17 17 18 check_PROGRAMS = \
Note:
See TracChangeset
for help on using the changeset viewer.
