51#include <lal/LALMalloc.h>
52#include <lal/LALString.h>
53#include <lal/LALFrameU.h>
56#define FAILURE(...) do { fprintf(stderr, __VA_ARGS__); exit(99); } while (0)
60char *
chanvstr(
char **chanv,
const char *str);
62int main(
int argc,
char *argv[])
65 char *defaultfilev[1] = { stdio };
66 int filec = (argc == 2 ? 1 : argc - 2);
67 char **filev = (argc == 2 ? defaultfilev : &argv[2]);
73 fprintf(stderr,
"usage: %s list [file ...]\n", argv[0]);
90 FAILURE(
"could not create output file\n");
92 for (f = 0; f < filec; ++f) {
93 char *fname = filev[f];
94 LALFrameUFrFile *input;
101 FAILURE(
"file %s not found\n", fname);
105 FAILURE(
"no TOC found in file %s\n", fname);
108 if ((
int)(nframe) <= 0)
109 FAILURE(
"no frames found in file %s\n", fname);
112 for (pos = 0; pos < nframe; ++pos) {
118 for (chanp = chanv; *chanp; ++chanp)
139 for (; (str = strchr(str,
',')); ++str)
141 chanv = calloc(chanc + 1,
sizeof(*chanv));
144 for (i = 1; i < chanc; ++i)
157 for (
p = chanv; *
p; ++
p)
168 while (*chanv && strcmp(*chanv, str))
int main(int argc, char *argv[])
void chanvfree(char **chanv)
char * chanvstr(char **chanv, const char *str)
char ** chanvalloc(const char *str)
size_t XLALFrameUFrTOCQueryNFrame(const LALFrameUFrTOC *toc)
Query FrTOC structure for number of FrameH structures contained.
int XLALFrameUFrameHWrite(LALFrameUFrFile *stream, LALFrameUFrameH *frame)
Write a FrameH structure to an output FrFile stream.
void XLALFrameUFrameHFree(LALFrameUFrameH *frame)
Free a FrameH structure.
struct tagLALFrameUFrameH LALFrameUFrameH
Incomplete type for a frame header FrameH structure.
LALFrameUFrTOC * XLALFrameUFrTOCRead(LALFrameUFrFile *stream)
Read the table of contents FrTOC structure for a FrFile stream.
LALFrameUFrFile * XLALFrameUFrFileOpen(const char *filename, const char *mode)
Open a frame file FrFile stream.
struct tagLALFrameUFrTOC LALFrameUFrTOC
Incomplete type for a table of contents FrTOC structure.
void XLALFrameUFrFileClose(LALFrameUFrFile *stream)
Close a FrFile stream.
char char * XLALStringDuplicate(const char *s)
void output(int gps_sec, int output_type)
LALFrameUFrameH * framecpy(LALFrameUFrFile *frfile, size_t pos)
int copydetectors(LALFrameUFrameH *frame, LALFrameUFrFile *frfile)
int copychannels(LALFrameUFrameH *frame, LALFrameUFrFile *frfile, size_t pos, const char *match)