Skip to content

Write and read descriptor data as Mac OS 9.2.2 keeps it - #75

Merged
colemancda merged 7 commits into
masterfrom
feature/apple-event-layout
Dec 3, 2026
Merged

colemancda merged 7 commits into
masterfrom
feature/apple-event-layout

Conversation

@colemancda

Copy link
Copy Markdown
Member

Lists, records and Apple events keep their data in a handle, and some programs write that data themselves. BBEdit Lite 6.1 appends parameters straight into an event's handle, so a host that stores descriptors any other way makes it fail.

  • ReferenceTests/Retro68/AEDescLayoutCapture.c and its capture from Mac OS 9.2.2 record the layout; the Retro68 README describes it.
  • Descriptor.classicData() writes a list, record or event as that data, and Descriptor(type:classicData:) reads it back. Numbers are big-endian, so a descriptor made with host numbers goes through toBigEndian() first.
  • DescriptorClassicDataTests replays the capture byte for byte, except two places where Mac OS leaves earlier memory behind (the long at offset 4 and a pad byte), which the tests clear.

The layout of an event nested inside another descriptor wasn't captured, so writing one is errAEWrongDataType.

swift test passed locally. swift-pef's bluebox uses these two calls; its change follows once this is merged.

@colemancda
colemancda merged commit d3a7309 into master Dec 3, 2026
3 checks passed
@colemancda
colemancda deleted the feature/apple-event-layout branch December 3, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant