-- TabPostOfficeGetPutImpl.mesa -- Please do not edit this file. -- It was generated using CedarRPCGen. DIRECTORY Rope, SunRPC, TabPostOffice, TabPostOfficeGetPut; TabPostOfficeGetPutImpl: CEDAR PROGRAM IMPORTS SunRPC EXPORTS TabPostOffice, TabPostOfficeGetPut = BEGIN Handle: TYPE = SunRPC.Handle; ROPE: TYPE = Rope.ROPE; GetErrorInfo: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.ErrorInfo] = { res.errno _ SunRPC.GetInt32[h]; res.msg _ SunRPC.GetRope[h]; }; PutErrorInfo: PUBLIC PROC[h: Handle, in: TabPostOffice.ErrorInfo] = { SunRPC.PutInt32[h, in.errno]; SunRPC.PutRope[h, in.msg]; }; GetProperty: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Property] = { res _ SunRPC.GetRope[h]; }; PutProperty: PUBLIC PROC[h: Handle, in: TabPostOffice.Property] = { SunRPC.PutRope[h, in]; }; GetRelation: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Relation] = { res _ SunRPC.GetRope[h]; }; PutRelation: PUBLIC PROC[h: Handle, in: TabPostOffice.Relation] = { SunRPC.PutRope[h, in]; }; GetValue: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Value] = { res _ SunRPC.GetRope[h]; }; PutValue: PUBLIC PROC[h: Handle, in: TabPostOffice.Value] = { SunRPC.PutRope[h, in]; }; GetPropertyArray: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.PropertyArray] = { { len: INT _ SunRPC.GetInt32[h]; res _ NEW[TabPostOffice.SeqType0Object[len]]; FOR i: INT IN [0..len) DO res[i] _ GetProperty[h]; ENDLOOP; }; }; PutPropertyArray: PUBLIC PROC[h: Handle, in: TabPostOffice.PropertyArray] = { SunRPC.PutInt32[h, in.size]; FOR i: INT IN [0..in.size) DO PutProperty[h, in[i]]; ENDLOOP; }; GetPropInfo: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.PropInfo] = { res.p _ GetProperty[h]; res.r _ GetRelation[h]; res.v _ GetValue[h]; }; PutPropInfo: PUBLIC PROC[h: Handle, in: TabPostOffice.PropInfo] = { PutProperty[h, in.p]; PutRelation[h, in.r]; PutValue[h, in.v]; }; GetPropInfoArray: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.PropInfoArray] = { { len: INT _ SunRPC.GetInt32[h]; res _ NEW[TabPostOffice.SeqType1Object[len]]; FOR i: INT IN [0..len) DO res[i] _ GetPropInfo[h]; ENDLOOP; }; }; PutPropInfoArray: PUBLIC PROC[h: Handle, in: TabPostOffice.PropInfoArray] = { SunRPC.PutInt32[h, in.size]; FOR i: INT IN [0..in.size) DO PutPropInfo[h, in[i]]; ENDLOOP; }; GetMsgID: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.MsgID] = { res _ SunRPC.GetInt32[h]; }; PutMsgID: PUBLIC PROC[h: Handle, in: TabPostOffice.MsgID] = { SunRPC.PutInt32[h, in]; }; GetPriority: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Priority] = { res _ SunRPC.GetInt32[h]; }; PutPriority: PUBLIC PROC[h: Handle, in: TabPostOffice.Priority] = { SunRPC.PutInt32[h, in]; }; GetFilter: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Filter] = { res _ SunRPC.GetRope[h]; }; PutFilter: PUBLIC PROC[h: Handle, in: TabPostOffice.Filter] = { SunRPC.PutRope[h, in]; }; GetFilterSet: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.FilterSet] = { { len: INT _ SunRPC.GetInt32[h]; res _ NEW[TabPostOffice.SeqType2Object[len]]; FOR i: INT IN [0..len) DO res[i] _ GetFilter[h]; ENDLOOP; }; }; PutFilterSet: PUBLIC PROC[h: Handle, in: TabPostOffice.FilterSet] = { SunRPC.PutInt32[h, in.size]; FOR i: INT IN [0..in.size) DO PutFilter[h, in[i]]; ENDLOOP; }; GetFolder: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Folder] = { res _ SunRPC.GetRope[h]; }; PutFolder: PUBLIC PROC[h: Handle, in: TabPostOffice.Folder] = { SunRPC.PutRope[h, in]; }; GetFolders: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Folders] = { { len: INT _ SunRPC.GetInt32[h]; res _ NEW[TabPostOffice.SeqType3Object[len]]; FOR i: INT IN [0..len) DO res[i] _ GetFolder[h]; ENDLOOP; }; }; PutFolders: PUBLIC PROC[h: Handle, in: TabPostOffice.Folders] = { SunRPC.PutInt32[h, in.size]; FOR i: INT IN [0..in.size) DO PutFolder[h, in[i]]; ENDLOOP; }; GetTime: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Time] = { res _ SunRPC.GetInt32[h]; }; PutTime: PUBLIC PROC[h: Handle, in: TabPostOffice.Time] = { SunRPC.PutInt32[h, in]; }; StatusNames: PUBLIC ARRAY TabPostOffice.Status OF ROPE _ [ "New", "Unread", "Read" ]; GetStatus: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Status] = { res _ VAL[SunRPC.GetInt32[h]]; }; PutStatus: PUBLIC PROC[h: Handle, in: TabPostOffice.Status] = { SunRPC.PutInt32[h, ORD[in]]; }; WhencesNames: PUBLIC ARRAY TabPostOffice.Whences OF ROPE _ [ "BOM", "BOB" ]; GetWhences: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Whences] = { res _ VAL[SunRPC.GetInt32[h]]; }; PutWhences: PUBLIC PROC[h: Handle, in: TabPostOffice.Whences] = { SunRPC.PutInt32[h, ORD[in]]; }; GetSessionInfo: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.SessionInfo] = { res.numselects _ SunRPC.GetInt32[h]; res.plist _ GetPropInfoArray[h]; res.numorders _ SunRPC.GetInt32[h]; res.olist _ GetPropertyArray[h]; }; PutSessionInfo: PUBLIC PROC[h: Handle, in: TabPostOffice.SessionInfo] = { SunRPC.PutInt32[h, in.numselects]; PutPropInfoArray[h, in.plist]; SunRPC.PutInt32[h, in.numorders]; PutPropertyArray[h, in.olist]; }; GetSessionResult: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.SessionResult] = { res.total _ SunRPC.GetInt32[h]; res.new _ SunRPC.GetInt32[h]; res.unread _ SunRPC.GetInt32[h]; res.loPri _ GetPriority[h]; res.hiPri _ GetPriority[h]; res.lastModifyTime _ GetTime[h]; res.lastAccessTime _ GetTime[h]; res.e _ GetErrorInfo[h]; }; PutSessionResult: PUBLIC PROC[h: Handle, in: TabPostOffice.SessionResult] = { SunRPC.PutInt32[h, in.total]; SunRPC.PutInt32[h, in.new]; SunRPC.PutInt32[h, in.unread]; PutPriority[h, in.loPri]; PutPriority[h, in.hiPri]; PutTime[h, in.lastModifyTime]; PutTime[h, in.lastAccessTime]; PutErrorInfo[h, in.e]; }; GetMsgIDRange: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.MsgIDRange] = { res.beginId _ GetMsgID[h]; res.endId _ GetMsgID[h]; }; PutMsgIDRange: PUBLIC PROC[h: Handle, in: TabPostOffice.MsgIDRange] = { PutMsgID[h, in.beginId]; PutMsgID[h, in.endId]; }; GetMsgInfo: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.MsgInfo] = { res.msgId _ GetMsgID[h]; res.from _ SunRPC.GetRope[h]; res.to _ SunRPC.GetRope[h]; res.cc _ SunRPC.GetRope[h]; res.date _ SunRPC.GetRope[h]; res.subject _ SunRPC.GetRope[h]; res.priority _ GetPriority[h]; res.filters _ GetFilterSet[h]; res.status _ GetStatus[h]; res.bodyLength _ SunRPC.GetInt32[h]; res.bodyLines _ SunRPC.GetInt32[h]; }; PutMsgInfo: PUBLIC PROC[h: Handle, in: TabPostOffice.MsgInfo] = { PutMsgID[h, in.msgId]; SunRPC.PutRope[h, in.from]; SunRPC.PutRope[h, in.to]; SunRPC.PutRope[h, in.cc]; SunRPC.PutRope[h, in.date]; SunRPC.PutRope[h, in.subject]; PutPriority[h, in.priority]; PutFilterSet[h, in.filters]; PutStatus[h, in.status]; SunRPC.PutInt32[h, in.bodyLength]; SunRPC.PutInt32[h, in.bodyLines]; }; GetMsgInfos: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.MsgInfos] = { { len: INT _ SunRPC.GetInt32[h]; res _ NEW[TabPostOffice.SeqType4Object[len]]; FOR i: INT IN [0..len) DO res[i] _ GetMsgInfo[h]; ENDLOOP; }; }; PutMsgInfos: PUBLIC PROC[h: Handle, in: TabPostOffice.MsgInfos] = { SunRPC.PutInt32[h, in.size]; FOR i: INT IN [0..in.size) DO PutMsgInfo[h, in[i]]; ENDLOOP; }; GetMsgInfoResult: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.MsgInfoResult] = { res.info _ GetMsgInfos[h]; res.e _ GetErrorInfo[h]; }; PutMsgInfoResult: PUBLIC PROC[h: Handle, in: TabPostOffice.MsgInfoResult] = { PutMsgInfos[h, in.info]; PutErrorInfo[h, in.e]; }; GetMsgTextInfo: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.MsgTextInfo] = { res.msgId _ GetMsgID[h]; res.beginByte _ SunRPC.GetInt32[h]; res.numBytes _ SunRPC.GetInt32[h]; res.whence _ GetWhences[h]; }; PutMsgTextInfo: PUBLIC PROC[h: Handle, in: TabPostOffice.MsgTextInfo] = { PutMsgID[h, in.msgId]; SunRPC.PutInt32[h, in.beginByte]; SunRPC.PutInt32[h, in.numBytes]; PutWhences[h, in.whence]; }; GetMsgTextResult: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.MsgTextResult] = { res.body _ SunRPC.GetRope[h]; res.e _ GetErrorInfo[h]; }; PutMsgTextResult: PUBLIC PROC[h: Handle, in: TabPostOffice.MsgTextResult] = { SunRPC.PutRope[h, in.body]; PutErrorInfo[h, in.e]; }; GetNewMailResult: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.NewMailResult] = { res.newMail _ SunRPC.GetInt32[h] # 0; res.e _ GetErrorInfo[h]; }; PutNewMailResult: PUBLIC PROC[h: Handle, in: TabPostOffice.NewMailResult] = { SunRPC.PutInt32[h, IF in.newMail THEN 1 ELSE 0]; PutErrorInfo[h, in.e]; }; GetFoldersResult: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.FoldersResult] = { res.folders _ GetFolders[h]; res.numFolders _ SunRPC.GetInt32[h]; res.e _ GetErrorInfo[h]; }; PutFoldersResult: PUBLIC PROC[h: Handle, in: TabPostOffice.FoldersResult] = { PutFolders[h, in.folders]; SunRPC.PutInt32[h, in.numFolders]; PutErrorInfo[h, in.e]; }; GetMark: PUBLIC PROC[h: Handle] RETURNS [res: TabPostOffice.Mark] = { res.msgId _ GetMsgID[h]; res.markID _ SunRPC.GetRope[h]; res.markMsg _ SunRPC.GetRope[h]; }; PutMark: PUBLIC PROC[h: Handle, in: TabPostOffice.Mark] = { PutMsgID[h, in.msgId]; SunRPC.PutRope[h, in.markID]; SunRPC.PutRope[h, in.markMsg]; }; END.