59#include <lal/LALFrameU.h>
62#define FAILURE(...) do { fprintf(stderr, __VA_ARGS__); exit(99); } while (0)
64char *
mkfname(
const char *name,
size_t pos);
66int main(
int argc,
char *argv[])
70 char *basename = NULL;
71 LALFrameUFrFile *input;
85 fprintf(stderr,
"usage: %s [file [name]]\n", argv[0]);
91 FAILURE(
"file %s not found\n", fname);
95 FAILURE(
"no TOC found in file %s\n", fname);
98 if ((
int)(nframe) <= 0)
99 FAILURE(
"no frames found in file %s\n", fname);
102 for (pos = 0; pos < nframe; ++pos) {
106 fname =
mkfname(basename, pos);
124 static char fname[FILENAME_MAX];
125 const char *
ext =
"gwf";
126 char hi =
'a' + pos / 26;
127 char lo =
'a' + pos % 26;
128 snprintf(fname,
sizeof(fname),
"%s%c%c.%s",
name ?
name :
"x", hi, lo,
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[])
char * mkfname(const char *name, size_t pos)
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)