diff --git a/lal/Makefile.am b/lal/Makefile.am index 5b36c565831964d4d2225dfdfcd656abb70c24bf..1df8df37f7bd923a53390621f8985e054453a641 100644 --- a/lal/Makefile.am +++ b/lal/Makefile.am @@ -32,7 +32,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lal/lal.pc.in b/lal/lal.pc.in index f7455879ef7ec76a8e7095750f6fada4058b5627..fff5d96213335b7f82d96d9eb25905b9ccb872b3 100644 --- a/lal/lal.pc.in +++ b/lal/lal.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LAL_DATA_PATH=@datadir@/@PACKAGE@ LAL_OCTAVE_PATH=@octexecdir@ LAL_PYTHON_PATH=@pyexecdir@ diff --git a/lal/lalsupport.pc.in b/lal/lalsupport.pc.in index 9c81de204b3405f23efc3d4aa52aad17c19957ce..e7e64474ba674a3f937c2ded40c892eeb546a432 100644 --- a/lal/lalsupport.pc.in +++ b/lal/lalsupport.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALSUPPORT_DATA_PATH=@datadir@/@PACKAGE@ LALSUPPORT_OCTAVE_PATH=@octexecdir@ LALSUPPORT_PYTHON_PATH=@pyexecdir@ diff --git a/lal/lib/lalsupport/include/FileIO.h b/lal/lib/lalsupport/include/FileIO.h index 7ac2ab862a7aafafe436fbfa29729a218c4b997b..e38cff4fde5ba53d17d9c12a1ab69ec201cd77d8 100644 --- a/lal/lib/lalsupport/include/FileIO.h +++ b/lal/lib/lalsupport/include/FileIO.h @@ -44,8 +44,6 @@ extern "C" { */ /*@{*/ -FILE *LALOpenDataFile( const char* ); - typedef struct tagLALFILE LALFILE; LALFILE *lalstdin(void); diff --git a/lal/lib/lalsupport/src/FileIO.c b/lal/lib/lalsupport/src/FileIO.c index 61c935506c4f9234b086badd14bc940fe5109e14..06da1c2a28784f7f0969b123f1bcb91c552c3545 100644 --- a/lal/lib/lalsupport/src/FileIO.c +++ b/lal/lib/lalsupport/src/FileIO.c @@ -17,51 +17,6 @@ * MA 02111-1307 USA */ -/** - * \addtogroup FileIO_h - * - * ### Obsolete LAL Prototypes ### - * - * \code - * FILE *LALFopen( const char *path, const char *mode ); - * int LALFclose( FILE *stream ); - * \endcode - * - * ### Description ### - * - * The routines LALFopen() and LALFclose() are macro defined to be - * the same as the standard C routines LALFopen() and fclose(). These - * should only be used in test programs. - * - * The routine LALOpenDataFile() is used to open a data file for reading. - * This routine is also to be used in test programs only. Unless the data file - * is specified with an absolute path (beginning with a /), or a specific - * path (beginning with a ./ or a ../), the directory - * that the file is in is obtained from the environment variable - * \c LAL_DATA_PATH, which must be set at run-time. (If the environment - * variable is not set, the default path is . --- i.e., the current - * directory.) - * - * \c LAL_DATA_PATH should typically be set to - * /usr/local/share/lal, or wherever LAL data is installed in your system - * (which may be different if you used a --prefix argument when - * configuring LAL), but when the test suite is run with make check, the - * variable \c LAL_DATA_PATH is set to the current source directory. If the - * filename (including the directory path) is too long (more than 256 - * characters), LALOpenDataFile() returns \c NULL and sets - * \c errno to \c ENAMETOOLONG. - * - * \c LAL_DATA_PATH can be any colon-delimeted list of directories, which - * are searched in order (just like the \c PATH environment variable). - * An extra colon inserts the default data directory - * (\f$\langle\f$prefix\f$\rangle\f$/share/lal) into the search path at that - * point. E.g., a leading/trailing colon will look for the default data - * directory at the start/end of the list of directories. - * - * It is strongly recommended that LALOpenDataFile() be used when writing test code. - * - */ - #include #include @@ -109,120 +64,12 @@ LALFILE *lalstderr( void ) return &_lalstderr; } -#define STR( x ) #x -#define XSTR( x ) STR( x ) -#define INFOMSG( msg, file ) ( ( lalDebugLevel & LALINFO ) ? \ - LALPrintError( "Info: function LALOpenDataFile, file " __FILE__ ", line " \ - XSTR( __LINE__ ) ", $Id$\n\t%s %s\n", msg, file ) : 0 ) -#define ERRORMSG( file ) ( ( lalDebugLevel & LALERROR ) ? \ - LALPrintError( "Info: function LALOpenDataFile, file " __FILE__ ", line " \ - XSTR( __LINE__ ) ", $Id$\n\tCould not open data file %s\n", file ) : 0 ) - -#ifndef LAL_PREFIX -#define LAL_PREFIX "/usr/local" -#endif - - - -FILE * -LALOpenDataFile( const char *fname ) -{ - FILE *fp; - const char *path; - char *datapath; /* locally allocated copy of env-var LAL_DATA_PATH */ - const char *p0; /* pointer to current sub-path of datapath*/ - char *p1; /* pointer to next sub-path */ - char fdata[32768]; - int n; - - XLAL_PRINT_DEPRECATION_WARNING("XLALFileResolvePathLong"); - - if ( (fname==NULL) || ( strlen(fname)==0) ) { - return NULL; - } - - if ( *fname == '/' ) /* absolute path is given */ - { - fp = LALFopen( fname, "r" ); - if ( ! fp ) - ERRORMSG( fname ); - else - INFOMSG( "Opening data file", fname ); - return fp; - } - - n = strlen( fname ); - if ( *fname == '.' && n > 0 && ( fname[1] == '/' || ( n > 1 && fname[1] == '.' - && fname[2] == '/' ) ) ) /* specific path is given */ - { - fp = LALFopen( fname, "r" ); - if ( ! fp ) - ERRORMSG( fname ); - else - INFOMSG( "Opening data file", fname ); - return fp; - } - - path = getenv( "LAL_DATA_PATH" ); - - if ( ! path || ! strlen( path ) ) /* path is NULL or empty */ - { - fp = LALFopen( fname, "r" ); - if ( ! fp ) - ERRORMSG( fname ); - else - INFOMSG( "Opening data file", fname ); - return fp; - } - - /* scan through all directories in colon-delmited list of directories */ - if ( (datapath = LALCalloc (strlen(path)+1, 1)) == NULL) /* we need local copy */ - { - ERRORMSG( fname ); - return NULL; - } - strcpy (datapath, path); - p0 = datapath; - do { - p1 = strchr( p0, ':' ); /* look for additional directories */ - if ( p1 ) /* there are more things in the list */ - *p1++ = 0; /* NUL-terminate current directory */ - if ( ! strlen( p0 ) ) /* this directory is empty */ - p0 = LAL_PREFIX "/share/lal"; /* default data directory */ - - n = snprintf( fdata, sizeof(fdata), "%s/%s", p0 ? p0 : ".", fname ); - if ( n > (int) sizeof( fdata ) ) /* data file name too long */ - { - errno = ENAMETOOLONG; - LALFree (datapath); - return NULL; - } - - INFOMSG( "Looking for file", fdata ); - fp = LALFopen( fdata, "r" ); - if ( fp ) /* we've found it! */ - { - INFOMSG( "Opening data file", fdata ); - LALFree (datapath); - return fp; - } - - p0 = p1; - } - while ( p0 ); - - LALFree (datapath); - ERRORMSG( fname ); - return NULL; -} - /** 'Resolve' a given filename 'fname', returning a file path where the * file can successfully be opened by fopen() using mode='rb'. * * Return: successful file-path or NULL if failed. * - * Resolving follows an algorithm similar to what LALOpenDataFile() did, - * namely if 'fname' contains a + * Resolving uses the following algorithm: if 'fname' contains a * i) (relative or absolute) path: only tries to open that path directly * ii) pure filename: try 1) local dir, then 2) search LAL_DATA_PATH, then 3) try fallbackdir * return first successful hit diff --git a/lal/lib/lalsupport/src/ReadFrequencySeries_source.c b/lal/lib/lalsupport/src/ReadFrequencySeries_source.c index 2945d26c04ec69ebf8043bd09e277bf0fc9ca33c..168f8e3fb0f1110258e04a84604a6e3e2e2338b8 100644 --- a/lal/lib/lalsupport/src/ReadFrequencySeries_source.c +++ b/lal/lib/lalsupport/src/ReadFrequencySeries_source.c @@ -42,7 +42,7 @@ void FUNC ( LALStatus* status, /* if (filename == NULL) return; */ - fp = LALOpenDataFile( filename ); + fp = LALFopen( filename, "r" ); if (fp == NULL) { ABORT( status, READFTSERIESH_EFILENOTFOUND, diff --git a/lal/lib/lalsupport/src/ReadNoiseSpectrum.c b/lal/lib/lalsupport/src/ReadNoiseSpectrum.c index 863f47124b4418e21c958aaa360825a1bf9964a9..9997d34339c9f813036cecee6e9edbf8aa7e2721 100644 --- a/lal/lib/lalsupport/src/ReadNoiseSpectrum.c +++ b/lal/lib/lalsupport/src/ReadNoiseSpectrum.c @@ -103,7 +103,7 @@ LALReadNoiseSpectrum(LALStatus *stat, REAL4FrequencySeries *spectrum, CHAR *fnam ATTATCHSTATUSPTR(stat); /* this is the file containing the spectrum data */ - if ( !(fp = LALOpenDataFile( fname )) ) + if ( !(fp = LALFopen( fname, "r" )) ) { ABORT(stat, LALREADNOISESPECTRUMH_EOPEN, LALREADNOISESPECTRUMH_MSGEOPEN); } diff --git a/lal/lib/lalsupport/src/ReadTimeSeries_source.c b/lal/lib/lalsupport/src/ReadTimeSeries_source.c index 88bc736393cb24fd23e571f451900d0c3484beb4..3daba550917d3e827eac157cf4325522b0fac0f3 100644 --- a/lal/lib/lalsupport/src/ReadTimeSeries_source.c +++ b/lal/lib/lalsupport/src/ReadTimeSeries_source.c @@ -44,7 +44,7 @@ FUNC ( LALStatus* status, /* if (filename == NULL) return; */ - fp = LALOpenDataFile( filename ); + fp = LALFopen( filename, "r" ); if (fp == NULL) { ABORT( status, READFTSERIESH_EFILENOTFOUND, diff --git a/lal/lib/lalsupport/test/StreamInputTest.c b/lal/lib/lalsupport/test/StreamInputTest.c index 12e008ad3af96a0b09b2ad4c2ff6934851a0523e..81dd2aa4227f66b41d40718715c63c765e04d929 100644 --- a/lal/lib/lalsupport/test/StreamInputTest.c +++ b/lal/lib/lalsupport/test/StreamInputTest.c @@ -382,7 +382,7 @@ main(int argc, char **argv) /* Open input and output files. */ if ( strcmp( infile, "stdin" ) ) { - if ( !( fpIn = LALOpenDataFile( infile ) ) ) { + if ( !( fpIn = fopen( infile, "r" ) ) ) { ERROR( STREAMINPUTTESTC_EFILE, "- " STREAMINPUTTESTC_MSGEFILE, infile ); return STREAMINPUTTESTC_EFILE; diff --git a/lal/lib/lalsupport/test/StreamSeriesInputTest.c b/lal/lib/lalsupport/test/StreamSeriesInputTest.c index 22e91f6da1181f737aabbd0aa39e8e30bf47e06d..a88aa4b51f2b5e37be7e31dc52f87abf4be026eb 100644 --- a/lal/lib/lalsupport/test/StreamSeriesInputTest.c +++ b/lal/lib/lalsupport/test/StreamSeriesInputTest.c @@ -192,7 +192,7 @@ main(int argc, char **argv) /* Open input and output files. */ if ( strcmp( infile, "stdin" ) ) { - if ( !( fpIn = LALOpenDataFile( infile ) ) ) { + if ( !( fpIn = fopen( infile, "r" ) ) ) { ERROR( STREAMSERIESINPUTTESTC_EFILE, "- " STREAMSERIESINPUTTESTC_MSGEFILE, infile ); return STREAMSERIESINPUTTESTC_EFILE; diff --git a/lalapps/Makefile.am b/lalapps/Makefile.am index 288ea6a00e8f5c572bb2d4d397dc89442a247bc8..cf70de0f4ddb7c599a0be6a89a7f1319f51e7e36 100644 --- a/lalapps/Makefile.am +++ b/lalapps/Makefile.am @@ -29,7 +29,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend PATH $(bindir); \ prepend PYTHONPATH $(pyexecdir) $(pythondir); \ diff --git a/lalburst/Makefile.am b/lalburst/Makefile.am index 18cfd8770c3439be98af5337afb24c3d0bcb05e8..042ed6c58967ee815f7b365c7d2545d0d23b834b 100644 --- a/lalburst/Makefile.am +++ b/lalburst/Makefile.am @@ -30,7 +30,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lalburst/lalburst.pc.in b/lalburst/lalburst.pc.in index dd23c2360c60de5d1b4df3dd4ae2ac98c97563cc..c151565bcf0b2843d1a698f0ade5fe99309165c6 100644 --- a/lalburst/lalburst.pc.in +++ b/lalburst/lalburst.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALBURST_DATA_PATH=@datadir@/@PACKAGE@ LALBURST_OCTAVE_PATH=@octexecdir@ LALBURST_PYTHON_PATH=@pyexecdir@ diff --git a/laldetchar/Makefile.am b/laldetchar/Makefile.am index 316eca33483ce941eb6a63eb0f0346cc7ae0801d..925d4a0b26647032802ca3420254b39f6580876e 100644 --- a/laldetchar/Makefile.am +++ b/laldetchar/Makefile.am @@ -29,7 +29,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/laldetchar/laldetchar.pc.in b/laldetchar/laldetchar.pc.in index c872d6819389dbab9f3c623f9cb33b650369c7b0..53760f83e3da67601a79cfad0f5399af638b215c 100644 --- a/laldetchar/laldetchar.pc.in +++ b/laldetchar/laldetchar.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALDETCHAR_DATA_PATH=@datadir@/@PACKAGE@ LALDETCHAR_OCTAVE_PATH=@octexecdir@ LADETCHARL_PYTHON_PATH=@pyexecdir@ diff --git a/lalframe/Makefile.am b/lalframe/Makefile.am index d617f49fe8cdb3201c1040888cf6ce8b156c7c20..9cb95854f9c81141c76aa1afcdd25607279852bf 100644 --- a/lalframe/Makefile.am +++ b/lalframe/Makefile.am @@ -29,7 +29,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lalframe/lalframe.pc.in b/lalframe/lalframe.pc.in index 92f71092fb6405a151897820e86baa0892e96c40..121114a7f22e39f18d1d0411c2abf3e917020ef0 100644 --- a/lalframe/lalframe.pc.in +++ b/lalframe/lalframe.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALFRAME_DATA_PATH=@datadir@/@PACKAGE@ LALFRAME_OCTAVE_PATH=@octexecdir@ LALFRAME_PYTHON_PATH=@pyexecdir@ diff --git a/lalinference/Makefile.am b/lalinference/Makefile.am index eb1304aea51436d1797dcd04360af5dd465c8015..f631da4406382d64ccc501906fd823479a3331dc 100644 --- a/lalinference/Makefile.am +++ b/lalinference/Makefile.am @@ -29,7 +29,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lalinference/lalinference.pc.in b/lalinference/lalinference.pc.in index 1ef79351c3b659494ad2019f0eb6ee02fe7e64cd..50e3525aceb9ce685635fb4583688212a6aad34e 100644 --- a/lalinference/lalinference.pc.in +++ b/lalinference/lalinference.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALINFERENCE_DATA_PATH=@datadir@/@PACKAGE@ LALINFERENCE_OCTAVE_PATH=@octexecdir@ LALINFERENCE_PYTHON_PATH=@pyexecdir@ diff --git a/lalinspiral/Makefile.am b/lalinspiral/Makefile.am index ee2f2fdeda9e5952d3057aa06e27277a5f235cea..68480b51b8d740afa2f16251c03f8fc1316237e0 100644 --- a/lalinspiral/Makefile.am +++ b/lalinspiral/Makefile.am @@ -30,7 +30,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lalinspiral/lalinspiral.pc.in b/lalinspiral/lalinspiral.pc.in index bbe8cfbf3486d0a2606357744ad95f1f7f4fe807..d0dc88f5f10bedb0fdc3633e4d3f1acc28e7e3f7 100644 --- a/lalinspiral/lalinspiral.pc.in +++ b/lalinspiral/lalinspiral.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALINSPIRAL_DATA_PATH=@datadir@/@PACKAGE@ LALINSPIRAL_OCTAVE_PATH=@octexecdir@ LALINSPIRAL_PYTHON_PATH=@pyexecdir@ diff --git a/lalmetaio/Makefile.am b/lalmetaio/Makefile.am index cd91dc4eec2aa4e4d88458af2f6e3190d832c7c8..6115d106031ffdac3b3b098131dd10d8678b705f 100644 --- a/lalmetaio/Makefile.am +++ b/lalmetaio/Makefile.am @@ -29,7 +29,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lalmetaio/lalmetaio.pc.in b/lalmetaio/lalmetaio.pc.in index d59321a45ad254e14913b337a323d6fe7938b633..7da44d2e764df6bb61d32a35799d2d0afa5647ac 100644 --- a/lalmetaio/lalmetaio.pc.in +++ b/lalmetaio/lalmetaio.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALMETAIO_DATA_PATH=@datadir@/@PACKAGE@ LALMETAIO_OCTAVE_PATH=@octexecdir@ LALMETAIO_PYTHON_PATH=@pyexecdir@ diff --git a/lalpulsar/Makefile.am b/lalpulsar/Makefile.am index 3a6991f7a5c0d6a28e98be7ca737c34593dcacbf..81625e43af7d87e276eb248dae4feaea9bc66a0e 100644 --- a/lalpulsar/Makefile.am +++ b/lalpulsar/Makefile.am @@ -30,7 +30,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lalpulsar/lalpulsar.pc.in b/lalpulsar/lalpulsar.pc.in index 406c643d63d97bd088cfef0436d2ae4b5daa1e5c..3f1888c67daeb4730c5df771c15eaa9f233eda0d 100644 --- a/lalpulsar/lalpulsar.pc.in +++ b/lalpulsar/lalpulsar.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALPULSAR_DATA_PATH=@datadir@/@PACKAGE@ LALPULSAR_OCTAVE_PATH=@octexecdir@ LALPULSAR_PYTHON_PATH=@pyexecdir@ diff --git a/lalpulsar/src/DopplerFullScan.c b/lalpulsar/src/DopplerFullScan.c index d4f15a59abc5b7746c121f1d5f3955eb35d68f45..e0e123b48e599e2c98ad6d6841e84aa3fd2024e8 100644 --- a/lalpulsar/src/DopplerFullScan.c +++ b/lalpulsar/src/DopplerFullScan.c @@ -820,7 +820,7 @@ loadFullGridFile ( LALStatus *status, } /* for s < max_spins */ /* open input data file */ - if ( (fp = LALOpenDataFile (init->gridFile)) == NULL) { + if ( (fp = LALFopen (init->gridFile, "r")) == NULL) { XLALPrintError ("Could not open data-file: `%s`\n\n", init->gridFile); ABORT (status, CONFIGFILEH_EFILE, CONFIGFILEH_MSGEFILE); } diff --git a/lalpulsar/src/SFTfileIO-LAL.c b/lalpulsar/src/SFTfileIO-LAL.c index 9071d36f36ae96dc85f33d5c20ba3a772a3af146..b51fdb2a6d03c58baf6dd191f56f18f5db213b7c 100644 --- a/lalpulsar/src/SFTfileIO-LAL.c +++ b/lalpulsar/src/SFTfileIO-LAL.c @@ -922,7 +922,7 @@ LALReadSFTheader (LALStatus *status, /**< pointer to LALStatus structure */ ASSERT (fname, status, SFTFILEIO_ENULL, SFTFILEIO_MSGENULL); /* opening the SFT binary file */ - fp = LALOpenDataFile( fname ); + fp = LALFopen( fname, "rb" ); if (fp == NULL) { ABORT (status, SFTFILEIO_EFILE, SFTFILEIO_MSGEFILE); } @@ -1072,7 +1072,7 @@ LALReadSFTdata(LALStatus *status, /**< pointer to LALStatus structure */ offset = fminBinIndex - header.fminBinIndex; /* open file for reading */ - if ( (fp = LALOpenDataFile( fname )) == NULL) { + if ( (fp = LALFopen( fname, "rb" )) == NULL) { ABORT (status, SFTFILEIO_EFILE, SFTFILEIO_MSGEFILE); } diff --git a/lalpulsar/src/SFTfileIO.c b/lalpulsar/src/SFTfileIO.c index 2b4661bdbc841b5625d71eb6d22ebae5d1798318..f8fe37dca1c7cd1baf49eb3fa373ec2f48ff2bcb 100644 --- a/lalpulsar/src/SFTfileIO.c +++ b/lalpulsar/src/SFTfileIO.c @@ -48,6 +48,7 @@ #endif #include +#include #include #include #include @@ -2482,17 +2483,10 @@ XLALFindFiles (const CHAR *globstring) LALParsedDataFile *list = NULL; CHAR* listfname = NULL; - /* create list file name - prefix with "./" if not an absolute file name (see LALOpenDataFile()) */ - if ((listfname = LALCalloc(1, strlen(globstring) + 3)) == NULL) { + /* extract list file name */ + if ((listfname = XLALStringDuplicate(globstring + strlen(LIST_PREFIX))) == NULL) { XLAL_ERROR_NULL ( XLAL_ENOMEM ) ; } - ptr1 = globstring + strlen(LIST_PREFIX); - if (*ptr1 == '/') - *listfname = '\0'; - else - strcpy(listfname, "./"); - strcat(listfname, ptr1); #undef LIST_PREFIX /* read list of file names from file */ diff --git a/lalpulsar/test/FlatMeshTest.c b/lalpulsar/test/FlatMeshTest.c index 1b5725065686c5cd03f2fc557b4b881c66b0f261..d4f3f07bca74237ec8e5198c01edde23bfce8859 100644 --- a/lalpulsar/test/FlatMeshTest.c +++ b/lalpulsar/test/FlatMeshTest.c @@ -269,21 +269,21 @@ main(int argc, char **argv) if ( eigenfile ) { /* Read input files into vector sequences. */ - if ( !( fp = LALOpenDataFile( eigenfile ) ) ) { + if ( !( fp = fopen( eigenfile, "r" ) ) ) { ERROR( FLATMESHTESTC_EFILE, "- " FLATMESHTESTC_MSGEFILE, eigenfile ); return FLATMESHTESTC_EFILE; } SUB( LALSReadVectorSequence( &stat, &matrix, fp ), &stat ); fclose( fp ); - if ( !( fp = LALOpenDataFile( inversefile ) ) ) { + if ( !( fp = fopen( inversefile, "r" ) ) ) { ERROR( FLATMESHTESTC_EFILE, "- " FLATMESHTESTC_MSGEFILE, inversefile ); return FLATMESHTESTC_EFILE; } SUB( LALSReadVectorSequence( &stat, &matrixInv, fp ), &stat ); fclose( fp ); - if ( !( fp = LALOpenDataFile( rangefile ) ) ) { + if ( !( fp = fopen( rangefile, "r" ) ) ) { ERROR( FLATMESHTESTC_EFILE, "- " FLATMESHTESTC_MSGEFILE, rangefile ); return FLATMESHTESTC_EFILE; diff --git a/lalpulsar/test/LALDemodTest.c b/lalpulsar/test/LALDemodTest.c index 029a834adee938ad7b8ef9dff33806cf7a421cb8..46f77dbc1b82e34cda394d13273edcba610b2045 100644 --- a/lalpulsar/test/LALDemodTest.c +++ b/lalpulsar/test/LALDemodTest.c @@ -188,8 +188,6 @@ * \code * lalDebugLevel * LALMalloc() - * LALFopen() - * LALFclose() * LALSCreateVector() * LALCreateRandomParams() * LALNormalDeviates() @@ -354,7 +352,7 @@ int main(int argc, char **argv) { strcpy(basicInputsFile, argv[++arg]); arg++; - if(LALOpenDataFile(basicInputsFile)==NULL) + if(fopen(basicInputsFile, "r")==NULL) { ERROR(LALDEMODH_ENOFILE, LALDEMODH_MSGENOFILE, 0); XLALPrintError(USAGE, *argv); @@ -392,7 +390,7 @@ int main(int argc, char **argv) /* default: no input file specified */ else if(basicInputsFile==NULL) { - bif=LALOpenDataFile("in.data"); + bif=fopen("in.data", "r"); } /* erroneous command line argument */ @@ -427,7 +425,7 @@ int main(int argc, char **argv) /***** GET INPUTS FROM FILES *****/ - bif=LALOpenDataFile(basicInputsFile); + bif=fopen(basicInputsFile, "r"); fscanf(bif, "%lf\n%lf\n%lf\n%lf\n%lf\n%lf\n%lf\n%lf\n%d\n%le\n%le\n%le\n%le\n%le\n%lf\n" " %lf\n%d\n%le\n%le\n%le\n%le\n%le\n%lf\n%lf\n", @@ -443,7 +441,7 @@ int main(int argc, char **argv) &templateParams->spind->spParams[4], &templateParams->skyP->alpha, &templateParams->skyP->delta); - LALFclose(bif); + fclose(bif); /***** END FILE INPUT *****/ diff --git a/lalsimulation/Makefile.am b/lalsimulation/Makefile.am index d792842e2fe2ebfc4ba98d6fae1bc7e0c26de593..23d50d3be7ad188f80fe8acc5186aa23d1b1e64d 100644 --- a/lalsimulation/Makefile.am +++ b/lalsimulation/Makefile.am @@ -29,7 +29,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lalsimulation/lalsimulation.pc.in b/lalsimulation/lalsimulation.pc.in index 2729325feebb133a11ec6c8a3b38bc292e721468..cecce31541ff88be0b200a9d56763e43ff33dbc0 100644 --- a/lalsimulation/lalsimulation.pc.in +++ b/lalsimulation/lalsimulation.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALSIMULATION_DATA_PATH=@datadir@/@PACKAGE@ LALSIMULATION_OCTAVE_PATH=@octexecdir@ LALSIMULATION_PYTHON_PATH=@pyexecdir@ diff --git a/lalstochastic/Makefile.am b/lalstochastic/Makefile.am index a53ef8adf8847e2f00ddd5237fad1234b3835543..66c7371f08bc188e89d8d28c43caa572f43d2b82 100644 --- a/lalstochastic/Makefile.am +++ b/lalstochastic/Makefile.am @@ -30,7 +30,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lalstochastic/lalstochastic.pc.in b/lalstochastic/lalstochastic.pc.in index c3a966e403d9382505f26ec3fa2b22c0a41a0de9..c60844715b295f2a98227df70282b3180d9574ea 100644 --- a/lalstochastic/lalstochastic.pc.in +++ b/lalstochastic/lalstochastic.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALSTOCHASTIC_DATA_PATH=@datadir@/@PACKAGE@ LALSTOCHASTIC_OCTAVE_PATH=@octexecdir@ LALSTOCHASTIC_PYTHON_PATH=@pyexecdir@ diff --git a/lalxml/Makefile.am b/lalxml/Makefile.am index 499f6798355e2394539eef9e1d2b9ba75b657807..e4c91b53599c41096f2ffab83cebd71bcee5d159 100644 --- a/lalxml/Makefile.am +++ b/lalxml/Makefile.am @@ -29,7 +29,7 @@ SUBDIRS = \ user_environment = \ set $(PACKAGE)_PREFIX $(prefix); \ - prepend LAL_DATA_PATH $(pkgdatadir); \ + set $(PACKAGE)_DATADIR $(pkgdatadir); \ prepend MANPATH $(mandir); \ prepend OCTAVE_PATH $(octexecdir); \ prepend PATH $(bindir); \ diff --git a/lalxml/lalxml.pc.in b/lalxml/lalxml.pc.in index 0b1fae9c74470507f7b287922bf0ee7ba18eccee..b6f985af5aaa609878ec9e42081fc72b7cbe4f4f 100644 --- a/lalxml/lalxml.pc.in +++ b/lalxml/lalxml.pc.in @@ -3,7 +3,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ -LALXML_DATA_PATH=@datadir@/@PACKAGE@ LALXML_OCTAVE_PATH=@octexecdir@ LALXML_PYTHON_PATH=@pyexecdir@