#include "worgen.h"
FUNCTION c_pxswap (buf, nentity, size)
unsigned char *buf; long *nentity; long *size;
The data buffer which is to be byte swapped. The parameter nentity specifies the number of entities in the data buffer, and parameter size specifies the size of each entity.
The number of entities to be byte swapped in the buffer.
The number of bytes per entity. Parameter size is required to be an even value.
The c_pxswap() call is used to byte swap values within a data buffer. The byte swapping algorithm for any entity which occupies 2N bytes is: byte 1 is swapped with byte 2N, byte 2 is swapped with byte 2N-1, byte 3 is swapped with byte 2N-2, and so on, ending with bytes N and N+1.
c_pxswap() returns
E_SUCC --> successful completion E_FAIL --> odd number of bytes per entity specified