<<>> <> <> <> <<>> DIRECTORY Rope USING [ROPE], XNS USING [Address], XNSCH USING [Item, Name]; <> XNSCHItemOps: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; Name: TYPE = XNSCH.Name; Address: TYPE = XNS.Address; Item: TYPE = XNSCH.Item; RopeList: TYPE = LIST OF ROPE; NameList: TYPE = LIST OF Name; AddressList: TYPE = LIST OF Address; <<>> <> <<>> <> <> <<>> <> <> <<>> <> <> <<>> <> <> <> <> <<];>> <> <<[mailboxInfo.time, pos] _ XNSCHItemOps.Card32FromItem[item, 0];>> <<[mailboxInfo.mailboxList, pos] _ XNSCHItemOps.NameListFromItem[item, pos];>> <<>> <<-- or, if you are only interested in the mailboxList:>> <<>> <> <<>> <> <<>> Error: ERROR [reason: ErrorType]; ErrorType: TYPE = { itemLength }; <> <<>> <= item.length when you have exhausted the item.>> <<>> <> <<>> BoolFromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [bool: BOOL, nextPos: CARDINAL]; Int16FromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [int: INT16, nextPos: CARDINAL]; Int32FromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [int: INT32, nextPos: CARDINAL]; Card16FromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [card: CARD16, nextPos: CARDINAL]; Card32FromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [card: CARD32, nextPos: CARDINAL]; RopeFromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [rope: ROPE, nextPos: CARDINAL]; NameFromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [name: Name, nextPos: CARDINAL]; AddressFromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [address: XNS.Address, nextPos: CARDINAL]; <<>> <> RopeListFromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [ropes: RopeList, nextPos: CARDINAL]; NameListFromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [names: NameList, nextPos: CARDINAL]; AddressListFromItem: PROC [item: Item, index: CARDINAL ¬ 0] RETURNS [addresses: AddressList, nextPos: CARDINAL]; <<"Simple" Marshaling PROCs:>> <<>> <> <<>> <> <<>> ItemFromBool: PROC [bool: BOOL, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; ItemFromInt16: PROC [int: INT16, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; ItemFromInt32: PROC [int: INT32, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; ItemFromCard16: PROC [card: CARD16, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; ItemFromCard32: PROC [card: CARD32, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; ItemFromAddress: PROC [address: Address, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; ItemFromRope: PROC [rope: ROPE, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; ItemFromName: PROC [name: Name, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; <<>> ItemFromAddressList: PROC [addresses: AddressList, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; ItemFromRopeList: PROC [ropes: RopeList, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; ItemFromNameList: PROC [names: NameList, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item, nextPos: CARDINAL]; <<>> <<>> <<>> <> <<>> <> <<>> <> SizeOfBool: PROC RETURNS [size: CARDINAL]; SizeOfInt16: PROC RETURNS [size: CARDINAL]; SizeOfInt32: PROC RETURNS [size: CARDINAL]; SizeOfCard16: PROC RETURNS [size: CARDINAL]; SizeOfCard32: PROC RETURNS [size: CARDINAL]; SizeOfRope: PROC [rope: ROPE] RETURNS [size: CARDINAL]; SizeOfName: PROC [name: Name] RETURNS [size: CARDINAL]; SizeOfAddress: PROC RETURNS [size: CARDINAL]; <<>> SizeOfRopeList: PROC [ropes: RopeList] RETURNS [size: CARDINAL]; SizeOfNameList: PROC [names: NameList] RETURNS [size: CARDINAL]; SizeOfAddressList: PROC [addresses: AddressList] RETURNS [size: CARDINAL]; <<>> <<>> CreateNewItem: PROC [size: CARDINAL, index: CARDINAL ¬ 0, item: Item ¬ NIL] RETURNS [newItem: Item]; <> <= item.length when you have filled the item.>> <<>> <> <<>> BoolIntoItem: PROC [item: Item, bool: BOOL, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; Int16IntoItem: PROC [item: Item, int: INT16, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; Int32IntoItem: PROC [item: Item, int: INT32, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; Card16IntoItem: PROC [item: Item, card: CARD16, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; Card32IntoItem: PROC [item: Item, card: CARD32, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; RopeIntoItem: PROC [item: Item, rope: ROPE, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; NameIntoItem: PROC [item: Item, name: Name, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; AddressIntoItem: PROC [item: Item, address: Address, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; <<>> RopeListIntoItem: PROC [item: Item, ropes: RopeList, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; NameListIntoItem: PROC [item: Item, names: NameList, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; AddressListIntoItem: PROC [item: Item, addresses: AddressList, index: CARDINAL ¬ 0] RETURNS [nextPos: CARDINAL]; END.