home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
api111.zip
/
README
Wrap
Text File
|
1994-05-19
|
18KB
|
382 lines
README (FILE)
IBM COMMUNICATIONS MANAGER/2 FOR OS/2
API SUPPORT
Communications Manager/2
- 5622-078 (C) Copyright IBM Corporation 1988, 1993
LICENSE: You may copy and distribute the sample programs in this
directory in any form without payment to IBM, for the purpose
of developing, using, marketing or distributing application
programs for use with Communications Manager.
The material in this directory could include technical inaccuracies, or
incompatibilities with IBM products, and could be modified or excluded
from the generally available reference materials. IBM expressly
reserves the right, without notice to you, to implement or modify IBM
Operating System/2 and other IBM products in a manner that affects the
compatibility or usability of application programs developed by you
using this material.
International Business Machines Corporation provides this directory
"as is" without warranty of any kind, either express or implied, including,
but not limited to, the implied warranties of merchantability or fitness
for a particular purpose.
It is possible that this directory may contain references to, or
information about, IBM products (machines and programs), programming or
services that are not announced in your country. Such references or
information must not be construed to mean that IBM intends to announce
such IBM products, programming or services in your country.
This directory contains documentation, source files, and the supporting
files for the following Communications Manager/2 Application Program
Interfaces (APIs):
1) APPC
2) Common Programming Interface - Communications (CPI-C)
3) Conventional LU Application (LUA)
4) Asynchronous Communication Device Interface (ACDI)
5) Environment Manager (CM Kernel)
6) Service Point Application Router & Remote Operations Service (ROPS)
7) Server-Requester Programming Interface (SRPI)
8) Emulator High Level Language API (EHLLAPI)
9) X.25
10) Connection Manager Interface for ISDN (CMI)
The C sample programs and related instructions have been developed for
use with the following C compilers:
1) IBM C Set/2 (32-bit sample programs)
2) Microsoft C Version 6.0 (16-bit sample programs)
The assembler sample programs and related instructions have been
developed for use with IBM Macro Assembler/2 (or equivalent).
The COBOL sample programs and related instructions have been developed
for use with Microfocus COBOL (or equivalent).
The BASIC sample programs and related instructions have been developed
for use with IBM BASIC/2 (or equivalent).
The REXX sample programs and related instructions have been developed
for use with IBM REXX.
The following files and subdirectories are in the samples directory:
ACDI ACDI samples
CMINCL API data structures for C, IBM MACRO Assembler/2,
and COBOL. Assembler Interface Macros for SRPI.
Communications Manager/2 interface for CPI-C REXX
CMKAPI Environment Manager samples
CMLINK Communications Manager/2 import libraries
CONFIG Configuration Manager samples
HAPI EHLLAPI samples
LUA LUA samples
REACTX25 X.25 adapter reactivation sample
README API Support documentation
ROPS Remote Operations samples
SNA APPC, CPI-C, System Management samples
SRPI SRPI samples
X25 X.25 samples
The following is a brief discussion of the documentation and sample
programs included in each of the subdirectories:
ACDI:
The ACDI directory contains documentation and sample programs for the
ACDI API. ACDI.DOC file contains the documentation and the
instructions for the ACDI sample programs. The source code for the
samples is provided.
Support for both 16-bit and 32-bit C programs is provided.
CMINCL:
The CMINCL directory contains the Communications Manager/2 API data
structures for C, IBM MACRO Assembler/2, and COBOL, the Assembler
Interface Macros for SRPI, and the Communications Manager/2 interface
for CPI-C REXX.
Support for both 16-bit and 32-bit C/C++ programming is provided
for the Communications Manager/2 APIs.
CMKAPI:
The CMKAPI directory contains documentation and sample programs
that exit or query Communications Manager. CMKAPI.DOC contains
the documentation and the instructions for these sample programs.
The sample programs are written in C and the source code is provided.
Support for both 16-bit and 32-bit C programs is provided.
CMLINK:
The CMLINK directory contains the Communications Manager/2 API import
libraries.
CONFIG:
The CONFIG directory contains sample CMD files for backing up and
restoring CM/2 configuration files.
HAPI:
The HAPI directory contains documentation and sample programs for
the EHLLAPI API. HAPI.DOC file contains the documentation and
the instructions for the EHLLAPI sample programs and EHLLAPI
Program Sampler. The source code is provided.
Support for both 16-bit and 32-bit C programs is provided.
LUA:
The LUA directory contains documentation and sample programs for the
LUA API. LUA.DOC file contains the documentation and the instructions
for the LUA API sample programs. The source code for the sample
programs is provided.
Support for both 16-bit and 32-bit C programs is provided.
REACTX25:
The REACTX25 directory contains documentation and a sample program for
the automatic reactivation of the X.25 adapter when either a link or
adapter failure occurs. REACTX25.DOC contains the documentation and
the instructions for the REACTX25 sample program. The sample program
is written in C and the source code is provided.
ROPS:
The ROPS directory contains documentation and sample programs for the
Remote Operations Service interface. The sample programs are written
in C and the source code is provided.
Support for both 16-bit and 32-bit C programs is provided.
SNA:
The following sample programs are provided in the SNA
subdirectory:
APING
This is a CPIC-C program that exchanges data packets with a partner
computer and times how long the data transfer takes. The sample is
written in C and the source code is provided. APING.DOC contains
information which may be useful when configuring, compiling and
running the sample program.
Support for both 16-bit and 32-bit C programs is provided.
APPCMGMT
This is a Subsystem Management sample program. The sample program
issues verbs such as Deactivate Logical Link and Deactivate Session.
The sample is written in C and the source code is provided.
APPCMGMT.DOC contains information which may be useful when configuring,
compiling and running the sample program.
Support for both 16-bit and 32-bit C programs is provided.
APPCTELL
This is an APPC sample program that sends a VIOPopUp message to the
specified Partner LU. The sample is written in C and the source code
is provided. APPCTELL.DOC contains information which may be useful
when configuring, compiling and running the sample program.
Support for both 16-bit and 32-bit C programs is provided.
AREXEC
This is an APPC sample program that allows you to execute any single
command line on a remote workstation. The sample is written in C and
the source code is provided. AREXEC.DOC contains information which
may be useful when configuring, compiling and running the sample
program.
Support for both 16-bit and 32-bit C programs is provided.
ATELL
This is a CPI-C sample program that allows a workstation to send a
message to another workstation. The sample is written in C and the
source code is provided. ATELL.DOC contains information which may be
useful when configuring, compiling and running the sample program.
Support for both 16-bit and 32-bit C programs is provided.
CPI-C File Transfer
This is a sample CPI-C file requestor and file server. The sample
programs demonstrate how to transmit a file from one OS/2 workstation
to another using CPI-C applications program interface calls. The
sample programs are written in C and the source code is provided.
CPICFILE.DOC contains information which may be useful when configuring,
compiling and running the sample program.
Support for both 16-bit and 32-bit C programs is provided.
CPI-C COBOL samples
Four sample COBOL programs using CPI-C. CPICOBOL.DOC contains
information which may be useful when configuring, compiling and
running the sample program. The source code is provided.
CPIC REXX samples
Sample REXX programs that demonstrate how to set and extract CPI-C
side information using the REXX environment for CPI-C, CPICOMM.
CPICREXX.DOC contains information which may be useful when
configuring, compiling and running the sample program.
DISPLAY
This sample program displays status and configuration information for
the active SNA configuration of the Communications Manager. It
demonstrates the use of the APPC management verbs DISPLAY and
DISPLAY_APPN for retrieving this information. The sample is written
in C and the source code is provided. DISPLAY.DOC contains information
which may be useful when configuring, compiling and running the sample
program.
CMGWSESS
This sample program requests and formats gateway information using
the DISPLAY and DISPLAY_APPN verbs. This sample is written in C and
the source code is provided.
Support for both 16-bit and 32-bit C programs is provided.
APPC File Transfer
These sample programs use the APPC native application programming
interface verbs to transmit a file from one OS/2 workstation to
another. The samples are written in C and the source code is provided.
FILE.DOC contains information which may be useful when configuring,
compiling and running the sample program.
SOC
This sample program provides an MS sphere of control (SOC)
application that allows interactive definition, display, and deletion
of SOC node entries. It demonstrates the use of the several APPC
management services verbs. SOC.DOC contains information which may be
useful when configuring, compiling and running the sample program.
SRPI:
The SRPI directory contains documentation and sample programs for
the SRPI API. SRPI.DOC file contains the documentation and the
instructions for the SRPI sample programs. The source code is
provided.
Support for both 16-bit and 32-bit C programs is provided.
X25:
The X25 directory contains documentation and sample programs for the
X.25 API. X25.DOC file contains the documentation and the instructions
for the X.25 API sample programs. The sample programs are written in
C and the source code is provided.
Support for both 16-bit and 32-bit C programs is provided.
/*******************************************************************/
/ COMPILING AND LINKING /
/*******************************************************************/
Building executable programs (.EXE files) from the source code supplied
in this directory requires the following:
1. Update the environment to use the Communications Manager/2 API
data structures and link libraries.
2. Set the environment and path for the compiler and linker.
For 16-bit C samples an example of these steps would be:
set lib=d:\cmlink;d:\msc\c600\lib;d:\toolkt13\lib;%LIB%
set include=d:\cmincl;d:\msc\c600\include;d:\toolkt13\c\include;%INCLUDE%
set path=d:\msc\c600\binb;d:\msc\c600\binp;d:\toolkt13\bin;%PATH%
set IPFC=d:\toolkt13\ipfc;
For 32-bit C samples an example of these steps would be:
set lib=d:\cmlink;d:\cset2\lib;d:\toolkt20\os2lib;%LIB%
set include=d:\cmincl;d:\cset2\include;d:\toolkt20\c\os2h;%INCLUDE%
set path=d:\cset2\bin;d:\toolkt20\os2bin;%PATH%
set dpath=d:\cset2\locale;d:\cset2\help;%DPATH%
In addition, 32-bit C support requires that the LIBPATH be updated
with libpath=d:\compile\cset2\dll;d:\compile\toolkt20\dll;.
3. From the subdirectory containing the sample source code, use the
makefile (.MAK file) with the NMAKE.EXE utility. Both 16-bit and
32-bit makefiles are supplied, and are distinguished by the trailing
'16' or '32' in the filename of the makefile.
4. The C include files in \CMINCL contain 32-bit structures that are
conditionally included with the __32BIT__ identifier. __32BIT__ is
defined whenever the IBM C Set/2 compiler is being run, and the
application must not try to define this identifier as a compile
option.
Many C samples files contain code that allow these programs to be
built with the 32-bit IBM C Set/2 compiler. These samples primarily
demonstrate techniques for calling Communications Manager/2 DLLs
from 32-bit applications. All of the Communications Manager/2 APIs
are enabled for 32-bit application support.
The following guidelines apply when building 32-bit applications:
o Use the most current 32-bit IBM C Set/2 compiler.
o Review the C include file in \CMINCL for the specific API which
will be called. The files in \CMINCL have been extensively
updated for Communications Manager/2.
o Declare data using typedefs defined in the API include files.
Data buffers have been defined implicitly as 16-bit objects (with
the _Seg16 qualifier), but the application can use these buffers
as 32-bit objects. For example, 32-bit memory management can be
used to allocate an API data buffer.
The characteristics of an API buffer in the 16-bit environment
also apply to the 32-bit application. For example, APPC buffers
may extend to a size of 64K and CPI-C buffers may extend to 32K.
API structures will not cross 64K segment boundaries due to the
use of #pragma seg16() statements in the include files.
Be careful to identify members of structures that may require
explicit thunking in a 32-bit application. For example, an API
control block can contain a handle to a semaphore that is typed
as (unsigned long). This is an address that must have been
explicitly declared as type (void PTR16) in the 32-bit
application. In the application this address would be typecast
as (unsigned long) when assigned to the handle in the control
block. For those cases where this object is returned by the API
the handle can be used directly (as in Dos16SemWait) without
conversion.
o Match the parameter lists in the API call with the prototype
of the entry point.
For example, the APPC parameter (&vcb) is prototyped as
(PVOID _Seg16). In this case, a 32-bit vcb passed by reference
will be converted to a 16-bit address. No explicit thunking is
required by the application code.
If the parameter of a function is prototyped without thunking,
do not attempt to use a 16-bit address for this parameter.
o Communications Manager/2 APIs use 16-bit semaphores. These can
be used by a 32-bit application that explicitly prototypes the
following calls:
typedef VOID * _Seg16 HSEM16;
typedef HSEM16 * PHSEM16;
typedef unsigned char * _Seg16 PSZ16;
USHORT _Far16 _Pascal Dos16CreateSem(USHORT,PHSEM16,PSZ16);
USHORT _Far16 _Pascal Dos16OpenSem(PHSEM16,PSZ16);
USHORT _Far16 _Pascal Dos16CloseSem(HSEM16);
USHORT _Far16 _Pascal Dos16SemClear(HSEM16);
USHORT _Far16 _Pascal Dos16SemSet(HSEM16);
USHORT _Far16 _Pascal Dos16SemWait(HSEM16,long);
To obtain linkage to Dos16... calls, include OS2386.LIB in the
list of link libraries.
o Support for 32-bit C++ application development is also included in
the files in \CMINCL. While this is primarily contained in the
__cplusplus identifier, certain programming conventions are
necessary to provide this compatibility. The use of #pragma pack(1)
rather than _Packed, and the use of _Far16 _Pascal rather than
#pragma linkage() are requirements of the 32-bit IBM C++ compiler.