OSI/AS Management Programming Manual
Event-Retrieval Example
Sample Programs
C–26 056785 Tandem Computers Incorporated
CALL WriteRead( term, term^buf, text^len, 32,
input^len );
IF > THEN -- EOF from terminal
CALL Stop
ELSE IF < THEN -- Some unusual condition
BEGIN -- Check whether to retry
IF NOT FileError( Term ) THEN
BEGIN
CALL Stop;
END;
END
ELSE IF ( input^len > 0 ) THEN
BEGIN
-- Move user input to filter name.
--
s^term^buf [input^len] := 0;
filter^name^length := FnameExpand
( s^term^buf [0],
filt^name,
Startup^Msg.Default );
got^it := zSpi^Val^True;
END;
END; -- WHILE
END; -- proc get^filter^name
? PAGE "Initialize Distributor"
-------------------------------------------------------------
--
-- Initialize^Distributor
--
-- GLOBALS:
-- INPUT: None
-- OUTPUT: None
--
-------------------------------------------------------------
INT PROC Initialize^Distributor;
BEGIN
INT error;
--
-- Create a name for the distributor process.
--
CALL CreateProcessName( Distr^name );
IF <> THEN
CALL Debug;
--
-- On the initial open (no SPI), the distributor will get
-- the same startup message read by the application, but
-- with a parameter string: "TYPE C" (C = CONSUMER).
--
Startup^Msg.Parameter.Bytes ':=' [ "TYPE C", 0 ];
--