#include <stdio.h>
#include "evio.h"
Defines | |
#define | MIN(a, b) ( (a) < (b) ? (a) : (b) ) |
Functions | |
int | eviofmtswap (uint32_t *iarr, int nwrd, unsigned char *ifmt, int nfmt, int tolocal) |
This function converts (swaps) an array of EVIO composite type data between IEEE (big endian) and DECS (little endian) in place. |
#define MIN | ( | a, | |||
b | ) | ( (a) < (b) ? (a) : (b) ) |
int eviofmtswap | ( | uint32_t * | iarr, | |
int | nwrd, | |||
unsigned char * | ifmt, | |||
int | nfmt, | |||
int | tolocal | |||
) |
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 char array holding translated format | |
nfmt | length of unsigned char array, ifmt, in # of chars | |
tolocal | if 0 data is of same endian as local host, else data is of opposite endian |
References EVIO_SWAP16, EVIO_SWAP32, and EVIO_SWAP64.