1 /*
2  * Copyright (c) 2011 Apple Inc. All rights reserved.
3  *
4  * @APPLE_APACHE_LICENSE_HEADER_START@
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * @APPLE_APACHE_LICENSE_HEADER_END@
19  */
20 
21 //
22 //  EndianPortable.h
23 //
24 //  Copyright 2011 Apple Inc. All rights reserved.
25 //
26 
27 #ifndef _EndianPortable_h
28 #define _EndianPortable_h
29 
30 #include <stdint.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 uint16_t Swap16NtoB(uint16_t inUInt16);
37 uint16_t Swap16BtoN(uint16_t inUInt16);
38 
39 uint32_t Swap32NtoB(uint32_t inUInt32);
40 uint32_t Swap32BtoN(uint32_t inUInt32);
41 
42 uint64_t Swap64BtoN(uint64_t inUInt64);
43 uint64_t Swap64NtoB(uint64_t inUInt64);
44 
45 float SwapFloat32BtoN(float in);
46 float SwapFloat32NtoB(float in);
47 
48 double SwapFloat64BtoN(double in);
49 double SwapFloat64NtoB(double in);
50 
51 void Swap16(uint16_t * inUInt16);
52 void Swap24(uint8_t * inUInt24);
53 void Swap32(uint32_t * inUInt32);
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif
60