OSI/MHS Management Programming Manual
Examples
OSI/MHS Management Programming Manual—424824-001
C-8
SPI Example in TAL
? LIST
-- OSI/MHS subsystem-specific TAL definitions
? NOLIST, SOURCE zMHSTAL
? LIST
? PAGE "Global variables "
--
-- Compaq data communications variables
--
--
-- Declare a variable to hold the subsystem ID of the OSI/MHS
-- subsystem, initializing it with the proper values.
--
INT .MHS^Val^SSID[0:5] :=
[ zSpi^Val^Tandem,
zSpi^SSN^zMHS,
zMHS^Val^Version ];
--
-- Define the structure for the profile information and the token map
-- for the structure.
--
STRUCT .Mta^Params ( zMHS^DDL^Mta^Params^Def );
INT .Mta^Params^Map [ 0:zMHS^Map^Mta^Params^Wln-1 ] :=
zMHS^Map^Mta^Params;
STRUCT .Mta^Add^Params ( zMHS^DDL^Mta^Add^Params^Def );
INT .Mta^Add^Params^Map [ 0:zMHS^Map^Mta^Add^Params^Wln-1 ] :=
zMHS^Map^Mta^Add^Params;
--
-- Output file variables.
--
INT .Term^Name [0:11]; -- terminal name. output file
INT Term^Fn; -- terminal file number
INT .Term^Buf [0:39]; -- buffer for terminal I/O
STRING .S^Term^Buf := -- string pointer to term I/O buffer
@Term^Buf '<<' 1;
STRING .S^Ptr; -- Temporary pointer
DEFINE Write^Term^Blank =
CALL Write ( Term^Fn, Term^Buf, 0 )#;
DEFINE Write^Term ( Str ) =
S^Term^Buf ':=' Str -> @S^Ptr;
CALL Write ( Term^Fn, Term^Buf, @S^Ptr '-' @S^Term^Buf )#;
DEFINE Write^Term^With^Num ( Str, Num ) =
S^Term^Buf ':=' Str -> @S^Ptr;
S^Ptr ':=' " (" -> @S^Ptr;
IF ( Num < 0 ) THEN
BEGIN
S^Ptr ':=' "-" -> @S^Ptr;
CALL Numout ( S^Ptr,
-Num,
10, -- Base 10
5 ); -- 5 characters in width
END
ELSE
BEGIN
CALL Numout ( S^Ptr,
Num,
10, -- Base 10
5 ); -- 5 characters in width