Endian Conversion

These are utility functions for swapping the endianness of an 16 bit integer or 32 bit integer. You can use these to handle endianness problems or write your own.

#define	Flip_int16(type)  (((type >> 8) & 0x00ff) | 
                           ((type << 8) & 0xff00))

#define	Flip_int32(type)  (((type >>24) & 0x000000ff) | 
                           ((type >> 8) & 0x0000ff00) | 
			   ((type << 8) & 0x00ff0000) | 
			   ((type <<24) & 0xff000000) )