00001 /****************************************************************************** 00002 LEGAL: 00003 This framework and all source code supplied with it, except where specified, are 00004 Copyright Stephen Brandon and the University of Glasgow, 1999. You are free to 00005 use the source code for any purpose, including commercial applications, as long 00006 as you reproduce this notice on all such software. 00007 00008 Software production is complex and we cannot warrant that the Software will be 00009 error free. Further, we will not be liable to you if the Software is not fit 00010 for the purpose for which you acquired it, or of satisfactory quality. 00011 00012 WE SPECIFICALLY EXCLUDE TO THE FULLEST EXTENT PERMITTED BY THE COURTS ALL 00013 WARRANTIES IMPLIED BY LAW INCLUDING (BUT NOT LIMITED TO) IMPLIED WARRANTIES OF 00014 QUALITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF THIRD PARTIES 00015 RIGHTS. 00016 00017 If a court finds that we are liable for death or personal injury caused by our 00018 negligence our liability shall be unlimited. 00019 00020 WE SHALL HAVE NO LIABILITY TO YOU FOR LOSS OF PROFITS, LOSS OF CONTRACTS, LOSS 00021 OF DATA, LOSS OF GOODWILL, OR WORK STOPPAGE, WHICH MAY ARISE FROM YOUR 00022 POSSESSION OR USE OF THE SOFTWARE OR ASSOCIATED DOCUMENTATION. WE SHALL HAVE 00023 NO LIABILITY IN RESPECT OF ANY USE OF THE SOFTWARE OR THE ASSOCIATED 00024 DOCUMENTATION WHERE SUCH USE IS NOT IN COMPLIANCE WITH THE TERMS AND CONDITIONS 00025 OF THIS AGREEMENT. 00026 00027 ******************************************************************************/ 00028 00029 #ifndef __SND_ENDIAN_FUNCTIONS__ 00030 #define __SND_ENDIAN_FUNCTIONS__ 00031 00032 typedef unsigned long int SndSwappedFloat; 00033 typedef unsigned long long int SndSwappedDouble; 00034 00035 typedef union _SndSwappedFloatUnion { 00036 float aFloat; 00037 SndSwappedFloat theSwappedFloat; 00038 char ch[4]; 00039 } SndSwappedFloatUnion; 00040 00041 typedef union _SndSwappedDoubleUnion { 00042 double aDouble; 00043 SndSwappedDouble theSwappedDouble; 00044 char ch[8]; 00045 } SndSwappedDoubleUnion; 00046 00051 float SndSwapSwappedFloatToHost(SndSwappedFloat aSwappedFloat); 00052 00057 SndSwappedFloat SndSwapHostToSwappedFloat(float aFloat); 00058 00063 double SndSwapSwappedDoubleToHost(SndSwappedDouble aSwappedDouble); 00064 00069 SndSwappedDouble SndSwapHostToSwappedDouble(double aDouble); 00070 00075 unsigned char *SndSwap_Convert16BitNative2LittleEndian(unsigned short si); 00076 00081 unsigned char *SndSwap_Convert32BitNative2LittleEndian(unsigned long li); 00082 00083 #endif