Arborix -> Arboricx rename
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
!import "bytes.tri" !Local
|
||||
!import "binary.tri" !Local
|
||||
|
||||
arborixMagic = [(65) (82) (66) (79) (82) (73) (88) (0)]
|
||||
arborixMajorVersion = [(0) (1)]
|
||||
arborixMinorVersion = [(0) (0)]
|
||||
arborixManifestSectionId = [(0) (0) (0) (1)]
|
||||
arborixNodesSectionId = [(0) (0) (0) (2)]
|
||||
arboricxMagic = [(65) (82) (66) (79) (82) (73) (67) (88)]
|
||||
arboricxMajorVersion = [(0) (1)]
|
||||
arboricxMinorVersion = [(0) (0)]
|
||||
arboricxManifestSectionId = [(0) (0) (0) (1)]
|
||||
arboricxNodesSectionId = [(0) (0) (0) (2)]
|
||||
|
||||
errMissingSection = 4
|
||||
errUnsupportedVersion = 5
|
||||
@@ -20,10 +20,10 @@ nodePayloadLeafTag = 0
|
||||
nodePayloadStemTag = 1
|
||||
nodePayloadForkTag = 2
|
||||
|
||||
readArborixMagic = (bs : expectBytes arborixMagic bs)
|
||||
readArboricxMagic = (bs : expectBytes arboricxMagic bs)
|
||||
|
||||
readArborixHeader = (bs :
|
||||
bindResult (readArborixMagic bs)
|
||||
readArboricxHeader = (bs :
|
||||
bindResult (readArboricxMagic bs)
|
||||
(_ afterMagic :
|
||||
bindResult (readBytes 2 afterMagic)
|
||||
(majorVersion afterMajor :
|
||||
@@ -296,12 +296,12 @@ beBytesToNat = (bytes :
|
||||
u32BEBytesToNat = beBytesToNat
|
||||
u64BEBytesToNat = beBytesToNat
|
||||
|
||||
arborixHeaderMajorVersion = (header :
|
||||
arboricxHeaderMajorVersion = (header :
|
||||
matchPair
|
||||
(majorVersion _ : majorVersion)
|
||||
header)
|
||||
|
||||
arborixHeaderMinorVersion = (header :
|
||||
arboricxHeaderMinorVersion = (header :
|
||||
matchPair
|
||||
(_ payload :
|
||||
matchPair
|
||||
@@ -309,7 +309,7 @@ arborixHeaderMinorVersion = (header :
|
||||
payload)
|
||||
header)
|
||||
|
||||
arborixHeaderSectionCount = (header :
|
||||
arboricxHeaderSectionCount = (header :
|
||||
matchPair
|
||||
(_ payload :
|
||||
matchPair
|
||||
@@ -320,7 +320,7 @@ arborixHeaderSectionCount = (header :
|
||||
payload)
|
||||
header)
|
||||
|
||||
arborixHeaderFlags = (header :
|
||||
arboricxHeaderFlags = (header :
|
||||
matchPair
|
||||
(_ payload :
|
||||
matchPair
|
||||
@@ -334,7 +334,7 @@ arborixHeaderFlags = (header :
|
||||
payload)
|
||||
header)
|
||||
|
||||
arborixHeaderDirOffset = (header :
|
||||
arboricxHeaderDirOffset = (header :
|
||||
matchPair
|
||||
(_ payload :
|
||||
matchPair
|
||||
@@ -348,22 +348,22 @@ arborixHeaderDirOffset = (header :
|
||||
payload)
|
||||
header)
|
||||
|
||||
validateArborixHeader = (header rest :
|
||||
validateArboricxHeader = (header rest :
|
||||
matchBool
|
||||
(ok header rest)
|
||||
(err errUnsupportedVersion rest)
|
||||
(and?
|
||||
(bytesEq? arborixMajorVersion (arborixHeaderMajorVersion header))
|
||||
(bytesEq? arborixMinorVersion (arborixHeaderMinorVersion header))))
|
||||
(bytesEq? arboricxMajorVersion (arboricxHeaderMajorVersion header))
|
||||
(bytesEq? arboricxMinorVersion (arboricxHeaderMinorVersion header))))
|
||||
|
||||
readArborixContainer = (bs :
|
||||
bindResult (readArborixHeader bs)
|
||||
readArboricxContainer = (bs :
|
||||
bindResult (readArboricxHeader bs)
|
||||
(header afterHeader :
|
||||
bindResult (validateArborixHeader header afterHeader)
|
||||
bindResult (validateArboricxHeader header afterHeader)
|
||||
(validHeader afterValidHeader :
|
||||
bindResult (readSectionDirectory
|
||||
(u32BEBytesToNat (arborixHeaderSectionCount validHeader))
|
||||
(bytesDrop (u64BEBytesToNat (arborixHeaderDirOffset validHeader)) bs))
|
||||
(u32BEBytesToNat (arboricxHeaderSectionCount validHeader))
|
||||
(bytesDrop (u64BEBytesToNat (arboricxHeaderDirOffset validHeader)) bs))
|
||||
(directory afterDirectory :
|
||||
bindResult (validateSectionDirectory directory afterDirectory)
|
||||
(validDirectory afterValidDirectory :
|
||||
@@ -403,21 +403,21 @@ sectionBytesOrErr = (sectionId directory containerBytes rest :
|
||||
(_ _ : err errMissingSection rest)
|
||||
(lookupSectionRecord sectionId directory))
|
||||
|
||||
readArborixSectionBytes = (sectionId bs :
|
||||
bindResult (readArborixContainer bs)
|
||||
readArboricxSectionBytes = (sectionId bs :
|
||||
bindResult (readArboricxContainer bs)
|
||||
(container afterContainer :
|
||||
matchPair
|
||||
(_ directory : sectionBytesOrErr sectionId directory bs afterContainer)
|
||||
container))
|
||||
|
||||
readArborixRequiredSections = (bs :
|
||||
bindResult (readArborixContainer bs)
|
||||
readArboricxRequiredSections = (bs :
|
||||
bindResult (readArboricxContainer bs)
|
||||
(container afterContainer :
|
||||
matchPair
|
||||
(_ directory :
|
||||
bindResult (sectionBytesOrErr arborixManifestSectionId directory bs afterContainer)
|
||||
bindResult (sectionBytesOrErr arboricxManifestSectionId directory bs afterContainer)
|
||||
(manifestBytes _ :
|
||||
bindResult (sectionBytesOrErr arborixNodesSectionId directory bs afterContainer)
|
||||
bindResult (sectionBytesOrErr arboricxNodesSectionId directory bs afterContainer)
|
||||
(nodesBytes _ :
|
||||
ok (pair manifestBytes nodesBytes) afterContainer)))
|
||||
container))
|
||||
@@ -602,12 +602,12 @@ readNodesSectionComplete = (bs :
|
||||
(err errUnexpectedBytes afterNodesSection)
|
||||
(bytesNil? afterNodesSection)))
|
||||
|
||||
readArborixNodesSection = (bs :
|
||||
bindResult (readArborixContainer bs)
|
||||
readArboricxNodesSection = (bs :
|
||||
bindResult (readArboricxContainer bs)
|
||||
(container afterContainer :
|
||||
matchPair
|
||||
(_ directory :
|
||||
bindResult (sectionBytesOrErr arborixNodesSectionId directory bs afterContainer)
|
||||
bindResult (sectionBytesOrErr arboricxNodesSectionId directory bs afterContainer)
|
||||
(nodesBytes _ :
|
||||
bindResult (readNodesSectionComplete nodesBytes)
|
||||
(nodesSection _ : ok nodesSection afterContainer)))
|
||||
@@ -645,10 +645,10 @@ nodeHashToTree = y (self nodeHash nodeRecords :
|
||||
(_ _ : err errMissingNode t)
|
||||
(lookupNodeRecord nodeHash nodeRecords))
|
||||
|
||||
readArborixTreeFromHash = (rootHash bs :
|
||||
bindResult (readArborixNodesSection bs)
|
||||
readArboricxTreeFromHash = (rootHash bs :
|
||||
bindResult (readArboricxNodesSection bs)
|
||||
(nodesSection afterContainer :
|
||||
bindResult (nodeHashToTree rootHash (nodesSectionRecords nodesSection))
|
||||
(tree _ : ok tree afterContainer)))
|
||||
|
||||
readArborixExecutableFromHash = readArborixTreeFromHash
|
||||
readArboricxExecutableFromHash = readArboricxTreeFromHash
|
||||
Reference in New Issue
Block a user