OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

TAL Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
A-46
IF ( local_rc = ZGPI_RC_WARNING ) THEN
printfd (" WARNING! number: ", local_rc );
message_class := descriptor_list_out[0].value.integer;
printf (" ");
-- Since TAL needs 16-bit integers for case statements, we are forced
-- to convert message_class to a 16-bit integer, possibly losing
-- information.
CASE ($INT(message_class)) OF
BEGIN
MH_C_MESSAGE ->BEGIN
printf (" " &
"The received object is a message");
local_rc := print_message (root_id);
END;
MH_C_PROBE -> BEGIN
printf (" " &
"The received object is a probe");
END;
MH_C_REPORT -> BEGIN
printf (" " &
"The received object is a report");
END;
END; -- case
printf (" ");
END; -- then
RETURN (local_rc);
END; -- End print_root_object
?page
--------------------------------------------------------------------------
--------------------------------------------------------------------------
----------------------- M A I N -----------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
PROC main_proc MAIN;
BEGIN
INT
session, -- Session identifier
rc, -- Return code from a function call
local_identifier_len := 0; -- Length from the local_identifier
INT(32)
interval, -- Interval for the wait
environment_object, -- Object identifier of an object that
-- represents the local environment
outbound_object, -- Object identifier
available, -- Indicates the availability of an
-- unreserved message
inbound_object; -- Object identifier
STRING
gateway_name[0:31] := ["Gateway "];
STRING
gateway_instance_name[0:31] := ["Instance "];
STRING
mhs_mgr_name[0:3] := ["$ZT1"];
STRING
gateway_password[0:9] := ["GATEWAY "];
STRING