OSI/MHS P7 Application Programmatic Interface (P7 API) Manual

OSI/MHS P7 Application Programmatic Interface (P7 API) Manual424825-001
E-1
E
C Language Example Program
This appendix presents a C language example program that shows how to call the
Compaq OSI/MHS P7 Application Programmatic Interface (P7 API) procedures. The
source code file for this example is provided as part of the OSI/MHS P7 API software.
By default, it resides in the volume and subvolume $SYSTEM.ZMHS.
/********************************************************************
* P7 API Programming Example in C
*
* Last Modified: December 3, 1992
*
* Introduction:
*
* This program shows how to send or receive messages using the Compaq
* OSI/MHS P7 Application Programmatic Interface (P7 API) procedures. It
* does not contain an ASN.1 facility, and therefore, is not fully
* functional. The MSBIND and MSUNBIND are the only outgoing PDUs that
* work as they are hard coded into the program and require a certain
* configuration to run properly. See below for details. The program
* receives the responses to the MSBIND and MSUNBIND requests, but as no
* other requests are sent, no other incoming messages are handled.
*
* Program Structure:
*
* The basic program sequence is as follows:
* - Start program
* - Call LOS_INITIALIZE_
* - Enter main loop
* - Get user input
* - Switch on input and call sendData and awaitCompletion
* accordingly
*
* Running the program:
*
* This program is controlled by a simple menu driven human interface.
* When you run the program, you are prompted for a connection number
* as follows:
*
* Enter connection to do operation on >>
*
* The connection number is used by the program to identify the
* send and result file numbers, because more than one pair can be open
* at the same time. Enter a number from 0 to 9. The program then prints
* out the following menu:
*
* P7 API Operations Menu:
* Send Bind - 0
* Await Completion - 1
* Send Data - 2
* Send Unbind - 3
* Quit - 4
* selection >>
*
Note. This example is subject to change in future releases.
To use this program, you may need to change the OSI/MHS MHS manager name to reflect
your environment.