The OS/2 Emulator High-Level Language Application Programming Interface (EHLLAPI) supported in Communication Manager allows OS/2 application programs to interact with a host system using 3270 terminal emulation or 5250 Work Station Feature. DBCS unique-considerations on EHLLAPI are:
Some characters showing the status of a 3270 session or a 5250 session on DBCS OS/2 are different from those on SBCS OS/2, because those are not available on DBCS code pages.
Some error status indicators are also added to inform a user of a DBCS-related status.
EAD/NOEAD, SO/NOSO/SPACESO have been added to DBCS OS/2:
EAD
Along with the data in presentation space, DBCS-unique display attributes are passed to an application program. A program receives additional two bytes of information of the attributes on every byte of data. When you specify EAD, a buffer having twice the size of presentation space, in addition to a buffer for user's data, is required to receive the DBCS-unique display attributes. For example, 3840 bytes are needed to store the DBCS unique attributes for 3270 model 2.
Consult DBCS Design Guide for OS/2 Programming (GA18-7284) for more information on the DBCS EHLLAPI usage.
The 3270 Screen Capturte program shows you how to copy a host screen having DBCS data. It copies presentation space of the emulator 'A' and shows the contents of the presentation space into a PM window. SO/SI control characters are replaced with arrow marks (1EH and 1FH) in the window.
The window is redrawn when the emulator screen changes or when the window
is re-sized by an operator. When the window is re-sized, the program automatically
selects appropriate size of DBCS font so that all of the contents will be
fitted into the window. ExampleofEHLLAPIusage( source :EHLLAPI . C )
...
void GetPS(CHAR *ssprm) {
...
/*--- Connect Presentation Space --------------------------*/
fcode = 1;
hllapi(&fcode, ssprm, (int far *)0L, &rc);
/*--- Set Session Parameters ------------------------------*/
fcode = 9;
pcSprm = "SO";
dlen = strlen(pcSprm);
hllapi(&fcode, pcSprm, &dlen, &rc);
/*--- Copy Presentation Space -----------------------------*/
fcode = 5;
dlen = 0;
hllapi(&fcode, tempbuf, &dlen, &rc);
for (i = 0; i < SCREENSIZE; ++i) {
PS_CHR(i, 0) = tempbuf[i];
}
/*--- Change SO/SI to pseudo SO/SI ------------------------*/
for (i = 0; i < SCREENSIZE; ++i) {
switch (PS_CHR(i, 0)) {
case 0x0e:
/*--- Translate SO(0x0E) into 0x1E(Right Arrow) --*/
PS_CHR(i, 0) = 0x1e;
break;
case 0x0f:
/*--- Translate SI(0x0F) into 0x1F(Left Arrow) ---*/
PS_CHR(i, 0) = 0x1f;
break;
}
}
...