evio
5.2
|
Macros | |
#define | MIN(a, b) ( (a) < (b) ? (a) : (b) ) |
#define | SWAP64(x) |
#define | SWAP32(x) |
#define | SWAP16(x) |
Functions | |
int | eviofmtswap (int32_t *iarr, int nwrd, unsigned short *ifmt, int nfmt, int tolocal, int padding) |
This function converts (swaps) an array of EVIO composite type data between IEEE (big endian) and DECS (little endian) in place. More... | |
#define MIN | ( | a, | |
b | |||
) | ( (a) < (b) ? (a) : (b) ) |
#define SWAP16 | ( | x | ) |
Referenced by eviofmtswap().
#define SWAP32 | ( | x | ) |
Referenced by eviofmtswap().
#define SWAP64 | ( | x | ) |
Referenced by eviofmtswap().
int eviofmtswap | ( | int32_t * | iarr, |
int | nwrd, | ||
unsigned short * | ifmt, | ||
int | nfmt, | ||
int | tolocal, | ||
int | padding | ||
) |
This function converts (swaps) an array of EVIO composite type data between IEEE (big endian) and DECS (little endian) in place.
This data does NOT include the composite type's beginning tagsegment and the format string it contains. It also does NOT include the data's bank header words.
Converts the data of array (iarr[i], i=0...nwrd-1) using the format code (ifmt[j], j=0...nfmt-1) .
Algorithm description:
Data processed inside while (ib < nwrd) loop, where 'ib' is iarr[] index; loop breaks when 'ib' reaches the number of elements in iarr[]
iarr | pointer to data to be swapped |
nwrd | number of data words (32-bit ints) to be swapped |
ifmt | unsigned short array holding translated format |
nfmt | length of unsigned short array, ifmt, in # of shorts |
tolocal | if 0 data is of same endian as local host, else data is of opposite endian |
padding | number of bytes to ignore in last data word (starting from data end) |