53#include <lal/LALFrameU.h>
56#define FAILURE(...) do { fprintf(stderr, __VA_ARGS__); exit(99); } while (0)
58int main(
int argc,
char *argv[])
61 char *defaultfilev[1] = { stdio };
62 int filec = (argc == 1 ? 1 : argc - 1);
63 char **filev = (argc == 1 ? defaultfilev : &argv[1]);
65 LALFrameUFrFile **input;
73 FAILURE(
"could not create output file\n");
76 input = calloc(filec,
sizeof(*input));
77 nframe = calloc(filec,
sizeof(*nframe));
78 for (f = 0; f < filec; ++f) {
80 char *fname = filev[f];
84 FAILURE(
"file %s not found\n", fname);
88 FAILURE(
"no TOC found in file %s\n", fname);
91 if ((
int)(nframe[f]) <= 0)
92 FAILURE(
"no frames found in file %s\n", fname);
94 if (nframe[f] > nframemax)
95 nframemax = nframe[f];
99 for (pos = 0; pos < nframemax; ++pos) {
103 for (f = 0; f < filec; ++f) {
105 if (pos >= nframe[f])
120 for (f = 0; f < filec; ++f)
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.
int main(int argc, char *argv[])
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)