A CPI-C application is a main program which generally includes the following:
operation of an interface to a presentation system
internal processing routines (operation of other interfaces if necessary)
operation of the CPI-C interface (to a UTM application)
overview of special CPI-C and UTM functions which the clients can use via UPIC
Sequence of calls in a CPI-C application
The following rules apply to the interface calls described in section “CPI-C calls in UPIC”:
The first CPI-C function call in your program must be Enable_UTM_UPIC and the last call must be Disable_UTM_UPIC. Between these two calls, you can repeat the other CPI-C calls as often as desired in accordance with the rules described below. Enable_UTM_UPIC provides the runtime environment for the client.
After calling Enable_UTM_UPIC, you can use the Specify_... calls to modify the UPIC-specific values of the local application.
You must initialize the conversation characteristics with Initialize_Conversation. The characteristics are described on "CPI-C terms".
After initialization you can set or modify various conversation characteristics using the Set_... calls (see the modifiable characteristics on "CPI-C terms").
You must establish the conversation with the Allocate call.
Following an Allocate call you can perform processing with the calls Send_Data, Send_Mapped_Data as well as Prepare_To_Receive, Receive and Receive_Mapped_Data. After the Allocate call, however, a Send_Data or Send_Mapped_Data call has to be made first before the program can receive data from the UTM server with Receive or Receive_Mapped_Data. For more information on the Send and Receive calls, see section “Exchange of messages with a UTM service”.
If a CPI-C program is to hold several conversations consecutively, for performance reasons it is advisable to issue only one Enable_UTM_UPIC and one Disable_UTM_UPIC call in a CPI-C application, i.e. you should not issue an Enable call before each Initialize_Conversation and a Disable call each time the conversation is terminated.
If a CPI-C program is to hold several conversations simultaneously, and Enable_UTM_UPIC call must be made for each of these conversations before the Initialize_Conversation. All CPI-C calls belonging to a conversation must occur in the same thread. See section “Multiple conversations (Unix, Linux and Windows systems)”.