Files
mac-sdk/defs/TextEncodingConverter.yaml
Claude 688f4c3645 Add the Mac OS 9 Toolbox: HFS Plus glue, Icon Services, Threads, MP, TEC, URL Access, Keychain
- data/trapinfo-os9.json: the 68k traps that the glue in Mac OS 9.2.1's
  InterfaceLib, IconServicesLib, FoldersLib, SoundLib, PowerMgrLib and
  DisplayLib still calls. add-protos.py and check-traps.py read it, and
  tools/retrap.py attaches those traps to existing definitions that had
  none (the HFS Plus PB calls, the FSRef Alias Manager calls,
  FSOpenResFile, the Gestalt value calls).
- 68k glue for the high-level HFS Plus calls (FSOpenFork,
  FSGetCatalogInfo, FSIterateForks, ...): fill in a parameter block and
  call the PB...Sync trap, as 9.2.1's glue does.
- Icon Services (trap 0xAA75), Folder Manager 9, anti-aliased text,
  the VM and resource-file additions, Power Manager 2, Sound Manager
  3.x and Display Manager 2, on both CPUs where the glue shows a trap.
- Thread Manager (<Threads.h>, trap 0xABF2) for 68k and PowerPC. Its
  callbacks are TVector UPPs (plain function pointers), so funptr
  definitions take `tvector: true`.
- Multiprocessing Services, TextCommon, the Text Encoding Converter,
  the Unicode Converter, URL Access and the Keychain Manager, PowerPC
  only.
- examples/macos9.c, run on Mac OS 9.2.1 (QEMU mac99) as PowerPC code
  and as 68k code in the emulator.
- check-traps: 1,960 calls match, 0 differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRDDKyi26yxudMyvEb
2026-11-02 06:55:15 +00:00

476 lines
8.7 KiB
YAML

# ####
- typedef:
name: TECObjectRef
type: struct OpaqueTECObjectRef*
comment: Text Encoding Converter (Mac OS 8.5 and later; an extension for 7.6 and 8.1).
# ####
- typedef:
name: TECSnifferObjectRef
type: struct OpaqueTECSnifferObjectRef*
# ####
- typedef:
name: TECPluginSignature
type: OSType
# ####
- typedef:
name: TECPluginVersion
type: UInt32
# ####
- struct:
name: TECConversionInfo
size: 12
members:
- name: sourceEncoding
type: TextEncoding
- name: destinationEncoding
type: TextEncoding
- name: reserved1
type: UInt16
- name: reserved2
type: UInt16
# ####
- function:
name: TECCountAvailableTextEncodings
return: OSStatus
args:
- name: numberEncodings
type: ItemCount*
comment: Text Encoding Converter
m68k: none
# ####
- function:
name: TECGetAvailableTextEncodings
return: OSStatus
args:
- name: availableEncodings
type: TextEncoding*
- name: maxAvailableEncodings
type: ItemCount
- name: actualAvailableEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECCountDirectTextEncodingConversions
return: OSStatus
args:
- name: numberOfEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECGetDirectTextEncodingConversions
return: OSStatus
args:
- name: availableConversions
type: TECConversionInfo*
- name: maxAvailableConversions
type: ItemCount
- name: actualAvailableConversions
type: ItemCount*
m68k: none
# ####
- function:
name: TECCountDestinationTextEncodings
return: OSStatus
args:
- name: inputEncoding
type: TextEncoding
- name: numberOfEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECGetDestinationTextEncodings
return: OSStatus
args:
- name: inputEncoding
type: TextEncoding
- name: destinationEncodings
type: TextEncoding*
- name: maxDestinationEncodings
type: ItemCount
- name: actualDestinationEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECGetTextEncodingInternetName
return: OSStatus
args:
- name: textEncoding
type: TextEncoding
- name: encodingName
type: StringPtr
m68k: none
# ####
- function:
name: TECGetTextEncodingFromInternetName
return: OSStatus
args:
- name: textEncoding
type: TextEncoding*
- name: encodingName
type: ConstStr255Param
m68k: none
# ####
- function:
name: TECCreateConverter
return: OSStatus
args:
- name: newEncodingConverter
type: TECObjectRef*
- name: inputEncoding
type: TextEncoding
- name: outputEncoding
type: TextEncoding
m68k: none
# ####
- function:
name: TECCreateConverterFromPath
return: OSStatus
args:
- name: newEncodingConverter
type: TECObjectRef*
- name: inPath
type: const TextEncoding*
- name: inEncodings
type: ItemCount
m68k: none
# ####
- function:
name: TECDisposeConverter
return: OSStatus
args:
- name: newEncodingConverter
type: TECObjectRef
m68k: none
# ####
- function:
name: TECClearConverterContextInfo
return: OSStatus
args:
- name: encodingConverter
type: TECObjectRef
m68k: none
# ####
- function:
name: TECConvertText
return: OSStatus
args:
- name: encodingConverter
type: TECObjectRef
- name: inputBuffer
type: ConstTextPtr
- name: inputBufferLength
type: ByteCount
- name: actualInputLength
type: ByteCount*
- name: outputBuffer
type: TextPtr
- name: outputBufferLength
type: ByteCount
- name: actualOutputLength
type: ByteCount*
m68k: none
# ####
- function:
name: TECFlushText
return: OSStatus
args:
- name: encodingConverter
type: TECObjectRef
- name: outputBuffer
type: TextPtr
- name: outputBufferLength
type: ByteCount
- name: actualOutputLength
type: ByteCount*
m68k: none
# ####
- function:
name: TECCountSubTextEncodings
return: OSStatus
args:
- name: inputEncoding
type: TextEncoding
- name: numberOfEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECGetSubTextEncodings
return: OSStatus
args:
- name: inputEncoding
type: TextEncoding
- name: subEncodings
type: TextEncoding*
- name: maxSubEncodings
type: ItemCount
- name: actualSubEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECGetEncodingList
return: OSStatus
args:
- name: encodingConverter
type: TECObjectRef
- name: numEncodings
type: ItemCount*
- name: encodingList
type: Handle*
m68k: none
# ####
- function:
name: TECCreateOneToManyConverter
return: OSStatus
args:
- name: newEncodingConverter
type: TECObjectRef*
- name: inputEncoding
type: TextEncoding
- name: numOutputEncodings
type: ItemCount
- name: outputEncodings
type: const TextEncoding*
m68k: none
# ####
- function:
name: TECConvertTextToMultipleEncodings
return: OSStatus
args:
- name: encodingConverter
type: TECObjectRef
- name: inputBuffer
type: ConstTextPtr
- name: inputBufferLength
type: ByteCount
- name: actualInputLength
type: ByteCount*
- name: outputBuffer
type: TextPtr
- name: outputBufferLength
type: ByteCount
- name: actualOutputLength
type: ByteCount*
- name: outEncodingsBuffer
type: TextEncodingRun*
- name: maxOutEncodingRuns
type: ItemCount
- name: actualOutEncodingRuns
type: ItemCount*
m68k: none
# ####
- function:
name: TECFlushMultipleEncodings
return: OSStatus
args:
- name: encodingConverter
type: TECObjectRef
- name: outputBuffer
type: TextPtr
- name: outputBufferLength
type: ByteCount
- name: actualOutputLength
type: ByteCount*
- name: outEncodingsBuffer
type: TextEncodingRun*
- name: maxOutEncodingRuns
type: ItemCount
- name: actualOutEncodingRuns
type: ItemCount*
m68k: none
# ####
- function:
name: TECCountWebTextEncodings
return: OSStatus
args:
- name: locale
type: RegionCode
- name: numberEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECGetWebTextEncodings
return: OSStatus
args:
- name: locale
type: RegionCode
- name: availableEncodings
type: TextEncoding*
- name: maxAvailableEncodings
type: ItemCount
- name: actualAvailableEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECCountMailTextEncodings
return: OSStatus
args:
- name: locale
type: RegionCode
- name: numberEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECGetMailTextEncodings
return: OSStatus
args:
- name: locale
type: RegionCode
- name: availableEncodings
type: TextEncoding*
- name: maxAvailableEncodings
type: ItemCount
- name: actualAvailableEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECCountAvailableSniffers
return: OSStatus
args:
- name: numberOfEncodings
type: ItemCount*
m68k: none
# ####
- function:
name: TECGetAvailableSniffers
return: OSStatus
args:
- name: availableSniffers
type: TextEncoding*
- name: maxAvailableSniffers
type: ItemCount
- name: actualAvailableSniffers
type: ItemCount*
m68k: none
# ####
- function:
name: TECCreateSniffer
return: OSStatus
args:
- name: encodingSniffer
type: TECSnifferObjectRef*
- name: testEncodings
type: TextEncoding*
- name: numTextEncodings
type: ItemCount
m68k: none
# ####
- function:
name: TECSniffTextEncoding
return: OSStatus
args:
- name: encodingSniffer
type: TECSnifferObjectRef
- name: inputBuffer
type: TextPtr
- name: inputBufferLength
type: ByteCount
- name: testEncodings
type: TextEncoding*
- name: numTextEncodings
type: ItemCount
- name: numErrsArray
type: ItemCount*
- name: maxErrs
type: ItemCount
- name: numFeaturesArray
type: ItemCount*
- name: maxFeatures
type: ItemCount
m68k: none
# ####
- function:
name: TECDisposeSniffer
return: OSStatus
args:
- name: encodingSniffer
type: TECSnifferObjectRef
m68k: none
# ####
- function:
name: TECClearSnifferContextInfo
return: OSStatus
args:
- name: encodingSniffer
type: TECSnifferObjectRef
m68k: none