-static char rcsId[] = "$Id: evt.c,v 6.4 2000-04-18 07:26:55 muench Stab $";
+static char rcsId[] = "$Id: evt.c,v 6.5 2000-05-21 18:35:47 hades Exp $";
#define _ANSI_C_SOURCE
#include <stddef.h>
#include "evt.h"
#include "subevt.h"
+#include "ansiTape.h"
enum EvtIdx {
EvtIdx_size,
return fwrite(my, 1, Evt_paddedSize(my), file);
}
+int Evt_writeTape(void *my, AnsiTape *tape)
+{
+ return writeAnsiTape(tape, my, Evt_paddedSize(my));
+}
+
void *Evt_appendSubEvt(void *my, void *subEvt)
{
if (SubEvt_decoding(subEvt) == SubEvtDecoding_SubEvts) {
-static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.13 2000-05-20 00:28:50 hades Exp $";
+static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.14 2000-05-21 18:35:47 hades Exp $";
#define _XOPEN_SOURCE
#include <unistd.h>
#include "evt.h"
#include "subevt.h"
#include "shmtrans.h"
-#include "tape.h"
+#include "ansiTape.h"
static jmp_buf terminateJmp;
char *outDev;
int priority;
FILE *outFile;
+ AnsiTape *outTape;
void *subEvt;
UInt4 nrOfSubEvts = 0;
UInt4 runNr;
}
}
} else if (strcmp(outDev, "tape") == 0) {
- if (NULL == (outFile = openTape(outPath))) {
+ if (NULL == (outTape = openAnsiTape(outPath))) {
msglog(LOG_ERR, "%s, %d: %s\n", __FILE__, __LINE__, strerror(errno));
exit(EXIT_FAILURE);
}
}
if (nrOfMsgs == 0) {
/*
- no '-m' option was on command line, we assume that the readout task
- (daq_readout) is running on the same node and communicates directly
- via shared memory */
+ no '-m' option was on command line, we assume that the
+ readout task (daq_readout) is running on the same node and
+ communicates directly via shared memory
+ */
shmTrans = allocMem(sizeof(ShmTrans *));
hadTuQueue = allocMem(sizeof(HadTuQueue *));
evt = appendFile(evt, slowCtrlFiles[i]);
}
if (outFile != NULL) {
- Evt_write(evt, outFile);
+ if (strcmp(outDev, "file")) {
+ Evt_write(evt, outFile);
+ } else if (strcmp(outDev, "tape")) {
+ Evt_writeTape(evt, outTape);
+ }
}
deleteEvt(evt);
}
if (currNrOfSubEvts == nrOfSubEvts) {
if (outFile != NULL) {
- Evt_write(evt, outFile);
+ if (strcmp(outDev, "file")) {
+ Evt_write(evt, outFile);
+ } else if (strcmp(outDev, "tape")) {
+ Evt_writeTape(evt, outTape);
+ }
}
Evt_online(evt);
(*evtsComplete)++;
evt = appendFile(evt, slowCtrlFiles[i]);
}
if (outFile != NULL) {
- Evt_write(evt, outFile);
+ if (strcmp(outDev, "file")) {
+ Evt_write(evt, outFile);
+ } else if (strcmp(outDev, "tape")) {
+ Evt_writeTape(evt, outTape);
+ }
}
deleteEvt(evt);
if (outFile != NULL) {
if (strcmp(outDev, "tape") == 0) {
- if (-1 == closeTape(outFile, *bytesWritten, outPath)) {
+ if (-1 == closeAnsiTape(outTape)) {
msglog(LOG_ERR, "%s, %d: %s\n", __FILE__, __LINE__, strerror(errno));
exit(EXIT_FAILURE);
}