OSI/AS Management Programming Manual
Management Program Example
Sample Programs
C–8 056785 Tandem Computers Incorporated
--
-- GLOBALS: Term^fn
-- Term^Buf
-- Osi^Mgr^Name
-- INPUT: None
-- OUTPUT: None
--
-------------------------------------------------------------
PROC Get^OsiM^Name;
BEGIN
INT got^it := zSpi^Val^False;
INT Count^Read;
INT Character^Count;
STRING .s^Term^buf; -- string pointer to terminal buffer
STRING .end^of^text; -- string pointer to last character
-- of terminal text
WHILE ( got^it = zSpi^Val^False ) DO
BEGIN
--
-- Prompt user for OSI manager name.
--
Term^Buf ':=' Message1 [1] FOR Message1 [0] Bytes;
CALL WriteRead( Term^fn,
Term^Buf,
Message1 [0],
10,
Count^Read );
IF > THEN
-- EOF from terminal
CALL Stop
ELSE IF < THEN
BEGIN
-- unusual condition encountered
IF NOT FileError( Term^fn ) THEN
BEGIN
CALL FileInfo( Term^fn, FS^Error );
CALL Stop;
END;
END
ELSE IF ( Count^Read > 0 ) THEN
BEGIN
--
-- Move the input name to the OSIMNAME
-- parameter. Put the name in SPI format for
-- an OBJNAME string.
--
@s^term^buf := @term^buf '<<' 1;
s^term^buf [Count^Read] := 0;
SCAN s^term^buf WHILE " " -> @s^term^buf;
SCAN s^term^buf UNTIL " " -> @end^of^text;
Character^Count :=
@end^of^text '-' @s^term^buf;