-- HeaderContentsP0V0ClientImpl.Mesa
-- Copyright Ó 1991 by Xerox Corporation. All rights reserved.
 -- Copyright (C) 1989 by Xerox Corporation. All rights reserved.
 -- Generated by Willie-sue.pa at February 13, 1989 6:53:55 pm PST
 -- using Sirocco [2.0] of February 10, 1989 6:26:26 pm PST

DIRECTORY
 CrRPC,
 MailFormatP1516V3,
 CHNameP2V0,
 MailTransportP17V5,
 HeaderContentsP0V0;

HeaderContentsP0V0ClientImpl: CEDAR PROGRAM
 IMPORTS CrRPC
 EXPORTS HeaderContentsP0V0 ~ {
 OPEN HeaderContentsP0V0;

GetError: CrRPC.GetErrorProc ~ {
  ERROR CrRPC.Error[h, remoteError, "Unexpected Remote Error"];
  };

-- Remote Procedures --

 ForwardedHeadingsFromAttr: PUBLIC ForwardedHeadingsFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc2[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~20 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 CopyRecipientsFromAttr: PUBLIC CopyRecipientsFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc3[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~5 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 BlindCopyRecipientsFromAttr: PUBLIC BlindCopyRecipientsFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc3[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~6 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 SubjectFromAttr: PUBLIC SubjectFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ CrRPC.GetRope[s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~10 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 TextAnnotationFromAttr: PUBLIC TextAnnotationFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ CrRPC.GetRope[s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~19 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 PrimaryRecipientsFromAttr: PUBLIC PrimaryRecipientsFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc3[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~4 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 InReplyToFromAttr: PUBLIC InReplyToFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value.originator ¬ UProc4[h, s];
   value.uniqueString ¬ CrRPC.GetRope[s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~7 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 AutoforwardedFromAttr: PUBLIC AutoforwardedFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ CrRPC.GetBool[s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~16 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 ImportanceFromAttr: PUBLIC ImportanceFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ VAL[CrRPC.GetCard16[s]];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~14 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 ObsoletesFromAttr: PUBLIC ObsoletesFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc5[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~8 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 AuthorizingUsersFromAttr: PUBLIC AuthorizingUsersFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc3[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~3 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 ExpiryDateFromAttr: PUBLIC ExpiryDateFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ CrRPC.GetCard32[s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~11 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 CrossReferencesFromAttr: PUBLIC CrossReferencesFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc5[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~9 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 SensitivityFromAttr: PUBLIC SensitivityFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ VAL[CrRPC.GetCard16[s]];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~15 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 ReplyRequestFromAttr: PUBLIC ReplyRequestFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc3[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~18 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 ImmutableFromAttr: PUBLIC ImmutableFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value.null ¬ 0;
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~17 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 HeadingFromBodyPart: PUBLIC HeadingFromBodyPartType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   CrRPC.PutRope[s, bits];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc6[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~0 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 MessageIDFromAttr: PUBLIC MessageIDFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value.originator ¬ UProc4[h, s];
   value.uniqueString ¬ CrRPC.GetRope[s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~1 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 ReplyByFromAttr: PUBLIC ReplyByFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ CrRPC.GetCard32[s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~12 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 ReplyToUsersFromAttr: PUBLIC ReplyToUsersFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc3[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~13 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

 OriginatorFromAttr: PUBLIC OriginatorFromAttrType ~ {
  PutArgs: CrRPC.PutArgsProc ~ {
   MProc1[h, s, attr];
   };
  GetResults: CrRPC.GetResultsProc ~ {
   length ¬ CrRPC.GetCard16[s];
   value ¬ UProc4[h, s];
   };
   
  CrRPC.Call[h~h, remotePgm~0, remotePgmVersion~0, remoteProc~2 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
  };

-- Unmarshal / Marshal Procs --


 UProc3: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailFormatP1516V3.RNameList] ~ {
  {
   length8: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailFormatP1516V3.RNameListObject[length8]];
   FOR i7: CARDINAL IN [0..length8) DO
    res.body[i7] ¬ UProc4[h, s];
    ENDLOOP;
   };
  };

 UProc6: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailFormatP1516V3.HeadingBodyPart] ~ {
  {
   length10: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailFormatP1516V3.HeadingBodyPartObject[length10]];
   FOR i9: CARDINAL IN [0..length10) DO
    res.body[i9].type ¬ CrRPC.GetCard32[s];
    res.body[i9].value ¬ UProc11[h, s];
    ENDLOOP;
   };
  };

 UProc2: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailFormatP1516V3.ForwardedHeadings] ~ {
  {
   length13: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailFormatP1516V3.ForwardedHeadingsObject[length13]];
   FOR i12: CARDINAL IN [0..length13) DO
    res.body[i12].envelope ¬ UProc14[h, s];
    res.body[i12].heading ¬ UProc15[h, s];
    res.body[i12].associatedBodyParts ¬ UProc16[h, s];
    res.body[i12].indexOfParentHeading ¬ UProc17[h, s];
    ENDLOOP;
   };
  };

 UProc4: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailTransportP17V5.RName] ~ {
  {
   tag18: MailTransportP17V5.RNameKind ~ VAL[CrRPC.GetCard16[s]];
   SELECT tag18 FROM
    xns => {
     temp19: CHNameP2V0.ThreePartName;
     temp19.organization ¬ CrRPC.GetRope[s];
     temp19.domain ¬ CrRPC.GetRope[s];
     temp19.object ¬ CrRPC.GetRope[s];
     res ¬ NEW[MailTransportP17V5.RNameObject.xns ¬ [xns[temp19]]] };
    gateway => {
     temp19: MailTransportP17V5.GatewayRecord;
     temp19.country ¬ CrRPC.GetRope[s];
     temp19.adminDomain ¬ CrRPC.GetRope[s];
     temp19.privateDomain ¬ CrRPC.GetRope[s];
     temp19.organization ¬ CrRPC.GetRope[s];
     temp19.organizationalUnits ¬ UProc20[h, s];
     temp19.personal ¬ UProc21[h, s];
     temp19.gatewaySpecificInformation ¬ UProc22[h, s];
     res ¬ NEW[MailTransportP17V5.RNameObject.gateway ¬ [gateway[temp19]]] };
    ENDCASE => ERROR;
   };
  };

 UProc20: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailTransportP17V5.OrgUnits] ~ {
  {
   length24: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailTransportP17V5.OrgUnitsObject[length24]];
   FOR i23: CARDINAL IN [0..length24) DO
    res.body[i23] ¬ CrRPC.GetRope[s];
    ENDLOOP;
   };
  };

 UProc15: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailFormatP1516V3.HeadingAtt] ~ {
  {
   length26: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailFormatP1516V3.HeadingAttObject[length26]];
   FOR i25: CARDINAL IN [0..length26) DO
    res.body[i25].type ¬ CrRPC.GetCard32[s];
    res.body[i25].value ¬ UProc11[h, s];
    ENDLOOP;
   };
  };

 UProc11: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailFormatP1516V3.Val] ~ {
  {
   length28: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailFormatP1516V3.ValObject[length28]];
   FOR i27: CARDINAL IN [0..length28) DO
    res.body[i27] ¬ CrRPC.GetCard16[s];
    ENDLOOP;
   };
  };

 UProc5: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailFormatP1516V3.IPMessageIDList] ~ {
  {
   length30: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailFormatP1516V3.IPMessageIDListObject[length30]];
   FOR i29: CARDINAL IN [0..length30) DO
    res.body[i29].originator ¬ UProc4[h, s];
    res.body[i29].uniqueString ¬ CrRPC.GetRope[s];
    ENDLOOP;
   };
  };

 MProc1: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: MailFormatP1516V3.Val] ~ {
  CrRPC.PutCard16[s, val.length];
  FOR i31: CARDINAL IN [0..val.length) DO
   CrRPC.PutCard16[s, val.body[i31]];
   ENDLOOP;
  };

 UProc14: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailFormatP1516V3.EnvelopeAtt] ~ {
  {
   length33: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailFormatP1516V3.EnvelopeAttObject[length33]];
   FOR i32: CARDINAL IN [0..length33) DO
    res.body[i32].type ¬ CrRPC.GetCard32[s];
    res.body[i32].value ¬ UProc34[h, s];
    ENDLOOP;
   };
  };

 UProc21: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailTransportP17V5.PerChoice] ~ {
  {
   tag35: MailTransportP17V5.PerChoiceKind ~ VAL[CrRPC.GetCard16[s]];
   SELECT tag35 FROM
    whole => {
     temp36: ROPE;
     temp36 ¬ CrRPC.GetRope[s];
     res ¬ NEW[MailTransportP17V5.PerChoiceObject.whole ¬ [whole[temp36]]] };
    broken => {
     temp36: MailTransportP17V5.BrokenName;
     temp36.given ¬ CrRPC.GetRope[s];
     temp36.initials ¬ CrRPC.GetRope[s];
     temp36.family ¬ CrRPC.GetRope[s];
     temp36.generation ¬ CrRPC.GetRope[s];
     res ¬ NEW[MailTransportP17V5.PerChoiceObject.broken ¬ [broken[temp36]]] };
    ENDCASE => ERROR;
   };
  };

 UProc17: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailFormatP1516V3.IndexOfParentHeading] ~ {
  {
   tag37: MailFormatP1516V3.IndexOfParentHeadingKind ~ VAL[CrRPC.GetCard16[s]];
   SELECT tag37 FROM
    null => {
     temp38: MailFormatP1516V3.NullRecord;
     temp38.null ¬ 0;
     res ¬ NEW[MailFormatP1516V3.IndexOfParentHeadingObject.null ¬ [null[temp38]]] };
    nested => {
     temp38: MailFormatP1516V3.NestedIndex;
     temp38.index ¬ CrRPC.GetCard16[s];
     res ¬ NEW[MailFormatP1516V3.IndexOfParentHeadingObject.nested ¬ [nested[temp38]]] };
    ENDCASE => ERROR;
   };
  };

 UProc22: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailTransportP17V5.GatewaySpecInfo] ~ {
  {
   length40: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailTransportP17V5.GatewaySpecInfoObject[length40]];
   FOR i39: CARDINAL IN [0..length40) DO
    res.body[i39].type ¬ CrRPC.GetRope[s];
    res.body[i39].value ¬ CrRPC.GetRope[s];
    ENDLOOP;
   };
  };

 UProc34: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailTransportP17V5.Opaque] ~ {
  {
   length42: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailTransportP17V5.OpaqueObject[length42]];
   FOR i41: CARDINAL IN [0..length42) DO
    res.body[i41] ¬ CrRPC.GetCard16[s];
    ENDLOOP;
   };
  };

 UProc16: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailFormatP1516V3.assocBP] ~ {
  {
   length44: CARDINAL ~ CrRPC.GetCard16[s];
   res ¬ NEW[MailFormatP1516V3.assocBPObject[length44]];
   FOR i43: CARDINAL IN [0..length44) DO
    res.body[i43] ¬ CrRPC.GetCard16[s];
    ENDLOOP;
   };
  };

}...