OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide
TAL Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
A-11
-- Description: This procedure searches for the type in the --
-- descriptor list and RETURNs the position of the --
-- type. --
--------------------------------------------------------------------------
INT PROC search_descriptor ( type, att_list, number );
INT type; -- Type to search for
STRING .EXT att_list( OM_descriptor ); -- Descriptor list
INT(32) number; -- Number of elements in the
-- descriptor list
BEGIN
INT
counter := 0, -- Counter for the loop
position := -1; -- Position of the element
WHILE (counter < $INT(number) ) DO
BEGIN
IF ( att_list[counter].type = type ) THEN
BEGIN
position := counter;
counter := $INT(number); -- Leave the loop; type was found
END; -- then
counter := counter + 1;
END; -- WHILE --
RETURN (position);
END; -- End search_descriptor
?page
--------------------------------------------------------------------------
-- Function Name: insert_root_attributes --
-- --
-- Arguments: root_id IN --
-- --
-- Return: Return code from the function call --
-- --
-- Description: When the root object identifer has been created, --
-- this function is called to insert the desired --
-- root-level attributes into the object. Only the --
-- required attributes are inserted. --
--------------------------------------------------------------------------
INT PROC insert_root_attributes (root_id);
INT(32) root_id;
BEGIN
INT local_rc; -- Return code from the function call
INT(32) descriptor_count := 7D; -- Count of the elements to insert
STRING .EXT data_buf_in[0:131]; -- Buffer for string data
STRUCT
.EXT descriptor_list(OM_descriptor)[0:6]; -- Descriptor list
-- Initialize the descriptor list
descriptor_list[0].type := MH_T_ALTERNATE_RECIP_ALLOWED;
descriptor_list[0].syntax := OM_S_BOOLEAN;
descriptor_list[0].value.boolean := OM_FALSE ;
descriptor_list[1].type := MH_T_CONTENT_IDENTIFIER;
descriptor_list[1].syntax := OM_S_PRINTABLE_STRING;
descriptor_list[1].value.z_string.length := 1D ;
data_buf_in ':=' "-" ;
@descriptor_list[1].value.z_string.elements := @data_buf_in;