/*
 * IM - Image I/O Library
 * Copyright (c) 1996 CENPES/Petrobras, TeCGraf/PUC-Rio.
 * Antonio E. Scuri - scuri@tecgraf.puc-rio.br
 * 
 * BINUTIL.H
 * 
 * Contains the implementation of utility functions to handle binary data in diferent byte orders.
 *
 * History:
 *          1996.12.12 - Finished inicial version.
 *
 */

#ifndef __BINUTIL_H
#define __BINUTIL_H

#if	defined(__cplusplus)
extern "C" {
#endif
                       
                       

/* Return the CPU byte order (Little Endian = 0 [Intel] or Big Endian = 1 [Motorola]) */
int binCPUByteOrder(void);


/* Inverts the byte order of the 2 byte values */
void binInvertOrder2BytesBuf(unsigned short *pValues, unsigned long pSize);


/* Inverts the byte order of the 4 byte values */
void binInvertOrder4BytesBuf(unsigned long *pValues, unsigned long pSize);


/* Inverts the byte order of the 8 byte values */
void binInvertOrder8BytesBuf(double *pValues, unsigned long pSize);



#if	defined(__cplusplus)
}
#endif

#endif /* __BINUTIL_H */

/* BINUTIL.H */
