/*************************************************************** * * routine read_ev: routine to extract an event information * from file acquired with Pamela acquisition programs * * June 2002 * ***************************************************************/ /* * include needed system headers */ #include /* include standard i/o library */ #include /* include standard library */ #include /* include string library */ #include /* include unix standard library */ #include /* */ #include /* */ #include /* */ #include /* error simbol definitions */ #include /* system time definitions */ #include /* math library */ #include "CRC.h" extern "C" { extern struct { unsigned char buffer[2]; } header_; void data2ntp_(); //Struct per il passaggio di dati da e verso la chiamata fortran } void testcrc_(unsigned char *crc, int *error) { unsigned char *buff[2]; memcpy(*buff, header_.buffer, sizeof(header_.buffer)); *error = 1; printf("%i %i %i \n",buff[0],buff[15],*crc); if ((unsigned char)CM_Compute_CRC16(0, (unsigned char *)&buff, 15) == (unsigned char)*crc) *error = 0; }