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:
The following guidelines are helpful in preparing applications that use HLLAPI functions in C language.
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.
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;
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
The following guidelines are helpful in preparing applications that use HLLAPI functions in COBOL language.
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.
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).
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'
The following guidelines are helpful in preparing applications that use HLLAPI functions in FORTRAN language.
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.
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
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.
The following lists the HLLAPI functions organized by function number.
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 |