OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

Writing Your Program
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
5-40
Retrieving Information From a Root Object
After the call, a value of 18 is returned as the total number, indicating there are eighteen
attributes in object X. A value of 4 is returned as actual-number, indicating four
descriptors were returned.
descriptor-list contains descriptors for the first four attributes examined. The
first descriptor is for the class attribute, which is always at attribute position 0. The
second descriptor is for attribute A, which represents an object. Note that the syntax of
this attribute is OM-S-Object, and its value is the identifier of this object. Attribute C is
multivalued, as indicated by “unspecified” returned as its syntax. Finally, the fourth
descriptor is for the second single-valued attribute returned in this list (not including the
class attribute), attribute H.
As shown, “xx” octets of string data were returned to the string buffer. This is the value
of attribute type H. Note that this is a short string. If it were a long string, it could not
be retrieved by GPI_OM_EXAMINE_ ; only the GPI_OM_READ_ procedure can
retrieve long string values.
Example: Inspecting an Object for All Attribute Types
The following TAL example shows a call to GPI_OM_EXAMINE_ .
literal MAX_DESCRIPTORS = 20;
literal STRING_BUFFER_LEN = 100;
Data declarations:
INT
status; -- STATUS code
INT(32)
object_id, -- ID of object that contains
-- attribute to be fetched
values := OM_TRUE, -- Return syntax and values of
-- single-valued attributes
attribute_position, -- Position of first attribute
maximum_number, -- Number of descriptors to be
-- returned
total_number, -- Total number of attributes
-- present in the object
actual_number, -- Actual number of
-- descriptors returned
string_buffer_length := STRING_BUFFER_LEN,
actual_string_length, -- Number of octets returned
total_string_length; -- Number of octets available
STRING
.EXT string_buffer[0:STRING_BUFFER_LEN];-- Buffer for
-- strings
STRUCT
.EXT descriptor_list(OM_descriptor)[0:MAX_DESCRIPTORS];