OSI/MHS Management Programming Manual

Examples
OSI/MHS Management Programming Manual424824-001
C-9
SPI Example in TAL
END;
S^Ptr[5] ':=' ")" -> @S^Ptr;
CALL Write ( Term^Fn, Term^Buf, @S^Ptr '-' @S^Term^Buf )#;
LITERAL MAX^MGR^INPUT^LEN = 10; -- Maximum length of input MHS
-- Manager name in bytes
--
-- MHS Manager name
--
INT .Mgr^Tkn^Name[0:15] :=
["\ "];
-- 12345678901234567890123456789012
-- Word offset of MHS Manager name in Mgr^Tkn^Name
LITERAL MGR^TKN^NAME^OFFSET = 4;
--
-- SPI communication variables
--
-- Define two buffers for the SPI messages.
-- One will hold the request and response. The other
-- will hold a copy of the request, so that we can resend
-- the original with any context that we may receive
-- in the response.
--
-- Our buffers will be the minimum size for communication
-- with the OSI/MHS subsystem. We declare the buffer as an
-- array of words, so we must divide the minimum byte
-- count by two.
--
INT .Spi^Buffer [0: (zMHS^Val^BufLen/2) ];
-- spi request/reply Buffer Minimum size
INT .Spi^Buffer^Copy [0: (zMHS^Val^BufLen/2) ];
-- backup spi Buffer for continuation
INT SCP^Fn; -- SCP file number
--
-- Error values.
--
INT FS^Error := 0; -- File-system error code
INT RetCode := zCom^Err^OK; -- zSpi^Tkn^RetCode Value
INT SSErr := zSpi^Err^OK; -- error from SSxxx calls
? PAGE "External Procedure Declarations"
--
-- External declarations for GUARDIAN 90 procedures
--
? NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS( Close,
? Abend,
? FileError,
? FileInfo,
? MyTerm,
? Open,
? Read,
? ShiftString,
? Stop,
? Numout,
? Write,
? WriteRead )
? LIST
--
-- External declarations for SPI procedures
--