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

C Language Example Program
OSI/MHS P7 Application Programmatic Interface (P7 API) Manual424825-001
E-2
* The menu selections are ordered more or less in the order they should
* be run
you need to issue a second Await Completion after the Send Data
* and the Send Unbind. The choices on the menu are:
*
* Choice 0 : This choice sends an MSBIND request to the LO group.
* The program then waits for the send completion to occur.
*
* Choice 1 : Use this choice to wait for incoming data. The data is
* usually an MSBIND or MSUNBIND response or other incoming
* data. Select choice 1 once after every choice 0, 2 or 3.
*
* Choice 2 : Use this choice to send data. You will be asked for the
* number of bytes to send. (The data buffer generated by
* this choice will be invalid ASN.1. The send should
* complete, but the response will be an error.)
*
* Choice 3 : This choice sends an MSUNBIND request to the LO group.
* The program then waits for the send completion to occur.
*
* Choice 4 : This choice exits the program.
*
* If you select an invalid choice, the menu reappears to allow you to
* select a new choice.
*
* The send data operation (Choice 2) does not work, because the code
* to generate an ASN.1 PDU is not in this example. For the MSBIND
* and MSUNBIND operations (Choices 0 and 3 respectively), hand-coded
* (i.e. "canned") ASN.1 PDU's are used. For the MSBIND operation to
* work, the following APPL must be added to the configuration of
* your OSI/MHS system and started:
*
* ADD APPL $ZX1.#UAMS11,&
* ACCESS-TYPE MS, ACCESS-NAME MSGRP1, USER-PASSWORD UAMS11,&
* ISO-COUNTRY-NAME US, ADMD POSTMASTER1, PRMD DEVELOPMENT,&
* ORG-NAME MTA1, ORG-UNIT-1 MSUSERS, SUR-NAME UAMS11,&
* SUB-PROBE-ALLOWED ON
*
* START APPL $ZX1.#UAMS11
*
* The name of the MHS manager process is included in the above
* command as $ZX1. The example program must be recompiled with a
* different manager name if your configuration uses a different name.
* The name and length are set once in this program just before the
* LOS_OPEN_() call.
********************************************************************/
#pragma nolist
#include "ZSPIC"
#include "ZCOMC"
#include "ZFILC"
#include "ZMHSC"
#include <stdioh>
#include <stringh>
#include <stdlibh>
#include <fcntlh>
#include <talh>
#include <cextdecs(AWAITIOX, FILEINFO, OPEN )>
/* Include file for the P7 API */
#pragma list
#include <P7PIEXTH>
/* Define boolean type and values */
typedef int boolean;