11 #include <sys/types.h>
19 std::cout <<
"** usage: prdfcheck [-v] file name" << std::endl;
25 main(
int argc,
char *argv[])
28 unsigned int buffer[8*8192];
32 fd =
open(argv[1], O_RDONLY | O_LARGEFILE);
42 xc =
read ( fd, (
char *)buffer, 8192);
80 std::cout <<
"buffer at record " << std::setw(4) << total_read
83 <<
" marker = " << std::hex <<
buffer::i4swap(buffer[1]) << std::dec <<
" ";
87 std::cout <<
"buffer at record " << std::setw(4) << total_read
88 <<
" length = " << std::setw(7) << buffer[0]
89 <<
" " << ( buffer[0] + 8192)/8192
90 <<
" marker = " << std::hex << buffer[1] << std::dec <<
" ";
102 std::cout <<
"LZO Marker ";
103 std::cout <<
" Or.length: " << buffer[3];
104 float ratio = 100.*buffer[0]/buffer[3];
105 std::cout <<
" " << ratio <<
"%";
107 int e = buffer[2] & 0xffff;
108 int atp = (buffer[2] >> 16) & 0xffff;
111 std::cout <<
" events: " << e <<
" from ATP " << atp << std::endl;
115 std::cout << std::endl;
122 xc =
read ( fd, (
char *)buffer, 8192);
125 std::cout <<
"end or error in read loop at rec " << total_read << std::endl;
131 xc =
read ( fd, (
char *)buffer, 8192);
134 std::cout <<
"legitimate end or error at rec " << total_read << std::endl;
145 std::cout <<
"found a non-buffer start..."<< total_read
150 std::cout <<
"found a non-buffer start..."<< total_read
151 <<
" length = " << buffer[0] <<
" marker = " << std::hex << buffer[1] << std::dec ;
160 xc =
read ( fd, (
char *)buffer, 8192);
163 std::cout <<
"end or error in salavge loop at rec " << total_read << std::endl;
169 std::cout <<
" Skipped " << skipped << std::endl;