Subversion Repositories f9daq

Rev

Blame | Last modification | View Log | RSS feed


#ifndef _EVDP_H_
#define _EVDP_H_

/*KEEP,event,T=C++.*/
#include "event.h"
/*KEND.*/

#define swap_4(x) swap_long((int32_t *) x)
#define swap_2(x) swap_short((short *) x)

struct LOG_header {
  uint32_t  bc,exp,run,evt,dtm;
};
typedef struct LOG_header LOG_header;

struct EVT_header {
  uint32_t  bc;
  unsigned short recid,sp;
  uint32_t  slt,cm,em;
};
typedef struct EVT_header EVT_header;

struct EVT_trailer {
  uint32_t slt;
};
typedef struct EVT_trailer EVT_trailer;

struct FED_record {
  unsigned short bc,fedid,recid,bxn;
  unsigned char data[128];
};
typedef struct FED_record FED_record;

struct SLB_header {
  uint32_t  bc;
  unsigned short recid,fltev,compid,slbn;
  uint32_t  dest;
};
typedef struct SLB_header SLB_header;

struct SLB_trailer {
  unsigned short recid,fltev;
};
typedef struct SLB_trailer SLB_trailer;

extern EVT_DATA evdata;
extern LOG_header logh;

#ifdef __cplusplus
extern "C" {
#endif
int is_little_endian();
void swap_short(short *);
void swap_long(int32_t *);
int open_data_file(char *);
int close_data_file();
int reopen_data_file();
int reclose_data_file();
int goto_event(int);
int get_nextev(FED_record *, unsigned short, int);
int dump_cmp(FILE *, unsigned short);
#ifdef __cplusplus
}
#endif

#endif /* _EVDP_H_ */