OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

Writing Your Program
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide—424822-001
5-23
Building a Root Object
string-offset, on input, specifies whether you are inserting a new value or
appending to an existing value. On output, string-offset is the offset (in octets)
after the last string segment written. You can use the returned string offset as the
starting position in the next GPI_OM_WRITE_ call.
data-string specifies a buffer in your program’s memory space that contains the
string segment to be written. This segment will be copied to the string value, starting at
the offset specified by string-offset. The number of octets written are equal to
the value of element-number.
element-number specifies the number of octets written; the minimum value is 0.
syntax specifies the syntax to be used for a value of an attribute that is not already
present in the object. You must specify a valid string syntax of the form OM-S-xxx-
STRING. syntax is ignored if the attribute already exists.
Figure 5-4 shows use of the GPI_OM_WRITE_ procedure. Conditions before the
procedure call are shown to the left of the vertical bracket; those after the call are to the
right.
The value specified for object is OBJECT_X_ID, the identifier of object X. As shown
before the procedure call, the string buffer for value 0 of attribute A contains 20 octets
Note. The string offset cannot exceed the current length of the existing string value. The
string offset plus the length of the string segment you are adding cannot exceed the maximum-
length string allowed for a value of the specified attribute.
Figure 5-4. Using GPI_OM_WRITE_ (To Append to the End of a String Buffer)
504CDT .CDD
Input Parameters
GPI_OM_WRITE_ String Buffer (Buffer_Y)
01020304050octets
String Buffer for Attribute A, Value 0 (of Object X)
01020304050octets
Output Parameter
string offset: 30
String Buffer for Attribute A, Value 0 (of Object X)
01020304050octets
object: OBJECT X_ID
attribute-type: Attribute Type A
value-position: 0
string offset: 20
element-number 10
data-string: Buffer_Y