OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

Writing Your Program
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
5-22
Building a Root Object
descriptor_list[0].type := MH_T_BUILTIN_EITS;
descriptor_list[0].syntax := OM_S_ENUMERATION;
descriptor_list[0].value.enumeration := MH_BE_IA5_TEXT ;
Procedure call:
status := GPI_OM_INSERT_ ( object_id,
value_position,
descriptor_list,
descriptor_count);
Writing a Long String to an Attribute Value
You call the GPI_OM_WRITE_ procedure to write a segment of a long string to a
specific value of a multivalued or single-valued attribute. A segment is a portion of a
string made up of zero or more contiguous octets. You call this procedure as many
times as needed to add all segments of the value. Each call returns a next position,
which you can use as the starting position (string offset) of the next call.
Typically, the GPI_OM_WRITE_ procedure is used to add to an attribute value an
arbitrarily long string of data, such as those associated with non-interpersonal message
content or a large body part. This procedure is a supplement to the GPI_OM_INSERT_
procedure, which can process only short strings.
Using GPI_OM_WRITE_ , you can:
Write a new string value
Append to an existing value
Replace all or part of an existing value
By replacing all or part of a value, you can lengthen or shorten it. The new string
segment overwrites any existing segments beyond the string offset you specify.
If the attribute to which segments are being added does not already exist,
GPI_OM_WRITE_ adds the attribute to the object.
Parameters for GPI_OM_WRITE_ are:
object (input)
attribute-type (input)
value-position (input)
string-offset (input/output)
data-string (input)
element-number (input)
syntax (input; optional)
object specifies the identifier of the object containing the attribute to which you want
to write.
attribute-type specifies the type of the attribute whose value you want to write.
value-position specifies the position within the attribute of the value you want to
write.