OSI/TS Management Programming Manual

Sample Programs
C–20 056786 Tandem Computers Incorporated
IF < THEN ! some unusual condition
BEGIN ! check whether to retry
IF FILEERROR (term^file^num) THEN GOTO retry;
CALL DEBUG;
END;
! Move user input filter name to filt^name[].
IF (input^len > 0) THEN
BEGIN
got^it := true;
filt^name ':=' s^term^buf[0] FOR input^len
BYTES;
END;
END; ! WHILE
END;
?PAGE
! ***********************************************************
! * send^spi^cmd *
! ***********************************************************
! This procedure puts the finishing touches on an SPI
! command that has been prepared by another procedure,
! such as the spi^cmd^set^source procedure below. The
! send^spi^cmd procedure subsequently sends the command to
! the distributor and checks the response.
INT PROC send^spi^cmd;
BEGIN
INT .message[0:21] :=
[41, "THE DISTRIBUTOR COULD NOT LOAD THE FILTER"];
! Determine the used buffer length.
spi^err := SSGETTKN(spi^buf, ZSPI^TKN^USEDLEN,
used^len);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Send the used part to the distributor.
CALL WRITEREAD(distr, spi^buf, used^len,
ZEMS^VAL^BUFLEN);
IF <> THEN
CALL DEBUG;
! Reset buffer length to what you declared for spi^buf.
spi^err := SSPUTTKN(spi^buf,
ZSPI^TKN^RESET^BUFFER,
ibuflen);
IF spi^err <> ZSPI^ERR^OK THEN
CALL DEBUG;
! Response is in buffer; check for return token.
spi^err := SSGETTKN(spi^buf, ZSPI^TKN^RETCODE,
ems^err, 1);