20#include "eformat/eformat.h"
31int main (
int argc,
char** argv)
36 std::cerr <<
"usage: " << argv[0] <<
" <file>" << std::endl;
41 std::fstream in(argv[1], std::ios::in|std::ios::binary);
43 std::cerr <<
"File `" << argv[1] <<
"' does not exist?!" << std::endl;
50 paged_event[i] =
new uint32_t[
PAGE_SIZE/
sizeof(uint32_t)];
52 while (in && in.good() && ! in.eof()) {
55 in.read((
char*)
data, 8);
56 if (!in.good() || in.eof())
break;
59 std::cout <<
"Word at offset " <<
HEX(offset) <<
" is not "
67 size_t to_read =
data[1]<<2;
68 size_t page_counter = 0;
69 std::cout <<
"Loading page";
72 in.read((
char*)paged_event[page_counter], readnow);
75 std::cout <<
" " << page_counter;
79 for (
size_t i=0; i<page_counter; ++i) {
80 myvec[i].iov_base = paged_event[i];
84 myvec[page_counter-1].iov_len =
data[1]<<2 - (page_counter-1)*
PAGE_SIZE;
94 std::cout <<
"Event " << fe.
lvl1_id() <<
" is Ok." << std::endl;
100 std::cerr << std::endl
101 <<
"Uncaught eformat issue: " << ex.
what() << std::endl;
102 std::cout <<
"Trying to continue..." << std::endl;
106 std::cerr << std::endl
107 <<
"Uncaught ERS issue: " << ex.
what() << std::endl;
111 catch (std::exception& ex) {
112 std::cerr << std::endl
113 <<
"Uncaught std exception: " << ex.
what() << std::endl;
118 std::cerr << std::endl <<
"Uncaught unknown exception" << std::endl;
const char * what() const
Human description message.