📄 filing4.cr
字号:
-- $Header: Filing4.cr,v 2.6 87/03/23 13:05:51 ed Exp $-- Note: this is a TEST version of Filing, and is not guaranteed to-- match the official Xerox version at all. It does seem to be adequate-- for FTP, however.-- $Log: Filing4.cr,v $-- Revision 2.6 87/03/23 13:05:51 ed-- Minor typo in SerializedTree.-- -- Revision 2.5 87/03/23 11:19:35 ed-- Slight mod to SerializedTree to allow current implementation.-- Depth is really ScopeType of 4 in Filing4 (reverts to 3 in Filing5).-- -- Revision 2.4 87/01/14 13:02:00 ed-- Remove controls from Move---- Revision 2.3 86/12/31 11:45:30 ed-- Added RandomAccess and Serialize/Deserialize for completeness-- Some REPORTS error typos fixed---- Revision 2.2 86/06/30 11:31:13 jqj-- convert to Authentication v 2 for compatibility with spec., now that-- compiler allows it.-- -- Revision 2.1 86/06/02 07:08:22 jqj-- typos-- -- Revision 2.0 85/11/21 07:22:38 jqj-- 4.3BSD standard release-- -- Revision 1.1 85/05/27 06:30:46 jqj-- Initial revision-- -- Revision 1.1 85/05/27 06:30:46 jqj-- Initial revision-- Filing: PROGRAM 10 VERSION 4 =BEGIN DEPENDS UPON BulkData(0) VERSION 1, Clearinghouse(2) VERSION 2, Authentication(14) VERSION 2, Time(15) VERSION 2;-- TYPES AND CONSTANTS ---- Attributes (individual attributes defined later) --AttributeType: TYPE = LONG CARDINAL;AttributeTypeSequence: TYPE = SEQUENCE OF AttributeType;allAttributeTypes: AttributeTypeSequence = [37777777777B];Attribute: TYPE = RECORD [type: AttributeType, value: SEQUENCE OF UNSPECIFIED];AttributeSequence: TYPE = SEQUENCE OF Attribute;-- Controls --ControlType: TYPE = {lockControl(0), timeoutControl(1), accessControl(2)};ControlTypeSequence: TYPE = SEQUENCE 3 OF ControlType;Lock: TYPE = {lockNone(0), share(1), exclusive(2)};Timeout: TYPE = CARDINAL; -- in seconds --defaultTimeout: Timeout = 177777B; -- actual value impl.-dependent --AccessType: TYPE = { readAccess(0), writeAccess(1), ownerAccess(2), -- all files -- addAccess(3), removeAccess(4) }; -- directories only --AccessSequence: TYPE = SEQUENCE 5 OF AccessType;-- fullAccess: AccessSequence = [177777B]; --Control: TYPE = CHOICE ControlType OF { lockControl => Lock, timeoutControl => Timeout, accessControl => AccessSequence};ControlSequence: TYPE = SEQUENCE 3 OF Control;-- Scopes --Count: TYPE = CARDINAL;unlimitedCount: Count = 177777B;Depth: TYPE = CARDINAL;allDescendants: Depth = 177777B;Direction: TYPE = {forward(0), backward(1)};Interpretation: TYPE = { interpretationNone(0), boolean(1), cardinal(2), longCardinal(3), time(4), integer(5), longInteger(6), string(7) };FilterType: TYPE = { -- relations -- less(0), lessOrEqual(1), equal(2), notEqual(3), greaterOrEqual(4), greater(5), -- logical -- and(6), or(7), not(8), -- constants -- filterNone(9), all(10), -- patterns -- matches(11) };RestrictedFilter: TYPE = CHOICE FilterType OF { less, lessOrEqual, equal, notEqual, greaterOrEqual, greater => RECORD [attribute: Attribute, interpretation: Interpretation], -- interpretation ignored if attribute interpreted by -- implementor -- NOT IMPLEMENTED: and, or, not -- filterNone, all => RECORD [], matches => RECORD [attribute: Attribute] };Filter: TYPE = CHOICE FilterType OF { less, lessOrEqual, equal, notEqual, greaterOrEqual, greater => RECORD [attribute: Attribute, interpretation: Interpretation], -- interpretation ignored if attribute interpreted by -- implementor -- NOT YET IMPLEMENTED: (at least, not generally) and, or, not -- and, or => SEQUENCE OF RestrictedFilter, not => RestrictedFilter, filterNone, all => RECORD [], matches => RECORD [attribute: Attribute] };nullFilter: Filter = all[]; ScopeType: TYPE = { count(0), direction(1), filter(2), depth(4) };Scope: TYPE = CHOICE ScopeType OF { count => Count, depth => Depth, direction => Direction, filter => Filter };ScopeSequence: TYPE = SEQUENCE 4 OF Scope;-- Handles and Authentication --Credentials: TYPE = Authentication.Credentials;Verifier: TYPE = Authentication.Verifier;SimpleVerifier: TYPE = Authentication.SimpleVerifier;Handle: TYPE = ARRAY 2 OF UNSPECIFIED;nullHandle: Handle = [0,0];Session: TYPE = RECORD [token: ARRAY 2 OF UNSPECIFIED, verifier: Verifier ];-- Random Access --ByteAddress: TYPE = LONG CARDINAL;ByteCount: TYPE = LONG CARDINAL;endOfFile: LONG CARDINAL = 3777777777B; -- logical end of file --ByteRange: TYPE = RECORD [ firstByte: ByteAddress, count: ByteCount ];-- REMOTE ERRORS --ArgumentProblem: TYPE = { illegal(0), disallowed(1), unreasonable(2), unimplemented(3), duplicated(4), missing(5) };-- problem with an attribute type or value --AttributeTypeError: ERROR [ problem: ArgumentProblem, type: AttributeType] = 0;AttributeValueError: ERROR [ problem: ArgumentProblem, type: AttributeType] = 1;-- problem with an control type or value --ControlTypeError: ERROR [ problem: ArgumentProblem, type: ControlType] = 2;ControlValueError: ERROR [ problem: ArgumentProblem, type: ControlType] = 3;-- problem with an scope type or value --ScopeTypeError: ERROR [ problem: ArgumentProblem, type: ScopeType] = 4;ScopeValueError: ERROR [ problem: ArgumentProblem, type: ScopeType] = 5;-- problem in obtaining access to a file --AccessProblem: TYPE = { accessRightsInsufficient(0), accessRightsIndeterminate(1), fileChanged(2), fileDamaged(3), fileInUse(4), fileNotFound(5), fileOpen(6) };AccessError: ERROR [problem: AccessProblem] = 6;-- problem with a credentials or verifier --AuthenticationError: ERROR [problem: Authentication.Problem] = 7;-- problem with a BDT --ConnectionProblem: TYPE = { -- communication problems -- noRoute(0), noResponse(1), transmissionHardware(2), transportTimeout(3), -- resource problems -- tooManyLocalConnections(4), tooManyRemoteConnections(5), -- remote program implementation problems -- missingCourier(6), missingProgram(7), missingProcedure(8), protocolMismatch(9), parameterInconsistency(10), invalidMessage(11), returnTimedOut(12), -- miscellaneous -- otherCallProblem(177777B) };ConnectionError: ERROR [problem: ConnectionProblem] = 8;-- problem with file handle --HandleProblem: TYPE = { invalid(0), nullDisallowed(1), directoryRequired(2) };HandleError: ERROR [problem: HandleProblem] = 9;-- problem during insertion in directory or changing attributes --InsertionProblem: TYPE = { positionUnavailable(0), fileNotUnique(1), loopInHierarchy(2) };InsertionError: ERROR [problem: InsertionProblem] = 10;-- problem during random access operation --RangeError: ERROR [problem: ArgumentProblem] = 16;-- problem during logon or logoff --ServiceProblem: TYPE = { cannotAuthenticate(0), serviceFull(1), serviceUnavailable(2), sessionInUse(3) };ServiceError: ERROR [problem: ServiceProblem] = 11;-- problem with a session --SessionProblem: TYPE = { tokenInvalid(0), serviceAlreadySet(1) };SessionError: ERROR [problem: SessionProblem ] = 12;-- problem obtaining space for file contents or attributes --SpaceProblem: TYPE = { allocationExceeded(0), attributeAreaFull(1), mediumFull(2) };SpaceError: ERROR [problem: SpaceProblem ] = 13;-- problem during BDT --TransferProblem: TYPE = { aborted(0), checksumIncorrect(1), formatIncorrect(2), noRendezvous(3), wrongDirection(4) };TransferError: ERROR [problem: TransferProblem ] = 14;-- some undefined (and implementation-dependent) problem occurred --UndefinedProblem: TYPE = CARDINAL;UndefinedError: ERROR [problem: UndefinedProblem ] = 15;-- REMOTE PROCEDURES ---- Logging On and Off --Logon: PROCEDURE [ service: Clearinghouse.Name, credentials: Credentials, verifier: Verifier ] RETURNS [ session: Session ] REPORTS [ AuthenticationError, ServiceError, SessionError, UndefinedError ] = 0;Logoff: PROCEDURE [ session: Session ] REPORTS [ AuthenticationError, ServiceError, SessionError, UndefinedError ] = 1;Continue: PROCEDURE [ session: Session ] RETURNS [ continuance: CARDINAL ] REPORTS [ AuthenticationError, SessionError, UndefinedError ] = 19;-- Opening and Closing Files --Open: PROCEDURE [ attributes: AttributeSequence, directory: Handle, controls: ControlSequence, session: Session ] RETURNS [ file: Handle ] REPORTS [ AccessError, AttributeTypeError, AttributeValueError, AuthenticationError, ControlTypeError, ControlValueError, HandleError, SessionError, UndefinedError ] = 2;Close: PROCEDURE [ file: Handle, session: Session ] REPORTS [ AuthenticationError, HandleError, SessionError, UndefinedError ] = 3;-- Creating and Deleting Files --
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -