CORSIKA add-on package IACT/ATMO:
Version 1.63 (November 2020)
|
Data Structures | |
struct | test_struct |
Typedefs | |
typedef struct test_struct | TEST_DATA |
Functions | |
int | datacmp (TEST_DATA *data1, TEST_DATA *data2) |
Compare elements of test data structures. More... | |
int | main (int argc, char **argv) |
Main function for I/O test program. More... | |
int | read_test1 (TEST_DATA *data, IO_BUFFER *iobuf) |
Read test data with single-element functions. More... | |
int | read_test2 (TEST_DATA *data, IO_BUFFER *iobuf) |
Read test data with vector functions as far as possible. More... | |
int | read_test3 (TEST_DATA *data, IO_BUFFER *iobuf) |
Read test data as a nested tree. More... | |
int | read_test_lrg (IO_BUFFER *iobuf) |
Read large data block. More... | |
void | syntax (const char *prg) |
Replacement for function missing on OS-9. | |
int | write_test1 (TEST_DATA *data, IO_BUFFER *iobuf) |
Write test data with single-element functions. More... | |
int | write_test2 (TEST_DATA *data, IO_BUFFER *iobuf) |
Write test data with vector functions as far as possible. More... | |
int | write_test3 (TEST_DATA *data, IO_BUFFER *iobuf) |
Write test data in nested items. More... | |
int | write_test_lrg (IO_BUFFER *iobuf) |
Write large data block. More... | |
Variables | |
static int | care_int |
static int | care_long |
static int | care_short |
Compare elements of test data structures with the accuracy relevant to the I/O package.
data1 | first data structure |
data2 | second data structure |
int main | ( | int | argc, |
char ** | argv | ||
) |
First writes a test data structure with the vector functions, then the same data structure with the single-element functions. The output file is then closed and reopened for reading. The first structure is then read with the single-element functions and the second with the vector functions (i.e. the other way as done for writing). The data from the file is compared with the original data, taking the relevant accuracy into account. Note that if an 'int' variable is written via 'put_short()' and then read again via 'get_short()' not only the upper two bytes (on a 32-bit machine) are lost but also the sign bit is propagated from bit 15 to the upper 16 bits. Similarly, if a 'long' variable is written via 'put_long()' and later read via 'get_long()' on a 64-bit-machine, not only the upper 4 bytes are lost but also the sign in bit 31 is propagated to the upper 32 bits.
data | Pointer to test data structure |
iobuf | Pointer to I/O buffer |
data | Pointer to test data structure |
iobuf | Pointer to I/O buffer |
data | Pointer to test data structure |
iobuf | Pointer to I/O buffer |
int read_test_lrg | ( | IO_BUFFER * | iobuf | ) |
iobuf | Pointer to I/O buffer |
data | Pointer to test data structure |
iobuf | Pointer to I/O buffer |
data | Pointer to test data structure |
iobuf | Pointer to I/O buffer |
data | Pointer to test data structure |
iobuf | Pointer to I/O buffer |
int write_test_lrg | ( | IO_BUFFER * | iobuf | ) |
data | Pointer to test data structure |
iobuf | Pointer to I/O buffer |