|
Mac OS 9
|
QuickTime Interfaces. More...
Go to the source code of this file.
Macros | |
| #define | EndianS16_LtoN(value) (value) |
| #define | EndianS16_NtoL(value) (value) |
| #define | EndianU16_LtoN(value) (value) |
| #define | EndianU16_NtoL(value) (value) |
| #define | EndianS32_LtoN(value) (value) |
| #define | EndianS32_NtoL(value) (value) |
| #define | EndianU32_LtoN(value) (value) |
| #define | EndianU32_NtoL(value) (value) |
| #define | EndianS64_LtoN(value) (value) |
| #define | EndianS64_NtoL(value) (value) |
| #define | EndianU64_LtoN(value) (value) |
| #define | EndianU64_NtoL(value) (value) |
| #define | EndianS16_BtoN(value) EndianS16_BtoL(value) |
| #define | EndianS16_NtoB(value) EndianS16_LtoB(value) |
| #define | EndianU16_BtoN(value) EndianU16_BtoL(value) |
| #define | EndianU16_NtoB(value) EndianU16_LtoB(value) |
| #define | EndianS32_BtoN(value) EndianS32_BtoL(value) |
| #define | EndianS32_NtoB(value) EndianS32_LtoB(value) |
| #define | EndianU32_BtoN(value) EndianU32_BtoL(value) |
| #define | EndianU32_NtoB(value) EndianU32_LtoB(value) |
| #define | EndianS64_BtoN(value) EndianS64_BtoL(value) |
| #define | EndianS64_NtoB(value) EndianS64_LtoB(value) |
| #define | EndianU64_BtoN(value) EndianU64_BtoL(value) |
| #define | EndianU64_NtoB(value) EndianU64_LtoB(value) |
| #define | EndianS16_LtoB(value) ((SInt16)Endian16_Swap(value)) |
| #define | EndianS16_BtoL(value) ((SInt16)Endian16_Swap(value)) |
| #define | EndianU16_LtoB(value) ((UInt16)Endian16_Swap(value)) |
| #define | EndianU16_BtoL(value) ((UInt16)Endian16_Swap(value)) |
| #define | EndianS32_LtoB(value) ((SInt32)Endian32_Swap(value)) |
| #define | EndianS32_BtoL(value) ((SInt32)Endian32_Swap(value)) |
| #define | EndianU32_LtoB(value) ((UInt32)Endian32_Swap(value)) |
| #define | EndianU32_BtoL(value) ((UInt32)Endian32_Swap(value)) |
| #define | EndianS64_LtoB(value) ((SInt64)Endian64_Swap((UInt64)value)) |
| #define | EndianS64_BtoL(value) ((SInt64)Endian64_Swap((UInt64)value)) |
| #define | EndianU64_LtoB(value) ((UInt64)Endian64_Swap(value)) |
| #define | EndianU64_BtoL(value) ((UInt64)Endian64_Swap(value)) |
| #define | Endian16_Swap(value) (((((UInt16)value) << 8) & 0xFF00) | ((((UInt16)value) >> 8) & 0x00FF)) |
| #define | Endian32_Swap(value) |
Typedefs | |
| typedef long | BigEndianLong |
| typedef unsigned long | BigEndianUnsignedLong |
| typedef short | BigEndianShort |
| typedef unsigned short | BigEndianUnsignedShort |
| typedef Fixed | BigEndianFixed |
| typedef UnsignedFixed | BigEndianUnsignedFixed |
| typedef OSType | BigEndianOSType |
Functions | |
| SInt16 | EndianS16_BtoN (SInt16 value) |
| SInt16 | EndianS16_NtoB (SInt16 value) |
| SInt16 | EndianS16_LtoN (SInt16 value) |
| SInt16 | EndianS16_NtoL (SInt16 value) |
| SInt16 | EndianS16_LtoB (SInt16 value) |
| SInt16 | EndianS16_BtoL (SInt16 value) |
| UInt16 | EndianU16_BtoN (UInt16 value) |
| UInt16 | EndianU16_NtoB (UInt16 value) |
| UInt16 | EndianU16_LtoN (UInt16 value) |
| UInt16 | EndianU16_NtoL (UInt16 value) |
| UInt16 | EndianU16_LtoB (UInt16 value) |
| UInt16 | EndianU16_BtoL (UInt16 value) |
| SInt32 | EndianS32_BtoN (SInt32 value) |
| SInt32 | EndianS32_NtoB (SInt32 value) |
| SInt32 | EndianS32_LtoN (SInt32 value) |
| SInt32 | EndianS32_NtoL (SInt32 value) |
| SInt32 | EndianS32_LtoB (SInt32 value) |
| SInt32 | EndianS32_BtoL (SInt32 value) |
| UInt32 | EndianU32_BtoN (UInt32 value) |
| UInt32 | EndianU32_NtoB (UInt32 value) |
| UInt32 | EndianU32_LtoN (UInt32 value) |
| UInt32 | EndianU32_NtoL (UInt32 value) |
| UInt32 | EndianU32_LtoB (UInt32 value) |
| UInt32 | EndianU32_BtoL (UInt32 value) |
| SInt64 | EndianS64_BtoN (SInt64 value) |
| SInt64 | EndianS64_NtoB (SInt64 value) |
| SInt64 | EndianS64_LtoN (SInt64 value) |
| SInt64 | EndianS64_NtoL (SInt64 value) |
| SInt64 | EndianS64_LtoB (SInt64 value) |
| SInt64 | EndianS64_BtoL (SInt64 value) |
| UInt64 | EndianU64_BtoN (UInt64 value) |
| UInt64 | EndianU64_NtoB (UInt64 value) |
| UInt64 | EndianU64_LtoN (UInt64 value) |
| UInt64 | EndianU64_NtoL (UInt64 value) |
| UInt64 | EndianU64_LtoB (UInt64 value) |
| UInt64 | EndianU64_BtoL (UInt64 value) |
| UInt16 | Endian16_Swap (UInt16 value) |
| UInt32 | Endian32_Swap (UInt32 value) |
| UInt64 | Endian64_Swap (UInt64 value) |
QuickTime Interfaces.
| #define Endian16_Swap | ( | value | ) | (((((UInt16)value) << 8) & 0xFF00) | ((((UInt16)value) >> 8) & 0x00FF)) |
CALL_NOT_IN_CARBON override with macros
| #define Endian32_Swap | ( | value | ) |
| #define EndianS16_BtoN | ( | value | ) | EndianS16_BtoL(value) |
Map native to actual
| #define EndianS16_LtoB | ( | value | ) | ((SInt16)Endian16_Swap(value)) |
Implement ©LtoB and ©BtoL
| #define EndianS16_LtoN | ( | value | ) | (value) |
TARGET_RT_LITTLE_ENDIAN Macro away no-op functions
| typedef long BigEndianLong |
CALL_NOT_IN_CARBON !TYPE_LONGLONG These types are used for structures that contain data that is always in BigEndian format. This extra typing prevents little endian code from directly changing the data, thus saving much time in the debugger.
| UInt16 Endian16_Swap | ( | UInt16 | value | ) |
Implement low level ©_Swap functions.
extern UInt16 Endian16_Swap(UInt16 value); extern UInt32 Endian32_Swap(UInt32 value); extern UInt64 Endian64_Swap(UInt64 value);
Note: Depending on the processor, you might want to implement these as function calls instead of macros. Endian16_Swap()
| UInt32 Endian32_Swap | ( | UInt32 | value | ) |
Note: When using compilers that don't support "long long", Endian64_Swap must be implemented as glue. Endian64_Swap()
| SInt16 EndianS16_BtoL | ( | SInt16 | value | ) |
| SInt16 EndianS16_BtoN | ( | SInt16 | value | ) |
This file provides Endian Flipping routines for dealing with converting data between Big-Endian and Little-Endian machines. These routines are useful when writing code to compile for both Big and Little Endian machines and which must handle other endian number formats, such as reading or writing to a file or network packet.
These routines are named as follows:
Endian<U><W>_<S>to<D>
where is whether the integer is signed ('S') or unsigned ('U') <W> is integer bit width: 16, 32, or 64 is the source endian format: 'B' for big, 'L' for little, or 'N' for native <D> is the destination endian format: 'B' for big, 'L' for little, or 'N' for native
For example, to convert a Big Endian 32-bit unsigned integer to the current native format use:
long i = EndianU32_BtoN(data);
This file is set up so that the function macro to nothing when the target runtime already is the desired format (e.g. on Big Endian machines, EndianU32_BtoN() macros away).
If long long's are not supported, you cannot get 64-bit quantities as a single value. The macros are not defined in that case.
<<< W A R N I N G >>>
It is very important not to put any autoincrements inside the macros. This will produce erroneous results because each time the address is accessed in the macro, the increment occurs. Note: These functions are currently not implemented in any library and are only listed here as function prototypes to document the macros EndianS16_BtoN()
| SInt16 EndianS16_LtoB | ( | SInt16 | value | ) |
| SInt16 EndianS16_LtoN | ( | SInt16 | value | ) |
| SInt16 EndianS16_NtoB | ( | SInt16 | value | ) |
| SInt16 EndianS16_NtoL | ( | SInt16 | value | ) |
| SInt32 EndianS32_BtoL | ( | SInt32 | value | ) |
| SInt32 EndianS32_BtoN | ( | SInt32 | value | ) |
| SInt32 EndianS32_LtoB | ( | SInt32 | value | ) |
| SInt32 EndianS32_LtoN | ( | SInt32 | value | ) |
| SInt32 EndianS32_NtoB | ( | SInt32 | value | ) |
| SInt32 EndianS32_NtoL | ( | SInt32 | value | ) |
CALL_NOT_IN_CARBON Note: If these Int64 functions ever were implemented in a library, we would need two libraries, one for compilers that support long long and one for other compilers. EndianS64_BtoN()
| UInt16 EndianU16_BtoL | ( | UInt16 | value | ) |
| UInt16 EndianU16_BtoN | ( | UInt16 | value | ) |
| UInt16 EndianU16_LtoB | ( | UInt16 | value | ) |
| UInt16 EndianU16_LtoN | ( | UInt16 | value | ) |
| UInt16 EndianU16_NtoB | ( | UInt16 | value | ) |
| UInt16 EndianU16_NtoL | ( | UInt16 | value | ) |
| UInt32 EndianU32_BtoL | ( | UInt32 | value | ) |
| UInt32 EndianU32_BtoN | ( | UInt32 | value | ) |
| UInt32 EndianU32_LtoB | ( | UInt32 | value | ) |
| UInt32 EndianU32_LtoN | ( | UInt32 | value | ) |
| UInt32 EndianU32_NtoB | ( | UInt32 | value | ) |
| UInt32 EndianU32_NtoL | ( | UInt32 | value | ) |