OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

TAL Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
A-34
INT local_rc, -- RETURN code from the function call
len, -- The RETURN value from the stccpy function
exist; -- Position from the element in descriptor list
INT(32)
string_offset, -- String offset for GPI_OM_READ_
string_length, -- Length in octets of the string to read
actual_number, -- Actual number of octets
total_number; -- Total number of octets
INT
counter_2, -- Counter for the loop
counter ; -- Counter for the loop
STRING
.octet_pointer, -- Pointer to the octet string
.EXT data_string[0:STRING_BUFFER_LEN], -- String buffer for the read
.EXT printout[0:STRING_BUFFER_LEN]; -- Contains the string to print
FOR counter := 0 TO $INT(number_of_printdata - 1D ) DO
BEGIN
exist := search_descriptor ( print_data[counter].type,
descriptor_list,
max_descriptors);
IF ( exist > -1 ) THEN
BEGIN
IF ( print_data[counter].type <> IM_T_TEXT ) THEN
BEGIN
CASE ( descriptor_list[exist].syntax) OF
BEGIN
OM_S_BOOLEAN ->
BEGIN
outline ':=' print_data[counter].text FOR 32 ->
@outptr;
CALL print_long_int
(descriptor_list[exist].value.boolean,
output_width, outptr);
@outptr := @outptr[output_width];
CALL WRITEX ( output_fn
, outline
, $INT(@outptr - @outline)) ;
END;
OM_S_OCTET_STRING ->
BEGIN
-- Since octet strings are not stored in ASCII, they
-- need to be printed in hex.
outline ':=' print_data[counter].text FOR 32 ->
@outptr;
CALL print_hex (
descriptor_list[exist].value.z_string.elements,
$INT(descriptor_list[exist].value.z_string.length),
outptr);
@outptr :=
@outptr[$INT(descriptor_list[exist].value.z_string.length)];
CALL WRITEX ( output_fn
, outline
, $INT(@outptr - @outline)