OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

Writing Your Program
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
5-5
Managing the GPI Environment
The descriptions of the parameters generally do not include a list of the minimum,
maximum and default values. For detailed reference on each parameter, refer to the GPI
Reference Manual.
Managing the GPI Environment
Your client program must manage a run-time environment for GPI operations. The
environment has two key elements: a memory space dedicated to the GPI library, and a
session that links the client program to the OSI/MHS MTA.
The tasks described in this subsection are:
Initializing the GPI environment (using GPI_INITIALIZE_)
Opening a GPI session (using GPI_OPEN_)
Closing a GPI session (using GPI_CLOSE_)
Retrieving error information (using GPI_STATUS_)
Initializing the GPI Environment
You call the GPI_INITIALIZE_ procedure as the first step in setting up the GPI
environment. GPI_INITIALIZE_ allocates an extended memory segment to be used by
the GPI library. The segment stores GPI internal information and provides a workspace
for manipulating objects; it must be in place before you call any other GPI procedure.
Parameters for GPI_INITIALIZE_ are:
swap-volume (input; optional)
max-table-entries (input; optional)
max-table-data (input; optional)
max-string-length (input; optional)
swap-volume specifies the disk volume to be used as the swap volume for the GPI
library memory space. The default for swap-volume is the swap volume used for the
stack of your program.
max-table-entries specifies the maximum number of entries to be used by the
GPI for each of its object trees. It determines how much attribute and subobject data can
be stored for a root object. As described later, one entry is required for each attribute
and subobject and each value of a multivalued attribute.
max-table-data specifies the maximum length (in octets) that the GPI is to use for
string data space in each of its object trees (and it also sets maximum gateway message
size, as described in the GPI Reference Manual). You use max-table-data to
determine how much string data can be stored for a root object. The value you specify
for max-table-data must be greater than or equal to max-string-length.
Note. For brevity, the status parameter has been omitted from the discussion of each GPI
library procedure. For each GPI procedure, the status parameter returns a code that
indicates the outcome of the procedure call. The status parameter is described in Section 6,
Recovering From Errors.