Crate MacTypes_sys

Source
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§

FixedRect
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.
Float32Point
NumVersion
Packed BCD version representation (e.g. “4.2.1a3” is 0x04214003).
Point
2D Quickdraw coordinate, range: -32K to +32K.
ProcessSerialNumber
Type for unique process identifier.
Rect
Rectangular Quickdraw area.
TimeRecord
Package of TimeBase, duration, and scale.
UnsignedWide
VersRec
Contents of a vers resource.
wide

Constants§

alphaStage
Version Release Stage Code.
betaStage
Version Release Stage Code.
bold
condense
developStage
Version Release Stage Code.
extend
finalStage
Version Release Stage Code.
italic
kInvalidId
KernelID: NULL is for pointers as kInvalidID is for ID’s
kNilOptions
OptionBits: all flags false
kNoErr
OSErr: function performed properly - no error.
kUnknownType
“????” QuickTime 3.0: default unknown ResType or OSType
kVariableLengthArray
Array bounds: variable length array
normal
outline
shadow
underline

Functions§

StrLength
Get the length of a pascal string.

Type Aliases§

AbsoluteTime
64-bit clock.
Boolean
Mac OS historic type, sizeof(Boolean)==1.
Byte
ByteCount
The size of an array of bytes.
ByteOffset
An offset into an array of bytes.
BytePtr
Pointer to an array of bytes.
CharParameter
Char when used as a parameter (historical 68K convention).
CompTimeValue
64-bit count of units (always a struct).
ConstLogicalAddress
Address in the clients virtual address space that will only be read.
ConstStr15Param
For function parameters only - means string is const.
ConstStr27Param
For function parameters only - means string is const.
ConstStr31Param
For function parameters only - means string is const.
ConstStr63Param
For function parameters only - means string is const.
ConstStr255Param
For function parameters only - means string is const.
ConstStrFileNameParam
For function parameters only - means string is const.
ConstStringPtr
Pointer to a read-only pascal string.
Duration
32-bit millisecond timer for drivers.
Fixed
16-bit signed integer plus 16-bit fraction.
FixedPtr
A pointer to a Fixed.
FixedRectPtr
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.
FourCharCode
A 32-bit value made by packing four 1 byte characters together.
Fract
2-bit signed integer plus 30-bit fraction.
FractPtr
A pointer to a Fract.
Handle
Pointer to a master pointer to a relocatable block.
ItemCount
32-bit iteration count.
LangCode
A particular language (e.g. English), as represented using a particular ScriptCode.
LogicalAddress
Address in the clients virtual address space.
NumVersionVariantHandle
NumVersionVariantPtr
OSErr
16-bit result error code.
OSStatus
32-bit result error code.
OSType
A FourCharCode used in the OS and file system (e.g. creator).
OSTypePtr
A pointer to an OSType.
OptionBits
Standard 32-bit set of bit flags.
PBVersion
?
PRefCon
RefCon Types
PhysicalAddress
Real address as used on the hardware bus.
PointPtr
ProcHandle
Pointer to a ProcPtr.
ProcPtr
Generic pointer to a function.
ProcessSerialNumberPtr
Ptr
Pointer to a non-relocatable block.
RectPtr
RegionCode
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).
Register68kProcPtr
Pointer to a 68K function that expects parameters in registers.
ResType
A FourCharCode used to tag resources (e.g. DLOG).
ResTypePtr
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
ScriptCode
A particular set of written characters (e.g. Roman vs Cyrillic) and their encoding.
ShortFixed
8-bit signed integer plus 8-bit fraction.
ShortFixedPtr
A pointer to a ShortFixed.
SignedByte
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
Str32Field
The type Str32 is 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 type Str32Field has 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
StrFileName
QuickTime 3.0:
StringHandle
Pointer to a StringPtr.
StringPtr
Pointer to a pascal string.
Style
Quickdraw font rendering styles.
StyleField
Style when used as a field (historical 68K convention).
StyleParameter
Style when used as a parameter (historical 68K convention).
TimeBase
An opaque reference to a time base.
TimeScale
Units per second.
TimeValue
Count of units.
TimeValue64
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
UTF8Char
An 8-bit code value in UTF-8 format. UnicodeScalarValues 0-0x7F are expressed in UTF-8 format using one UTF8Char with the same value. UnicodeScalarValues above 0x7F are expressed in UTF-8 format using 2-4 UTF8Chars, all with values in the range 0x80-0xF4 (UnicodeScalarValues 0x100-0xFFFF use two or three UTF8Chars, UnicodeScalarValues 0x10000-0x10FFFF use four UTF8Chars).
UTF16Char
A 16-bit Unicode code value in the default UTF-16 format. UnicodeScalarValues 0-0xFFFF are expressed in UTF-16 format using a single UTF16Char with the same value. UnicodeScalarValues 0x10000-0x10FFFF are expressed in UTF-16 format using a pair of UTF16Chars - 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 range 0-0xFFFF and can be expressed using a single UTF16Char, thus the term “Unicode character” generally refers to a UniChar = UTF16Char.
UTF32Char
A complete Unicode character in UTF-32 format, with values from 0 through 0x10FFFF (excluding the surrogate range 0xD800-0xDFFF and certain disallowed values).
UniChar
A 16-bit Unicode code value in the default UTF-16 format. UnicodeScalarValues 0-0xFFFF are expressed in UTF-16 format using a single UTF16Char with the same value. UnicodeScalarValues 0x10000-0x10FFFF are expressed in UTF-16 format using a pair of UTF16Chars - 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 range 0-0xFFFF and can be expressed using a single UTF16Char, thus the term “Unicode character” generally refers to a UniChar = UTF16Char.
UniCharCount
A count of UTF-16 code values in an array or buffer.
UniCharCountPtr
A pointer to a UniCharCount.
UniCharPtr
A pointer to an array of UniChars.
UnicodeScalarValue
A complete Unicode character in UTF-32 format, with values from 0 through 0x10FFFF (excluding the surrogate range 0xD800-0xDFFF and certain disallowed values).
UniversalProcHandle
Pointer to a UniversalProcPtr.
UniversalProcPtr
Pointer to classic 68K code or a RoutineDescriptor.
UnsignedFixed
16-bit unsigned integer plus 16-bit fraction.
UnsignedFixedPtr
A pointer to an UnsignedFixed.
UnsignedWidePtr
VHSelect
VersRecHndl
Resource Handle containing a VersRec.
VersRecPtr
Pointer to a VersRecPtr.
WidePtr
extended80
extended96
size
The number of bytes in a block (signed for historical reasons).

Unions§

NumVersionVariant
NumVersionVariant is a wrapper so NumVersion can be accessed as a 32-bit value.