Expand description
The MacTypes-sys library provides bindings to the MacTypes.h header on MacOS.
This library defines base types used in both Carbon and legacy Cocoa APIs.
Structs§
- Fixed
Rect - Float80
- 80 bit MacOS float: 1 sign bit, 15 exponent bits, 1 integer bit, 63 fraction bits.
- Float96
- 96 bit 68881 float: 1 sign bit, 15 exponent bits, 16 pad bits, 1 integer bit, 63 fraction bits.
- Float32
Point - NumVersion
- Packed BCD version representation (e.g. “4.2.1a3” is
0x04214003). - Point
- 2D Quickdraw coordinate, range: -32K to +32K.
- Process
Serial Number - Type for unique process identifier.
- Rect
- Rectangular Quickdraw area.
- Time
Record - Package of TimeBase, duration, and scale.
- Unsigned
Wide - VersRec
- Contents of a
versresource. - wide
Constants§
- alpha
Stage - Version Release Stage Code.
- beta
Stage - Version Release Stage Code.
- bold
- condense
- develop
Stage - Version Release Stage Code.
- extend
- final
Stage - Version Release Stage Code.
- italic
- kInvalid
Id KernelID:NULLis for pointers askInvalidIDis for ID’s- kNil
Options OptionBits: all flags false- kNoErr
OSErr: function performed properly - no error.- kUnknown
Type - “????” QuickTime 3.0: default unknown
ResTypeorOSType - kVariable
Length Array - Array bounds: variable length array
- normal
- outline
- shadow
- underline
Functions§
- StrLength⚠
- Get the length of a pascal string.
Type Aliases§
- Absolute
Time - 64-bit clock.
- Boolean
- Mac OS historic type,
sizeof(Boolean)==1. - Byte
- Byte
Count - The size of an array of bytes.
- Byte
Offset - An offset into an array of bytes.
- BytePtr
- Pointer to an array of bytes.
- Char
Parameter Charwhen used as a parameter (historical 68K convention).- Comp
Time Value - 64-bit count of units (always a struct).
- Const
Logical Address - Address in the clients virtual address space that will only be read.
- Const
Str15 Param - For function parameters only - means string is const.
- Const
Str27 Param - For function parameters only - means string is const.
- Const
Str31 Param - For function parameters only - means string is const.
- Const
Str63 Param - For function parameters only - means string is const.
- Const
Str255 Param - For function parameters only - means string is const.
- Const
StrFile Name Param - For function parameters only - means string is const.
- Const
String Ptr - Pointer to a read-only pascal string.
- Duration
- 32-bit millisecond timer for drivers.
- Fixed
- 16-bit signed integer plus 16-bit fraction.
- Fixed
Ptr - A pointer to a
Fixed. - Fixed
Rect Ptr - Float32
- 32 bit IEEE float: 1 sign bit, 8 exponent bits, 23 fraction bits.
- Float64
- 64 bit IEEE float: 1 sign bit, 11 exponent bits, 52 fraction bits.
- Four
Char Code - A 32-bit value made by packing four 1 byte characters together.
- Fract
- 2-bit signed integer plus 30-bit fraction.
- Fract
Ptr - A pointer to a
Fract. - Handle
- Pointer to a master pointer to a relocatable block.
- Item
Count - 32-bit iteration count.
- Lang
Code - A particular language (e.g. English), as represented using a particular ScriptCode.
- Logical
Address - Address in the clients virtual address space.
- NumVersion
Variant Handle - NumVersion
Variant Ptr - OSErr
- 16-bit result error code.
- OSStatus
- 32-bit result error code.
- OSType
- A
FourCharCodeused in the OS and file system (e.g. creator). - OSType
Ptr - A pointer to an
OSType. - Option
Bits - Standard 32-bit set of bit flags.
- PBVersion
- ?
- PRefCon
- RefCon Types
- Physical
Address - Real address as used on the hardware bus.
- Point
Ptr - Proc
Handle - Pointer to a
ProcPtr. - ProcPtr
- Generic pointer to a function.
- Process
Serial Number Ptr - Ptr
- Pointer to a non-relocatable block.
- RectPtr
- Region
Code - Designates a language as used in a particular region (e.g. British vs American English) together with other region-dependent characteristics (e.g. date format).
- Register68k
Proc Ptr - Pointer to a 68K function that expects parameters in registers.
- ResType
- A
FourCharCodeused to tag resources (e.g.DLOG). - ResType
Ptr - A pointer to a
ResType. - SInt8
- 8-bit signed integer.
- SInt16
- 16-bit signed integer.
- SInt32
- 32-bit signed integer.
- SInt64
- 64-bit signed integer.
- SRefCon
- RefCon Types
- Script
Code - A particular set of written characters (e.g. Roman vs Cyrillic) and their encoding.
- Short
Fixed - 8-bit signed integer plus 8-bit fraction.
- Short
Fixed Ptr - A pointer to a
ShortFixed. - Signed
Byte - Str15
- Pascal string holding up to 15 bytes
- Str27
- Pascal string holding up to 27 bytes
- Str31
- Pascal string holding up to 31 bytes
- Str63
- Pascal string holding up to 63 bytes
- Str32
Field - The type
Str32is used in many AppleTalk based data structures. It holds up to 32 one byte chars. The problem is that with the length byte it is 33 bytes long. This can cause weird alignment problems in structures. To fix this the typeStr32Fieldhas been created. It should only be used to hold 32 chars, but it is 34 bytes long so that there are no alignment problems. - Str255
- Pascal string holding up to 255 bytes
- StrFile
Name - QuickTime 3.0:
- String
Handle - Pointer to a
StringPtr. - String
Ptr - Pointer to a pascal string.
- Style
- Quickdraw font rendering styles.
- Style
Field Stylewhen used as a field (historical 68K convention).- Style
Parameter Stylewhen used as a parameter (historical 68K convention).- Time
Base - An opaque reference to a time base.
- Time
Scale - Units per second.
- Time
Value - Count of units.
- Time
Value64 - 64-bit count of units (long long or struct).
- UInt8
- 8-bit unsigned integer.
- UInt16
- 16-bit unsigned integer.
- UInt32
- 32-bit unsigned integer.
- UInt64
- 64-bit unsigned integer.
- URefCon
- RefCon Types
- UTF8
Char - An 8-bit code value in UTF-8 format.
UnicodeScalarValues0-0x7Fare expressed in UTF-8 format using oneUTF8Charwith the same value.UnicodeScalarValues above0x7Fare expressed in UTF-8 format using 2-4UTF8Chars, all with values in the range0x80-0xF4(UnicodeScalarValues0x100-0xFFFFuse two or threeUTF8Chars,UnicodeScalarValues0x10000-0x10FFFFuse fourUTF8Chars). - UTF16
Char - A 16-bit Unicode code value in the default UTF-16 format.
UnicodeScalarValues
0-0xFFFFare expressed in UTF-16 format using a singleUTF16Charwith the same value. UnicodeScalarValues0x10000-0x10FFFFare expressed in UTF-16 format using a pair ofUTF16Chars - one in the high surrogate range (0xD800-0xDBFF) followed by one in the low surrogate range (0xDC00-0xDFFF). All of the characters defined in Unicode versions through 3.0 are in the range0-0xFFFFand can be expressed using a singleUTF16Char, thus the term “Unicode character” generally refers to aUniChar=UTF16Char. - UTF32
Char - A complete Unicode character in UTF-32 format, with
values from
0through0x10FFFF(excluding the surrogate range0xD800-0xDFFFand certain disallowed values). - UniChar
- A 16-bit Unicode code value in the default UTF-16 format.
UnicodeScalarValues
0-0xFFFFare expressed in UTF-16 format using a singleUTF16Charwith the same value. UnicodeScalarValues0x10000-0x10FFFFare expressed in UTF-16 format using a pair ofUTF16Chars - one in the high surrogate range (0xD800-0xDBFF) followed by one in the low surrogate range (0xDC00-0xDFFF). All of the characters defined in Unicode versions through 3.0 are in the range0-0xFFFFand can be expressed using a singleUTF16Char, thus the term “Unicode character” generally refers to aUniChar=UTF16Char. - UniChar
Count - A count of UTF-16 code values in an array or buffer.
- UniChar
Count Ptr - A pointer to a
UniCharCount. - UniChar
Ptr - A pointer to an array of
UniChars. - Unicode
Scalar Value - A complete Unicode character in UTF-32 format, with
values from
0through0x10FFFF(excluding the surrogate range 0xD800-0xDFFF and certain disallowed values). - Universal
Proc Handle - Pointer to a
UniversalProcPtr. - Universal
Proc Ptr - Pointer to classic 68K code or a
RoutineDescriptor. - Unsigned
Fixed - 16-bit unsigned integer plus 16-bit fraction.
- Unsigned
Fixed Ptr - A pointer to an
UnsignedFixed. - Unsigned
Wide Ptr - VHSelect
- Vers
RecHndl - Resource Handle containing a
VersRec. - Vers
RecPtr - Pointer to a
VersRecPtr. - WidePtr
- extended80
- extended96
- size
- The number of bytes in a block (signed for historical reasons).
Unions§
- NumVersion
Variant NumVersionVariantis a wrapper soNumVersioncan be accessed as a 32-bit value.