-- AlpDebugImpl.mesa -- Last edited by -- Kolling on June 3, 1983 4:19 pm DIRECTORY AlpDebug USING[Handle], AlpineDebug USING[AccessFailed, ChangeSpaceForOwner, CrashSystem, LockFailed, OperationFailed, ReadDBUniversalFile, ReadOwnerFileHeader, ReadNextOwnerRecord, ReportAccessCacheStats, ReportAccessVolatileStats, StaticallyInvalid, Unknown], AlpineDebugRpcControl USING[ImportNewInterface, InterfaceRecord, NewInterfaceRecord], AlpineEnvironment USING[Conversation, LockFailure, NeededAccess, OperationFailure, OwnerName, OwnerPropertySet, OwnerPropertyValuePair, PageCount, TransID, UniversalFile, UnknownType, VolumeGroupID], AlpineFile USING[AccessFailed, LockFailed, OperationFailed, PossiblyDamaged, StaticallyInvalid, Unknown], AlpineOwner USING[allOwnerProperties], AlpInstance USING[Handle], AlpPrivate USING[InterfaceCreatorProc, NoticeUnboundInstance, RegisterInterfaceCreator], RPC USING[CallFailed], Rope USING[Equal, ROPE]; AlpDebugImpl: CEDAR PROGRAM IMPORTS AD: AlpineDebug, AlpineDebugRpcControl, AF: AlpineFile, AlpPrivate, RPC, Rope EXPORTS AlpDebug SHARES AlpineDebugRpcControl = BEGIN OPEN AlpD: AlpDebug, AE: AlpineEnvironment, AlpI: AlpInstance; ReadOwnerFileHeader: PUBLIC PROCEDURE[handle: AlpD.Handle, volumeGroupID: AE.VolumeGroupID] RETURNS[version: NAT, recordedVolGroupID: AE.VolumeGroupID, totalQuota, quotaLeft: AE.PageCount, numberOfOwners, numberOfOwnerSlotsInUse, maxNumberOfOwnersAllowed: NAT] = TRUSTED BEGIN [version: version, recordedVolGroupID: recordedVolGroupID, totalQuota: totalQuota, quotaLeft: quotaLeft, numberOfOwners: numberOfOwners, numberOfOwnerSlotsInUse: numberOfOwnerSlotsInUse, maxNumberOfOwnersAllowed: maxNumberOfOwnersAllowed] _ GetDebugInterface[handle].ReadOwnerFileHeader[handle.inst.conversation, handle.transID, volumeGroupID ! RPC.CallFailed => IF why = unbound THEN AlpPrivate.NoticeUnboundInstance[handle.inst]]; END; ReadNextOwnerRecord: PUBLIC PROCEDURE[handle: AlpD.Handle, volumeGroupID: AE.VolumeGroupID, contRecNum: INT _ 0, desiredProperties: AE.OwnerPropertySet _ AlpineOwner.allOwnerProperties] RETURNS[entryEmpty, entryValid: BOOLEAN, owner: AE.OwnerName, properties: LIST OF AE.OwnerPropertyValuePair, nextContRecNum: INT] = TRUSTED BEGIN [entryEmpty: entryEmpty, entryValid: entryValid, owner: owner, properties: properties, nextContRecNum: nextContRecNum] _ GetDebugInterface[handle].ReadNextOwnerRecord[handle.inst.conversation, handle.transID, volumeGroupID, contRecNum, desiredProperties ! RPC.CallFailed => IF why = unbound THEN AlpPrivate.NoticeUnboundInstance[handle.inst]]; END; ChangeSpaceForOwner: PUBLIC PROCEDURE[handle: AlpD.Handle, volumeGroupID: AE.VolumeGroupID, ownerName: AE.OwnerName, nPages: AE.PageCount] = TRUSTED BEGIN GetDebugInterface[handle].ChangeSpaceForOwner[handle.inst.conversation, handle.transID, volumeGroupID, ownerName, nPages ! RPC.CallFailed => IF why = unbound THEN AlpPrivate.NoticeUnboundInstance[handle.inst]]; END; ReadDBUniversalFile: PUBLIC PROCEDURE[handle: AlpD.Handle, volumeGroupID: AE.VolumeGroupID] RETURNS[dBID: AE.UniversalFile] = TRUSTED BEGIN RETURN[GetDebugInterface[handle].ReadDBUniversalFile[volumeGroupID ! RPC.CallFailed => IF why = unbound THEN AlpPrivate.NoticeUnboundInstance[handle.inst]]]; END; ReportAccessCacheStats: PUBLIC PROCEDURE[handle: AlpD.Handle] RETURNS [nCacheEntries: NAT, statsCacheHit, statsGrapevineAuthorized, statsGrapevineNotAuthorized, statsRegServersDown, statsIndivGrapeNotAuthorized: INT] = TRUSTED BEGIN [nCacheEntries: nCacheEntries, statsCacheHit: statsCacheHit, statsGrapevineAuthorized: statsGrapevineAuthorized, statsGrapevineNotAuthorized: statsGrapevineNotAuthorized, statsRegServersDown: statsRegServersDown, statsIndivGrapeNotAuthorized: statsIndivGrapeNotAuthorized] _ GetDebugInterface[handle].ReportAccessCacheStats[ ! RPC.CallFailed => IF why = unbound THEN AlpPrivate.NoticeUnboundInstance[handle.inst]]; END; ReportAccessVolatileStats: PUBLIC PROCEDURE[handle: AlpD.Handle] RETURNS [nRegs, nInits, nUnRegs, nReorganizes, nEnumAlls, nAllocReqsWin, nAllocReqsLose, nDeallocReqs, nRemoveOwner, nEnumFindWin, nEnumFindLose, nSetEnums, nActions, nPhaseOnes, nPhaseTwos, nAborts: INT] = TRUSTED BEGIN [nRegs: nRegs, nInits: nInits, nUnRegs: nUnRegs, nReorganizes: nReorganizes, nEnumAlls: nEnumAlls, nAllocReqsWin: nAllocReqsWin, nAllocReqsLose: nAllocReqsLose, nDeallocReqs: nDeallocReqs, nRemoveOwner: nRemoveOwner, nEnumFindWin: nEnumFindWin, nEnumFindLose: nEnumFindLose, nSetEnums: nSetEnums, nActions: nActions, nPhaseOnes: nPhaseOnes, nPhaseTwos: nPhaseTwos, nAborts: nAborts] _ GetDebugInterface[handle].ReportAccessVolatileStats[ ! RPC.CallFailed => IF why = unbound THEN AlpPrivate.NoticeUnboundInstance[handle.inst]]; END; CrashSystem: PUBLIC PROCEDURE[handle: AlpD.Handle] = TRUSTED BEGIN GetDebugInterface[handle].CrashSystem[handle.inst.conversation, handle.transID ! RPC.CallFailed => IF why = unbound THEN AlpPrivate.NoticeUnboundInstance[handle.inst]]; END; AccessFailed: PUBLIC ERROR [missingAccess: AE.NeededAccess] _ AF.AccessFailed; LockFailed: PUBLIC ERROR [why: AE.LockFailure] _ AF.LockFailed; OperationFailed: PUBLIC ERROR [why: AE.OperationFailure] _ AF.OperationFailed; StaticallyInvalid: PUBLIC ERROR _ AF.StaticallyInvalid; Unknown: PUBLIC ERROR [what: AE.UnknownType] _ AF.Unknown; PossiblyDamaged: PUBLIC SIGNAL _ LOOPHOLE[AF.PossiblyDamaged]; NoInterface: ERROR = CODE; GetDebugInterface: PROCEDURE[handle: AlpDebug.Handle] RETURNS[interface: AlpineDebugRpcControl.InterfaceRecord] = BEGIN FOR list: LIST OF REF ANY _ handle.inst.otherInterfaces, list.rest UNTIL list = NIL DO WITH list.first SELECT FROM interface: AlpineDebugRpcControl.InterfaceRecord => RETURN[interface]; ENDCASE; ENDLOOP; ERROR NoInterface; END; -- InterfaceCreatorProc: TYPE = PROCEDURE[fileStore: AlpineEnvironment.FileStore, version: RPC.VersionRange] RETURNS[REF ANY]; DebugInterfaceCreatorProc: AlpPrivate.InterfaceCreatorProc = -- non system-fatal errors: BEGIN IF Rope.Equal[fileStore, "local.alpine", FALSE] THEN BEGIN interface: AlpineDebugRpcControl.InterfaceRecord _ AlpineDebugRpcControl.NewInterfaceRecord[]; interface^ _ [ReadOwnerFileHeader: AD.ReadOwnerFileHeader, ReadNextOwnerRecord: AD.ReadNextOwnerRecord, ChangeSpaceForOwner: AD.ChangeSpaceForOwner, ReadDBUniversalFile: AD.ReadDBUniversalFile, ReportAccessCacheStats: AD.ReportAccessCacheStats, ReportAccessVolatileStats: AD.ReportAccessVolatileStats, CrashSystem: AD.CrashSystem, AccessFailed: AD.AccessFailed, LockFailed: AD.LockFailed, OperationFailed: AD.OperationFailed, StaticallyInvalid: AD.StaticallyInvalid, Unknown: AD.Unknown, lupineDetails: ]; RETURN[interface]; END ELSE RETURN[AlpineDebugRpcControl.ImportNewInterface[[type: "AlpineDebug.alpine", instance: fileStore, version: version], [NIL, NIL, NIL]]]; END; -- main line code: AlpPrivate.RegisterInterfaceCreator[proc: DebugInterfaceCreatorProc]; END. Edit Log Initial: Kolling: March 8, 1983 1:10 pm: implementors interface. ʤ– "cedar" style˜Jš°œÏcLœÏk œžœ$žœŸžœ[žœàžœžœ0žœ#žœ[žœ!žœÐbl œž œž œQžœ žœžœžœ<Ïnœžœ8žœ žœ’žœžœŸžœ,ž œžœ)žœžœ8žœž œžœDžœPžœžœ$žœžœ,žœžœžœ¡žœ,ž œžœGžœžœ8ž œ œžœlžœžœ,žœžœ žœ žœ!žœžœ8ž  œžœ8žœžœžœžœ<žœžœ:ž œ œžœžœžœ|žœžœÄžœ2žœžœ8ž  œžœžœÄžœžœÀžœ5žœžœ8ž   œžœžœžœžœ$žœ*žœžœ8ž œ  œž œ5  œž œ( œž œ2 œž œ œž œ& œž œžœ  œžœžœ œž œžœ9žœžœžœžœžœ-žœžœž œž œ ž œ:ž œ žœžœžœ ž  Ðck¡ '¡¡¡¡ œ&ž œžœ&žœžœƒžœÅžœ ž#œ€žœžœžœž  ÐcnœIžœJ œCœ˜ÿ<—…—‚!,