OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
TAL Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
A-3
DEFINE printfx( x,y,z ) =
BEGIN
outline ':=' x -> @outptr;
CALL print_hex (z,y,outptr);
@outptr := @outptr[y];
outlen := $INT(@outptr - @outline);
CALL WRITEX ( output_fn
, outline
, outlen
);
END #;
--------------------------------- Literals ---------------------------------
literal FIRST= 1 ; -- Flag for the multivalued attribute
literal SECOND = 2 ; -- Flag for the multivalued attribute
literal MAX_DESCRIPTORS = 20; -- Maximum number of elements in the
-- descriptor list
literal MAX_DESCRIPTORS_32 = 20D; -- 32 bit version of the above
literal STRING_BUFFER_LEN = 100D; -- Length of the string buffer
literal IGNORED_FOR_SINGLE_VALUED_ATT = 0D; -- This parameter is ignored for
-- GPI_OM_INSERT_ for
-- single-valued attributes
literal FIRST_LINE_LEN = 35 ; -- Length of the 1st line of the IM_T_TEXT
literal SECOND_LINE_LEN = 24 ; -- Length of the 2nd line of the IM_T_TEXT
literal MAX_PRINT_ARR_TEXT_LEN = 32; -- Length of print array text
------------------------------ Structures ----------------------------------
-- Structure used by this program to print incoming message attributes. It
-- contains the attribute type and a pointer to the attribute name in ASCII.
STRUCT PRINT_DEF (*);
BEGIN
OM_type type;
STRING text[0:MAX_PRINT_ARR_TEXT_LEN - 1];
END;
---------------------------- Global Variables ------------------------------
INT(32)
read_object_id; -- This object identifer is used for calling
-- GPI_OM_READ_. It contains the object identifer
-- under which the attribute to be read is found.
-- Temporary working variables.
STRING tempstr[0:9]; -- Buffer for numout
-- Output variables.
STRING .EXT outline[0:131]; -- Output line
STRING .EXT outptr; -- Output line pointer
INT output_fn := -1; -- Output file number
INT output_width := 0; -- Width of output item
INT outlen := 0; -- Output line length
---------------------------- Procedure Prototypes -------------------------
-- Include the GPI procedure prototype declarations