<> <> <> <> <<>> DIRECTORY Basics USING [LongNumber, ShortNumber], BasicTime USING [FromNSTime, GMT, OutOfRange], CrRPC, FilingP10V5, FilingAttributesP10V5 USING [FileID, InterpretedAttributeType], FilingP10V5ClientHack USING [MProc29, MProc4, GetError], RefText USING [InlineAppendChar, ObtainScratch], QuickFilingP10V5; QuickFilingP10V5Impl: CEDAR PROGRAM IMPORTS BasicTime, CrRPC, FilingP10V5ClientHack, RefText EXPORTS QuickFilingP10V5 ~ BEGIN OPEN FilingP10V5; IAT: TYPE ~ FilingAttributesP10V5.InterpretedAttributeType; createdOn: CARD32 ~ IAT.createdOn.ORD; dataSize: CARD32 ~ IAT.dataSize.ORD; fileID: CARD32 ~ IAT.fileID.ORD; isDirectory: CARD32 ~ IAT.isDirectory.ORD; name: CARD32 ~ IAT.name.ORD; numberOfChildren: CARD32 ~ IAT.numberOfChildren.ORD; pathname: CARD32 ~ IAT.pathname.ORD; type: CARD32 ~ IAT.type.ORD; version: CARD32 ~ IAT.version.ORD; QuickGetAttributes: PUBLIC PROC [h: CrRPC.Handle, file: Handle, types: AttributeTypeSequence, session: Session] RETURNS [vers: CARDINAL, bytes: INT, created: BasicTime.GMT, fileType: CARD, pathName: REF TEXT, fID: FilingAttributesP10V5.FileID, isDir: BOOL, numKids: CARD] = { PutArgs: CrRPC.PutArgsProc ~ { FOR i28: CARDINAL IN [0..2) DO CrRPC.PutCard16[s, file[i28]]; ENDLOOP; FilingP10V5ClientHack.MProc29[h, s, types]; FOR i30: CARDINAL IN [0..2) DO CrRPC.PutCard16[s, session.token[i30]]; ENDLOOP; FilingP10V5ClientHack.MProc4[h, s, session.verifier]; }; GetResults: CrRPC.GetResultsProc ~ { length: CARDINAL ~ CrRPC.GetCard16[s]; FOR i: CARDINAL IN [0..length) DO Get32: PROC RETURNS [num: CARD32] = INLINE { temp: Basics.LongNumber; len: CARDINAL ~ CrRPC.GetCard16[s]; IF len # 2 THEN ERROR; temp.hi _ CrRPC.GetCard16[s]; temp.lo _ CrRPC.GetCard16[s]; num _ temp.lc; }; attribute: Attribute; attribute.type _ CrRPC.GetCard32[s]; <> SELECT attribute.type FROM createdOn => { temp: CARD32 ~ Get32[]; created _ BasicTime.FromNSTime[temp ! BasicTime.OutOfRange => CONTINUE]; }; dataSize => bytes _ Get32[]; fileID => { len: CARDINAL ~ CrRPC.GetCard16[s]; IF len # 5 THEN ERROR; FOR i: CARDINAL IN [0 .. 5) DO fID[i] _ CrRPC.GetCard16[s]; ENDLOOP; }; isDirectory => { len: CARDINAL ~ CrRPC.GetCard16[s]; IF len # 1 THEN ERROR; isDir _ IF CrRPC.GetCard16[s] = 1 THEN TRUE ELSE FALSE; }; numberOfChildren => { len: CARDINAL ~ CrRPC.GetCard16[s]; IF len = 1 THEN numKids _ CrRPC.GetCard16[s]; }; pathname => { length: CARDINAL ~ CrRPC.GetCard16[s]; word, len: NAT _ 0; temp: Basics.ShortNumber; P: PROC [l: NAT] RETURNS[c: CHAR] = INLINE { IF l MOD 2 = 0 THEN {temp.sc _ CrRPC.GetCard16[s]; word _ word + 1; c _ VAL[temp.hi]} ELSE {c _ VAL[temp.lo]}; }; len _ CrRPC.GetCard16[s]; pathName _ RefText.ObtainScratch[len]; word _ word + 1; FOR i: NAT IN [0 .. len) DO char: CHAR ~ P[i]; pathName _ RefText.InlineAppendChar[pathName, char]; ENDLOOP; IF word # length THEN ERROR; }; type => fileType _ Get32[]; version => { len: CARDINAL ~ CrRPC.GetCard16[s]; IF len # 1 THEN ERROR; vers _ CrRPC.GetCard16[s]; }; ENDCASE => { -- the value was not one we are looking for so eat the data len: CARDINAL ~ CrRPC.GetCard16[s]; FOR j: CARDINAL IN [0..len) DO [] _ CrRPC.GetCard16[s]; ENDLOOP; }; ENDLOOP; }; CrRPC.Call[h~h, remotePgm~10, remotePgmVersion~5, remoteProc~8 , putArgs~PutArgs, getResults~GetResults, getError~FilingP10V5ClientHack.GetError]; }; END.