[ Previous | Next | Contents | Search ]
3270 Host Connection Program 2.1 and 1.3.3 for AIX: Guide and Reference

Programming with HLLAPI

HLLAPI supports three different languages: C, COBOL, and FORTRAN. The source code requirements for calls are different for each supported language. This is because the high-level languages handle data in different ways and reserved words or syntax vary. Consult the following for information about how to use direct calls in each of the supported languages and source code preparation is discussed.

Programs using HLLAPI functions are typed in as source code in a compiled and linked supported language. Source programs in any supported language need the following six libraries to create the final executable:

HLLAPI Guidelines for C Programs

The following guidelines are helpful in preparing applications that use HLLAPI functions in C language.

Source Code Preparation

There are no required statements for the C language that call HLLAPI function. However, instead of defining their own header files, the C applications can use the sample hapi_ c.h program, which has defined constants and structures.

HLLAPI Functional Call Syntax

The syntax for calls to HLLAPI functions in the C language is:

hllc( func, apistring, len, ret)
int *func;
char *apistring;
int *len;
int *ret;

Compiling and Linking

To compile a C source program sample.c into an executable, use this command with the following order:

cc sample.c (libg3270.a in HCON 1.3 versions only) -lhllapi -liconv -lcur -lodm -lfxfer -o test

HLLAPI Guidelines for COBOL Programs

The following guidelines are helpful in preparing applications that use HLLAPI functions in COBOL language.

Source Code Preparation

There are no required statements for the COBOL language that call HLLAPI functions. However, the COBOL applications can create their own include files according to the definition provided by the hapi_ c.h sample program.

HLLAPI Functional Call Syntax

The syntax for calls to HLLAPI functions in the COBOL language is:

CALL "COBLIM" USING FUNC STR DLEN RETC.

The parameter types are defined as:

01 FUNC PIC S9(4) COMP.
01 DLEN PIC S9(4) COMP.
01 RETC PIC S9(4) COMP.
01 STR.
03 FILLER PIC X(256).

For applications migrating from an IBM OS/2 environment, the parameters are defined as:

01 FUNC PIC 9(4) COMP-0.
01 DLEN PIC 9(4) COMP-0.
01 RETC PIC 9(4) COMP-0.
01 STR. 03 FILLER PIC X(256).

Compiling and Linking

To compile the COBOL source program test.cob into an executable, use this command with the following order:

cob -x test.cob -lhllapi -lg3270 -liconv -lcur -lodm -lfxfer -o 'test'

HLLAPI Guidelines for FORTRAN Programs

The following guidelines are helpful in preparing applications that use HLLAPI functions in FORTRAN language.

Source Code Preparation

There are no required statements for the FORTRAN language that call HLLAPI function. However, the FORTRAN applications can create their own include files according to the definition provided by the hapi_ c.h file.

HLLAPI Functional Call Syntax

The syntax for calls to HLLAPI functions in the FORTRAN language is:

hllc(FUNC, %REF(CHAR_ARG), LEN, RET)

The parameter types are defined as:

INTEGER*4 FUNC, LEN, RET CHARACTER*256 CHAR_ARG

Compiling and Linking

To compile a FORTRAN source program test.f into an executable, use this command with the following order:

xlf test.f -lhllapi -lg3270 -liconv -lcur -lodm -lfxfer -o test

This compilation will include all the needed libraries in the final executable.

HLLAPI Functions by Function Number

The following lists the HLLAPI functions organized by function number.

1 CONNECT PRESENTATION SPACE
2 DISCONNECT PRESENTATION SPACE
3 SEND KEY
4 WAIT
5 COPY PRESENTATION SPACE
6 SEARCH PRESENTATION SPACE
7 QUERY CURSOR LOCATION
8 COPY PRESENTATION SPACE TO STRING
9 SET SESSION PARAMETERS
10 QUERY SESSIONS
11 RESERVE
12 RELEASE
13 COPY OIA
14 QUERY FIELD ATTRIBUTE
15 COPY STRING TO PRESENTATION SPACE
18 PAUSE
20 QUERY SYSTEM
21 RESET SYSTEM
22 QUERY SESSION STATUS
23 START HOST NOTIFICATION
24 QUERY HOST UPDATE
25 STOP HOST NOTIFICATION
30 SEARCH FIELD
31 FIND FIELD POSITION
32 FIND FIELD LENGTH
33 COPY STRING TO FIELD
34 COPY FIELD TO STRING
40 SET CURSOR
50 START KEYSTROKE INTERCEPT
51 GET KEY
52 POST INTERCEPT STATUS
53 STOP KEYSTROKE INTERCEPT
90 SEND FILE
91 RECEIVE FILE
99 CONVERT POSITION or CONVERT ROWCOL

Summary of Prerequisite Calls for HLLAPI Functions

This table lists the prerequisite calls for each HLLAPI function. Prerequisite calls are required when using any of the application programs.

Function Prerequisite Call
(1) CONNECT PRESENTATION SPACE None
(2) DISCONNECT PRESENTATION SPACE CONNECT PRESENTATION SPACE (1)
(3) SEND KEY CONNECT PRESENTATION SPACE (1)
(4) WAIT CONNECT PRESENTATION SPACE (1)
(5) COPY PRESENTATION SPACE CONNECT PRESENTATION SPACE (1)
(6) SEARCH PRESENTATION SPACE CONNECT PRESENTATION SPACE (1)
(7) QUERY CURSOR LOCATION CONNECT PRESENTATION SPACE (1)
(8) COPY PRESENTATION SPACE CONNECT PRESENTATION SPACE (1)
(9) SET SESSION PARAMETERS None
(10) QUERY SESSIONS None
(11) RESERVE CONNECT PRESENTATION SPACE (!)
(12) RELEASE CONNECT PRESENTATION SPACE (1)
(13) COPY OIA CONNECT PRESENTATION SPACE (1)
(14) QUERY FIELD ATTRIBUTE CONNECT PRESENTATION SPACE (1)
(15) COPY STRING TO PRESENTATION SPACE CONNECT PRESENTATION SPACE (1)
(18) PAUSE None
(20) QUERY SYSTEM None
(21) RESET SYSTEM None
(22) QUERY SESSION STATUS None
(23) START HOST NOTIFICATION None
(24) QUERY HOST UPDATE START HOST NOTIFICATION (23)
(25) STOP HOST NOTIFICATION START HOST NOTIFICATION (23)
(30) SEARCH FIELD CONNECT PRESENTATION SPACE (1)
(31) FIND FIELD POSITION CONNECT PRESENTATION SPACE (1)
(32) FIND FILED LENGTH CONNECT PRESENTATION SPACE (1)
(33) COPY STRING TO FIELD CONNECT PRESENTATION SPACE (1)
(34) COPY FILED TO STRING CONNECT PRESENTATION SPACE (1)
(40) SET CURSOR CONNECT PRESENTATION SPACE (1)
(50) START KEYSTROKE INTERCEPT None
(51) GET KEY START KEYSTROKE INTERCEPT (50)
(52) POST KEYSTROKE INTERCEPT START KEYSTROKE INTERCEPT (50)
(53) STOP KEYSTROKE INTERCEPT START KEYSTROKE INTERCEPT (50)
(90) SEND FILE None
(91) RECEIVE FILE None
(99) CONVERT POSITION / CONVERT ROWCOL None

[ Previous | Next | Contents | Search ]