|
|
1.1 ! root 1: -- $Header: Filing5.cr,v 1.2 86/04/14 11:18:25 jqj Exp $ ! 2: ! 3: -- Note: this is a TEST version of Filing, and is not guaranteed to ! 4: -- match the official Xerox version at all. It does seem to be adequate ! 5: -- for FTP, however. ! 6: ! 7: -- $Log: Filing5.cr,v $ ! 8: -- Revision 1.2 86/04/14 11:18:25 jqj ! 9: -- fixed some nits ! 10: -- ! 11: -- Revision 1.1 86/03/12 10:33:01 jqj ! 12: -- Initial revision ! 13: -- ! 14: -- ! 15: ! 16: Filing: PROGRAM 10 VERSION 5 = ! 17: BEGIN ! 18: DEPENDS UPON ! 19: BulkData(0) VERSION 1, ! 20: Clearinghouse(2) VERSION 2, ! 21: Authentication(14) VERSION 1, -- should be V 2 -- ! 22: Time(15) VERSION 2; ! 23: ! 24: ! 25: ! 26: ! 27: -- TYPES AND CONSTANTS -- ! 28: ! 29: -- Attributes (individual attributes defined later) -- ! 30: ! 31: AttributeType: TYPE = LONG CARDINAL; ! 32: AttributeTypeSequence: TYPE = SEQUENCE OF AttributeType; ! 33: allAttributeTypes: AttributeTypeSequence = [37777777777B]; ! 34: Attribute: TYPE = RECORD [type: AttributeType, value: SEQUENCE OF UNSPECIFIED]; ! 35: AttributeSequence: TYPE = SEQUENCE OF Attribute; ! 36: ! 37: -- Controls -- ! 38: ! 39: ControlType: TYPE = {lockControl(0), timeoutControl(1), accessControl(2)}; ! 40: ControlTypeSequence: TYPE = SEQUENCE 3 OF ControlType; ! 41: ! 42: Lock: TYPE = {lockNone(0), share(1), exclusive(2)}; ! 43: ! 44: Timeout: TYPE = CARDINAL; -- in seconds -- ! 45: defaultTimeout: Timeout = 177777B; -- actual value impl.-dependent -- ! 46: ! 47: AccessType: TYPE = { ! 48: readAccess(0), writeAccess(1), ownerAccess(2), -- all files -- ! 49: addAccess(3), removeAccess(4) }; -- directories only -- ! 50: AccessSequence: TYPE = SEQUENCE 5 OF AccessType; ! 51: -- fullAccess: AccessSequence = [177777B]; -- ! 52: ! 53: Control: TYPE = CHOICE ControlType OF { ! 54: lockControl => Lock, ! 55: timeoutControl => Timeout, ! 56: accessControl => AccessSequence}; ! 57: ControlSequence: TYPE = SEQUENCE 3 OF Control; ! 58: ! 59: -- Scopes -- ! 60: ! 61: Count: TYPE = CARDINAL; ! 62: unlimitedCount: Count = 177777B; ! 63: ! 64: Depth: TYPE = CARDINAL; ! 65: allDescendants: Depth = 177777B; ! 66: ! 67: Direction: TYPE = {forward(0), backward(1)}; ! 68: ! 69: Interpretation: TYPE = { interpretationNone(0), boolean(1), cardinal(2), ! 70: longCardinal(3), time(4), integer(5), longInteger(6), string(7) }; ! 71: FilterType: TYPE = { ! 72: -- relations -- ! 73: less(0), lessOrEqual(1), equal(2), notEqual(3), greaterOrEqual(4), ! 74: greater(5), ! 75: -- logical -- ! 76: and(6), or(7), not(8), ! 77: -- constants -- ! 78: filterNone(9), all(10), ! 79: -- patterns -- ! 80: matches(11) }; ! 81: RestrictedFilter: TYPE = CHOICE FilterType OF { ! 82: less, lessOrEqual, equal, notEqual, greaterOrEqual, greater => ! 83: RECORD [attribute: Attribute, interpretation: Interpretation], ! 84: -- interpretation ignored if attribute interpreted by ! 85: -- implementor ! 86: -- NOT IMPLEMENTED: and, or, not -- ! 87: filterNone, all => RECORD [], ! 88: matches => RECORD [attribute: Attribute] }; ! 89: Filter: TYPE = CHOICE FilterType OF { ! 90: less, lessOrEqual, equal, notEqual, greaterOrEqual, greater => ! 91: RECORD [attribute: Attribute, interpretation: Interpretation], ! 92: -- interpretation ignored if attribute interpreted by ! 93: -- implementor ! 94: -- NOT YET IMPLEMENTED: (at least, not generally) and, or, not -- ! 95: and, or => SEQUENCE OF RestrictedFilter, ! 96: not => RestrictedFilter, ! 97: filterNone, all => RECORD [], ! 98: matches => RECORD [attribute: Attribute] }; ! 99: nullFilter: Filter = all[]; ! 100: ! 101: ScopeType: TYPE = { count(0), direction(1), filter(2), depth(3) }; ! 102: Scope: TYPE = CHOICE ScopeType OF { ! 103: count => Count, ! 104: depth => Depth, ! 105: direction => Direction, ! 106: filter => Filter }; ! 107: ScopeSequence: TYPE = SEQUENCE 4 OF Scope; ! 108: ! 109: -- Handles and Authentication -- ! 110: ! 111: Credentials: TYPE = Authentication.Credentials; ! 112: Verifier: TYPE = Authentication.Verifier; ! 113: SimpleVerifier: TYPE = Authentication.SimpleVerifier; ! 114: ! 115: Handle: TYPE = ARRAY 2 OF UNSPECIFIED; ! 116: nullHandle: Handle = [0,0]; -- meaning depends on operation -- ! 117: ! 118: Session: TYPE = RECORD [token: ARRAY 2 OF UNSPECIFIED, verifier: Verifier ]; ! 119: ! 120: -- RANDOM ACCESS -- ! 121: ByteAddress: TYPE = LONG CARDINAL; ! 122: ByteCount: TYPE = LONG CARDINAL; ! 123: endOfFile: LONG CARDINAL = 37777777777B; -- logical end of file -- ! 124: ByteRange: TYPE = RECORD [firstByte: ByteAddress, count: ByteCount]; ! 125: ! 126: -- REMOTE ERRORS -- ! 127: ! 128: ArgumentProblem: TYPE = { ! 129: illegal(0), ! 130: disallowed(1), ! 131: unreasonable(2), ! 132: unimplemented(3), ! 133: duplicated(4), ! 134: argMissing(5) }; ! 135: ! 136: -- problem with an attribute type or value -- ! 137: AttributeTypeError: ERROR [ problem: ArgumentProblem, type: AttributeType] ! 138: = 0; ! 139: AttributeValueError: ERROR [ problem: ArgumentProblem, type: AttributeType] ! 140: = 1; ! 141: ! 142: -- problem with an control type or value -- ! 143: ControlTypeError: ERROR [ problem: ArgumentProblem, type: ControlType] ! 144: = 2; ! 145: ControlValueError: ERROR [ problem: ArgumentProblem, type: ControlType] ! 146: = 3; ! 147: ! 148: -- problem with an scope type or value -- ! 149: ScopeTypeError: ERROR [ problem: ArgumentProblem, type: ScopeType] ! 150: = 4; ! 151: ScopeValueError: ERROR [ problem: ArgumentProblem, type: ScopeType] ! 152: = 5; ! 153: ! 154: -- problem in obtaining access to a file -- ! 155: AccessProblem: TYPE = { ! 156: accessRightsInsufficient(0), ! 157: accessRightsIndeterminate(1), ! 158: fileChanged(2), ! 159: fileDamaged(3), ! 160: fileInUse(4), ! 161: fileNotFound(5), ! 162: fileOpen(6) }; ! 163: AccessError: ERROR [problem: AccessProblem] = 6; ! 164: ! 165: -- problem with a credentials or verifier -- ! 166: AuthenticationError: ERROR [problem: Authentication.Problem] = 7; ! 167: ! 168: -- problem with a BDT -- ! 169: ConnectionProblem: TYPE = { ! 170: -- communication problems -- ! 171: noRoute(0), ! 172: noResponse(1), ! 173: transmissionHardware(2), ! 174: transportTimeout(3), ! 175: -- resource problems -- ! 176: tooManyLocalConnections(4), ! 177: tooManyRemoteConnections(5), ! 178: -- remote program implementation problems -- ! 179: missingCourier(6), ! 180: missingProgram(7), ! 181: missingProcedure(8), ! 182: protocolMismatch(9), ! 183: parameterInconsistency(10), ! 184: invalidMessage(11), ! 185: returnTimedOut(12), ! 186: -- miscellaneous -- ! 187: otherCallProblem(177777B) }; ! 188: ConnectionError: ERROR [problem: ConnectionProblem] = 8; ! 189: ! 190: -- problem with file handle -- ! 191: HandleProblem: TYPE = { ! 192: invalid(0), ! 193: nullDisallowed(1), ! 194: directoryRequired(2) }; ! 195: HandleError: ERROR [problem: HandleProblem] = 9; ! 196: ! 197: -- problem during insertion in directory or changing attributes -- ! 198: InsertionProblem: TYPE = { ! 199: positionUnavailable(0), ! 200: fileNotUnique(1), ! 201: loopInHierarchy(2) }; ! 202: InsertionError: ERROR [problem: InsertionProblem] = 10; ! 203: ! 204: -- problem during random access operation -- ! 205: RangeError: ERROR [problem: ArgumentProblem] = 16; ! 206: ! 207: -- problem during logon or logoff -- ! 208: ServiceProblem: TYPE = { ! 209: cannotAuthenticate(0), ! 210: serviceFull(1), ! 211: serviceUnavailable(2), ! 212: sessionInUse(3) }; ! 213: ServiceError: ERROR [problem: ServiceProblem] = 11; ! 214: ! 215: -- problem with a session -- ! 216: SessionProblem: TYPE = { ! 217: tokenInvalid(0), ! 218: serviceAlreadySet(1) }; ! 219: SessionError: ERROR [problem: SessionProblem ] = 12; ! 220: ! 221: -- problem obtaining space for file contents or attributes -- ! 222: SpaceProblem: TYPE = { ! 223: allocationExceeded(0), ! 224: attributeAreadFull(1), ! 225: mediumFull(2) }; ! 226: SpaceError: ERROR [problem: SpaceProblem ] = 13; ! 227: ! 228: -- problem during BDT -- ! 229: TransferProblem: TYPE = { ! 230: aborted(0), ! 231: checksumIncorrect(1), ! 232: formatIncorrect(2), ! 233: noRendevous(3), ! 234: wrongDirection(4) }; ! 235: TransferError: ERROR [problem: TransferProblem ] = 14; ! 236: ! 237: -- some undefined (and implementation-dependent) problem occurred -- ! 238: UndefinedProblem: TYPE = CARDINAL; ! 239: UndefinedError: ERROR [problem: UndefinedProblem ] = 15; ! 240: ! 241: ! 242: ! 243: ! 244: -- REMOTE PROCEDURES -- ! 245: ! 246: -- Logging On and Off -- ! 247: ! 248: Logon: PROCEDURE [ ! 249: service: Clearinghouse.Name, credentials: Credentials, ! 250: verifier: Verifier ] ! 251: RETURNS [ session: Session ] ! 252: REPORTS [ AuthenticationError, ServiceError, SessionError, ! 253: UndefinedError ] ! 254: = 0; ! 255: ! 256: Logoff: PROCEDURE [ session: Session ] ! 257: REPORTS [ AuthenticationError, ServiceError, SessionError, ! 258: UndefinedError ] ! 259: = 1; ! 260: ! 261: Continue: PROCEDURE [ session: Session ] ! 262: RETURNS [ continuance: CARDINAL ] ! 263: REPORTS [ AuthenticationError, SessionError, UndefinedError ] ! 264: = 19; ! 265: ! 266: -- Opening and Closing Files -- ! 267: ! 268: Open: PROCEDURE [ attributes: AttributeSequence, directory: Handle, ! 269: controls: ControlSequence, session: Session ] ! 270: RETURNS [ file: Handle ] ! 271: REPORTS [ AccessError, AttributeTypeError, AttributeValueError, ! 272: AuthenticationError, ControlTypeError, ControlValueError, ! 273: HandleError, SessionError, UndefinedError ] ! 274: = 2; ! 275: ! 276: Close: PROCEDURE [ file: Handle, session: Session ] ! 277: REPORTS [ AuthenticationError, HandleError, SessionError, ! 278: UndefinedError ] ! 279: = 3; ! 280: ! 281: -- Creating and Deleting Files -- ! 282: ! 283: Create: PROCEDURE [ directory: Handle, attributes: AttributeSequence, ! 284: controls: ControlSequence, session: Session ] ! 285: RETURNS [ file: Handle ] ! 286: REPORTS [ AccessError, AttributeTypeError, AttributeValueError, ! 287: AuthenticationError, ControlTypeError, ControlValueError, ! 288: HandleError, InsertionError, SessionError, SpaceError, ! 289: UndefinedError ] ! 290: = 4; ! 291: ! 292: Delete: PROCEDURE [ file: Handle, session: Session ] ! 293: REPORTS [AccessError, AuthenticationError, HandleError, SessionError, ! 294: UndefinedError ] ! 295: = 5; ! 296: ! 297: -- Getting and Changing Controls (transient) -- ! 298: ! 299: GetControls: PROCEDURE [ file: Handle, types: ControlTypeSequence, ! 300: session: Session ] ! 301: RETURNS [ controls: ControlSequence ] ! 302: REPORTS [AccessError, AttributeTypeError, AuthenticationError, ! 303: ControlTypeError, ! 304: HandleError, SessionError, UndefinedError ] ! 305: = 6; ! 306: ! 307: ChangeControls: PROCEDURE [ file: Handle, controls: ControlSequence, ! 308: session: Session ] ! 309: REPORTS [AccessError, AttributeTypeError, AuthenticationError, ! 310: ControlTypeError, ControlValueError, ! 311: HandleError, SessionError, UndefinedError ] ! 312: = 7; ! 313: ! 314: ! 315: -- Getting and Changing Attributes (permanent) -- ! 316: ! 317: GetAttributes: PROCEDURE [ file: Handle, types: AttributeTypeSequence, ! 318: session: Session ] ! 319: RETURNS [ attributes: AttributeSequence ] ! 320: REPORTS [AccessError, AttributeTypeError, AuthenticationError, ! 321: HandleError, SessionError, UndefinedError ] ! 322: = 8; ! 323: ! 324: ChangeAttributes: PROCEDURE [file: Handle, attributes: AttributeSequence, ! 325: session: Session ] ! 326: REPORTS [AccessError, AttributeTypeError, AuthenticationError, ! 327: HandleError, SessionError, SpaceError, UndefinedError ] ! 328: = 9; ! 329: ! 330: UnifyAccessLists: PROCEDURE [directory: Handle, session: Session ] ! 331: REPORTS [AccessError, AuthenticationError, HandleError, SessionError, ! 332: UndefinedError ] ! 333: = 20; ! 334: ! 335: -- Copying and Moving Files -- ! 336: ! 337: Copy: PROCEDURE [ file, destinationDirectory: Handle , ! 338: attributes: AttributeSequence, controls: ControlSequence, ! 339: awaaion: Session ] ! 340: RETURNS [ newFile: Handle ] ! 341: REPORTS [AccessError, AttributeTypeError, AttributeValueError, ! 342: AuthenticationError, ControlTypeError, ControlValueError, ! 343: HandleError, InsertionError, SessionError, SpaceError, ! 344: UndefinedError ] ! 345: = 10; ! 346: ! 347: Move: PROCEDURE [ file, destinationDirectory: Handle , ! 348: attributes: AttributeSequence, controls: ControlSequence, ! 349: awaaion: Session ] ! 350: RETURNS [ newFile: Handle ] ! 351: REPORTS [AccessError, AttributeTypeError, AttributeValueError, ! 352: AuthenticationError, HandleError, InsertionError, ! 353: SessionError, SpaceError, UndefinedError ] ! 354: = 11; ! 355: ! 356: -- Transfering Bulk Data (File Content) -- ! 357: ! 358: Store: PROCEDURE [ directory: Handle, attributes: AttributeSequence, ! 359: controls: ControlSequence, content: BulkData.Source, ! 360: session: Session ] ! 361: RETURNS [ file: Handle ] ! 362: REPORTS [AccessError, AttributeTypeError, AttributeValueError, ! 363: AuthenticationError, ConnectionError, ControlTypeError, ! 364: ControlValueError, HandleError, InsertionError, SessionError, ! 365: SpaceError, TransferError, UndefinedError ] ! 366: = 12; ! 367: ! 368: Retrieve: PROCEDURE [ file: Handle, content: BulkData.Sink, session: Session ] ! 369: REPORTS [AccessError, AuthenticationError, ConnectionError, ! 370: HandleError, SessionError, SpaceError, TransferError, ! 371: UndefinedError ] ! 372: = 13; ! 373: ! 374: Replace: PROCEDURE [ file: Handle, attributes: AttributeSequence, ! 375: content: BulkData.Source, session: Session ] ! 376: REPORTS [AccessError, AttributeTypeError, AttributeValueError, ! 377: AuthenticationError, ConnectionError, HandleError, ! 378: SessionError, SpaceError, TransferError, UndefinedError ] ! 379: = 14; ! 380: ! 381: -- Transferring Bulk Data (Serialized Files) -- ! 382: ! 383: -- NOT YET IMPLEMENTED -- ! 384: ! 385: -- Random Access to File Data -- ! 386: ! 387: RetrieveBytes: PROCEDURE [file: Handle, range: ByteRange, sink: BulkData.Sink, ! 388: session: Session ] ! 389: REPORTS [AccessError, HandleError, RangeError, SessionError, ! 390: UndefinedError ] ! 391: = 22; ! 392: ! 393: ReplaceBytes: PROCEDURE [file: Handle, range: ByteRange, ! 394: source: BulkData.Source, session: Session ] ! 395: REPORTS [AccessError, HandleError, RangeError, SessionError, ! 396: SpaceError, UndefinedError ] ! 397: = 23; ! 398: ! 399: ! 400: -- Locating and Listing Files in a Directory -- ! 401: ! 402: Find: PROCEDURE [ directory: Handle, scope: ScopeSequence, ! 403: controls: ControlSequence, session: Session ] ! 404: RETURNS [ file: Handle ] ! 405: REPORTS [ AccessError, AuthenticationError, ConnectionError, ! 406: ControlTypeError, ControlValueError, HandleError, ! 407: ScopeTypeError, ScopeValueError, ! 408: SessionError, UndefinedError ] ! 409: = 17; ! 410: ! 411: List: PROCEDURE [ directory: Handle, types: AttributeTypeSequence, ! 412: scope: ScopeSequence, listing: BulkData.Sink, ! 413: session: Session ] ! 414: REPORTS [ AccessError, AttributeTypeError, ! 415: AuthenticationError, ConnectionError, ! 416: HandleError, ! 417: ScopeTypeError, ScopeValueError, ! 418: SessionError, TransferError, UndefinedError ] ! 419: = 18; ! 420: ! 421: ! 422: ! 423: ! 424: ! 425: -- INTERPRETED ATTRIBUTE DEFINITIONS -- ! 426: ! 427: -- common definitions -- ! 428: ! 429: Time: TYPE = Time.Time; -- seconds -- ! 430: nullTime: Time = Time.earliestTime; ! 431: ! 432: User: TYPE = Clearinghouse.Name; ! 433: ! 434: -- attributes -- ! 435: ! 436: accessList: AttributeType = 19; ! 437: AccessEntry: TYPE = RECORD [key: Clearinghouse.Name, access: AccessSequence]; ! 438: AccessList: TYPE = RECORD [entries: SEQUENCE OF AccessEntry, defaulted: BOOLEAN]; ! 439: ! 440: checksum: AttributeType = 0; ! 441: Checksum: TYPE = CARDINAL; ! 442: unknownChecksum: Checksum = 177777B; ! 443: ! 444: childrenUniquelyNamed: AttributeType = 1; ! 445: ChildrenUniquelyNamed: TYPE = BOOLEAN; ! 446: ! 447: createdBy: AttributeType = 2; ! 448: CreatedBy: TYPE = User; ! 449: ! 450: createdOn: AttributeType = 3; ! 451: CreatedOn: TYPE = Time; ! 452: ! 453: dataSize: AttributeType = 16; ! 454: DataSize: TYPE = LONG CARDINAL; ! 455: ! 456: defaultAccessList: AttributeType = 20; ! 457: DefaultAccessList: TYPE = AccessList; ! 458: ! 459: fileID: AttributeType = 4; ! 460: FileID: TYPE = ARRAY 5 OF UNSPECIFIED; ! 461: nullFileID: FileID = [0,0,0,0,0]; ! 462: ! 463: isDirectory: AttributeType = 5; ! 464: IsDirectory: TYPE = BOOLEAN; ! 465: ! 466: isTemporary: AttributeType = 6; ! 467: IsTemporary: TYPE = BOOLEAN; ! 468: ! 469: modifiedBy: AttributeType = 7; ! 470: ModifiedBy: TYPE = User; ! 471: ! 472: modifiedOn: AttributeType = 8; ! 473: ModifiedOn: TYPE = Time; ! 474: ! 475: name: AttributeType = 9; -- name relative to parent -- ! 476: Name: TYPE = STRING; -- must not exceed 100 bytes -- ! 477: ! 478: numberOfChildren: AttributeType = 10; ! 479: NumberOfChildren: TYPE = CARDINAL; ! 480: ! 481: ordering: AttributeType = 11; ! 482: Ordering: TYPE = RECORD [key: AttributeType, ascending: BOOLEAN, ! 483: interpretation: Interpretation]; ! 484: -- see below for defaultOrdering, byAscendingPosition, byDescendingPosition -- ! 485: ! 486: parentID: AttributeType = 12; ! 487: ParentID: TYPE = FileID; ! 488: ! 489: pathname: AttributeType = 21; ! 490: Pathname: TYPE = STRING; ! 491: ! 492: position: AttributeType = 11; ! 493: Position: TYPE = SEQUENCE 100 OF UNSPECIFIED; ! 494: firstPosition: Position = [0]; ! 495: lastPosition: Position = [177777B]; ! 496: ! 497: readBy: AttributeType = 14; ! 498: ReadBy: TYPE = User; ! 499: ! 500: readOn: AttributeType = 15; ! 501: ReadOn: TYPE = Time; ! 502: ! 503: storedSize: AttributeType = 26; ! 504: StoredSize: TYPE = LONG CARDINAL; ! 505: ! 506: subtreeSize: AttributeType = 23; ! 507: SubtreeSize: TYPE = LONG CARDINAL; ! 508: ! 509: subtreeSizeLimit: AttributeType = 24; ! 510: SubtreeSizeLimit: TYPE = LONG CARDINAL; ! 511: nullSubtreeSizeLimit: SubtreeSizeLimit = 37777777777B; ! 512: ! 513: type: AttributeType = 17; ! 514: Type: TYPE = LONG CARDINAL; ! 515: ! 516: version: AttributeType = 18; ! 517: Version: TYPE = CARDINAL; ! 518: lowestVersion: Version = 0; ! 519: highestVersion: Version = 177777B; ! 520: ! 521: defaultOrdering: Ordering = [key: name, ascending: TRUE, interpretation: ! 522: string]; ! 523: byAscendingPosition: Ordering = [key: position, ascending: TRUE, ! 524: interpretation: interpretationNone]; ! 525: byDescendingPosition: Ordering = [key: position, ascending: FALSE, ! 526: interpretation: interpretationNone]; ! 527: ! 528: ! 529: ! 530: ! 531: -- BULK DATA FORMATS -- ! 532: ! 533: -- NOT YET IMPLEMENTED -- ! 534: ! 535: ! 536: -- Attribute Series Format, used in List -- ! 537: ! 538: StreamOfAttributeSequence: TYPE = CHOICE OF { ! 539: nextSegment(0) => RECORD [ ! 540: segment: SEQUENCE OF AttributeSequence, ! 541: restOfStream: StreamOfAttributeSequence], ! 542: lastSegment(1) => SEQUENCE OF AttributeSequence}; ! 543: ! 544: ! 545: ! 546: ! 547: ! 548: -- FILE TYPES -- ! 549: ! 550: tUnspecified: Type = 0; ! 551: tDirectory: Type = 1; ! 552: tText: Type = 2; ! 553: tSerialized: Type = 3; ! 554: tEmpty: Type = 4; ! 555: tAscii: Type = 6; ! 556: ! 557: END. -- of Filing --
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.