OSI/AS Management Programming Manual
Event-Retrieval Example
Sample Programs
C–34 056785 Tandem Computers Incorporated
actual^len [i] );
IF <> THEN
BEGIN
IF NOT FileError( term ) THEN
CALL Stop;
END
ELSE
Written := zSpi^Val^True;
END;
END; -- if actual^len
END; -- for
END; -- proc displ^event
? PAGE "getevent^loop"
-------------------------------------------------------------
--
-- GetEvent^LOOP -
--
-- This procedure consists of a loop to retrieve event
-- messages. Each time through the loop, the procedure
-- gets an event message and calls DISPL^EVENT to display
-- it at your terminal. The procedure returns in the
-- following cases:
--
-- (1) The GETEVENT response contains a ZEMS^TKN^PASSVAL of 0
-- (from a PASS 0 filter statement),
-- (2) The GETEVENT response contains an EOF warning, or
-- the message-processed limit (msglimit) is exceeded.
--
-- input - Spi^Buffer
-- output - event^buf, SSError
--
-------------------------------------------------------------
PROC getevent^loop;
BEGIN
INT used^len;
INT .EXT event^buf( zEms^DDL^Msg^Buffer^def );
INT(32) tkn;
INT ivalue;
INT passval;
INT msgcount := 0;
INT msglimit := 0; -- 0 represents no limit;
-- 100 is typical
--
-- Initialize the SPI buffer for GETEVENT command.
--
SSError := SSInit( Spi^Buffer,
zEms^Val^BufLen,
zEms^Val^ssid,
zSpi^Val^CmdHdr,
zEms^Cmd^GetEvent );
IF ( SSError <> zSpi^Err^OK ) THEN
CALL Debug;