OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

TAL Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
A-27
printf (" " &
"Insert the object into the MH_C_MESSAGE_RD object");
descriptor_count := 1D;
descriptor_list[0].type := MH_T_RECIPIENT_NAME;
descriptor_list[0].syntax := OM_S_OBJECT;
descriptor_list[0].value.object.padding := 0D;
descriptor_list[0].value.object.object := local_object;
local_rc := GPI_OM_INSERT_ ( object_id, -- Object identifier from
-- the layer above
IGNORED_FOR_SINGLE_VALUED_ATT,
descriptor_list,
descriptor_count);
END; -- then
END; -- then
RETURN (local_rc);
END; -- End build_and_insert_rdorname_obj
?page
-----------------------------------------------------------------------------
-- Function Name: build_and_insert_messagerd_obj --
-- --
-- Arguments: root_id IN --
-- --
-- Return: Return code from the function call --
-- --
-- Description: This function will create two mh_c_message_rd --
-- objects to show how to create multivalued --
-- attributes. The first mh_c_message_rd object is --
-- created with the initial value parameter set to --
-- FALSE. The function then inserts all the required --
-- attributes into the object. It then inserts the --
-- object into the root object. The second message_rd --
-- is created in an awkward way to demonstrate the usage --
-- of some GPI_* functions. First the function makes a --
-- copy of the first created message_rd. To replace --
-- the rdorname_object, we first need to get the object --
-- identifier of this object (using GPI_OM_EXAMINE --
-- and search_descriptor). Then the function deletes it --
-- and calls build_and_insert_rdorname_object with the --
-- second flag. The function then changes the recipient --
-- number by removing the old value and inserting a new --
-- one. When all this is done, the second --
-- mh-c-message-rd is inserted into the root object. --
-----------------------------------------------------------------------------
INT PROC build_and_insert_messagerd_obj (root_id);
INT(32) root_id;
BEGIN
INT exist, -- Position of the attribute in the descriptor
-- list
local_rc; -- Return code from the function call
INT(32)
descriptor_count := 5D, -- Count of the elements
total_number, -- Total number of elements that can be returned
local_object, -- Local object identifier
local_object_2; -- Local object identifier
STRUCT
.EXT descriptor_list(OM_descriptor)[0:4];
STRUCT