29 #include <lal/FileIO.h>
30 #include <lal/LALStdlib.h>
31 #include <lal/LALString.h>
32 #include <lal/LALSimReadData.h>
36 #define PAGESIZE _SC_PAGE_SIZE
43 #define LINE_MAX _SC_LINE_MAX
95 if (strchr(line,
'\n') == NULL) {
102 if (sscanf(line,
"%lf %lf", *xdat + npts, *ydat + npts) != 2) {
107 if (++npts == size) {
150 if (strchr(line,
'\n') == NULL) {
164 double v = strtod(
s, &endp);
166 if (
s == endp || *endp ==
'\0')
183 for (col = 0; col < *ncol; ++col) {
185 (*data)[*ncol * nrow + col] = strtod(
s, &endp);
186 if (
s == endp || *endp ==
'\0') {
size_t XLALSimReadDataFile2Col(double **xdat, double **ydat, LALFILE *fp)
Read a two-column data file.
size_t XLALSimReadDataFileNCol(double **data, size_t *ncol, LALFILE *fp)
Read a multi-column data file.
LALFILE * XLALSimReadDataFileOpen(const char *fname)
Opens a specified data file, searching default path if necessary.
char * XLALFileGets(char *s, int size, LALFILE *file)
LALFILE * XLALFileOpenRead(const char *path)
#define XLAL_FILE_RESOLVE_PATH(fname)
void * XLALMalloc(size_t n)
void * XLALRealloc(void *p, size_t n)
#define XLAL_ERROR_FAIL(...)