Repository navigation
Carbon: move the Resource Manager to Swift over Graphite - #463
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of
Documentation/Plans/graphite.md, second of three PRs, against master:resources.cmoves to Swift overGraphiteResources(PureSwift/Graphite#13).Carbon
Sources/PerryCarbon/Resources.swiftexports the Resource Manager's calls over Graphite's maps, files and chain.._name,name.rsrc, and data-fork files withFSOpenResourceFile. A file's reference number is its fork's.ReleaseResourcedisposes of it,DetachResourcegives it to the program, andCloseResFiledisposes of the file's handles.LoadResourcefills.resources.creturned them to i386 programs; no flippers.mapReadErrinstead of a read past its end.ResErroris kept per call, and a recursive lock guards the state, since a program's calls can come from any thread.New exports (566 → 588)
AddResource,ChangedResource,WriteResource,RemoveResource,UpdateResFile,SetResInfo,SetResAttrsandGetResAttrs. Changed handles are written byWriteResource,UpdateResFileorCloseResFile, as the Resource Manager did.FSCreateResFileandFSpCreateResFile, which also write the type and creator.CountTypes,Count1Types,GetIndType,Get1IndType,GetIndResource,Get1IndResource,UniqueIDandUnique1ID.GetResourceSizeOnDisk,GetMaxResourceSize,GetIndString(STR#) andGetString(STR).resources.cstays for the C build, fenced out of SwiftPM withPERRY_CARBON_SWIFT. It gets C versions of these names so both builds export the same list: the indexed and string calls work over its parser, and the writing calls reportwrPermErr.Checks
Scripts/check-carbon-exports.shpasses on the SwiftPM library and on the C-only one: 588 exports, as listed.