OSI/AS and OSI/TS Supplement (Includes RFC-1006 Support)
General OSI/AS and OSI/TS Manual Changes and Corrections
107751 Tandem Computers Incorporated 8–9
?PAGE
! ***********************************************************
! * 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.
PROC getevent^loop;
BEGIN
INT .EXT event^buf(zems^ddl^msg^buffer^def);
INT(32) tkn;
INT ivalue;
! Initialize spi^buf for GETEVENT command.
spi^err := SSINIT(spi^buf, ZEMS^VAL^BUFLEN,
zems^val^ssid, ZSPI^VAL^CMDHDR,
ZEMS^CMD^GETEVENT);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Save the original command.
sav^buf ':=' spi^buf FOR $LEN(sav^buf) BYTES;
! Begin a loop that gets and displays event messages.
WHILE msgcount < msglimit OR msglimit = 0 DO
BEGIN
msgcount := msgcount + 1;
! Send GETEVENT command to the distributor.
CALL send^spi^cmd;
! Find event message within the GETEVENT response.
tkn := ZEMS^TKN^EVENT;
spi^err := SSGETTKN ( spi^buf, ZSPI^TKN^ADDR,
tkn, 1,
@event^buf);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Move past length part (variable-length token).
@event^buf := @event^buf + 2D;
! Display the event message at your terminal.
CALL displ^event(event^buf);
! Save context token from this GETEVENT response for
! the next GETEVENT request.