Commit b5ae246187a4055f2d23077ff04470d1698b5cee

Authored by perry.werneck@gmail.com
1 parent ca28bc5d

Movendo ea_buf para a estrutura de sessao

src/gtk/pw3270-GTK.cbp
... ... @@ -95,6 +95,9 @@
95 95 <Unit filename="uiparser\toolitem.c">
96 96 <Option compilerVar="CC" />
97 97 </Unit>
  98 + <Unit filename="v3270\clipboard.c">
  99 + <Option compilerVar="CC" />
  100 + </Unit>
98 101 <Unit filename="v3270\draw.c">
99 102 <Option compilerVar="CC" />
100 103 </Unit>
... ...
src/gtk/v3270/clipboard.c
... ... @@ -83,6 +83,8 @@ gboolean v3270_copy(v3270 *widget)
83 83 {
84 84 gtk_clipboard_set_can_store(clipboard,targets,1);
85 85 trace("%s: Clipboard set",__FUNCTION__);
  86 + return TRUE;
86 87 }
  88 + return FALSE;
87 89 }
88 90  
... ...
src/include/lib3270/session.h
... ... @@ -36,6 +36,24 @@
36 36 #define LIB3270_LUNAME_LENGTH 16
37 37 #define LIB3270_FULL_MODEL_NAME_LENGTH 13
38 38  
  39 + /** extended attributes */
  40 + struct ea
  41 + {
  42 + unsigned char cc; /**< EBCDIC or ASCII character code */
  43 + unsigned char fa; /**< field attribute, it nonzero */
  44 + unsigned char fg; /**< foreground color (0x00 or 0xf<n>) */
  45 + unsigned char bg; /**< background color (0x00 or 0xf<n>) */
  46 + unsigned char gr; /**< ANSI graphics rendition bits */
  47 + unsigned char cs; /**< character set (GE flag, or 0..2) */
  48 + unsigned char ic; /**< input control (DBCS) */
  49 + unsigned char db; /**< DBCS state */
  50 +
  51 + /* Updated by addch() */
  52 + unsigned char chr; /**< ASCII character code */
  53 + unsigned short attr; /**< Converted character attribute (color & etc) */
  54 +
  55 + };
  56 +
39 57 struct _h3270
40 58 {
41 59 unsigned short sz; /**< Struct size */
... ... @@ -79,8 +97,6 @@
79 97 // screen info
80 98 int ov_rows;
81 99 int ov_cols;
82   -// int first_changed;
83   -// int last_changed;
84 100 int maxROWS;
85 101 int maxCOLS;
86 102 unsigned short rows;
... ... @@ -92,6 +108,8 @@
92 108  
93 109 int formatted; /**< set in screen_disp */
94 110  
  111 + struct ea * ea_buf; /**< 3270 device buffer. ea_buf[-1] is the dummy default field attribute */
  112 +
95 113 // host.c
96 114 char std_ds_host;
97 115 char no_login_host;
... ...
src/lib3270/api.h
... ... @@ -183,23 +183,6 @@
183 183 #define PW3270_DIALOG_CRITICAL LIB3270_NOTIFY_CRITICAL
184 184 #define PW3270_DIALOG LIB3270_NOTIFY
185 185  
186   - /** extended attributes */
187   - struct ea
188   - {
189   - unsigned char cc; /**< EBCDIC or ASCII character code */
190   - unsigned char fa; /**< field attribute, it nonzero */
191   - unsigned char fg; /**< foreground color (0x00 or 0xf<n>) */
192   - unsigned char bg; /**< background color (0x00 or 0xf<n>) */
193   - unsigned char gr; /**< ANSI graphics rendition bits */
194   - unsigned char cs; /**< character set (GE flag, or 0..2) */
195   - unsigned char ic; /**< input control (DBCS) */
196   - unsigned char db; /**< DBCS state */
197   -
198   - /* Updated by addch() */
199   - unsigned char chr; /**< ASCII character code */
200   - unsigned short attr; /**< Converted character attribute (color & etc) */
201   -
202   - };
203 186 #define GR_BLINK 0x01
204 187 #define GR_REVERSE 0x02
205 188 #define GR_UNDERLINE 0x04
... ...
src/lib3270/ctlr.c
... ... @@ -80,8 +80,8 @@ int buffer_addr;
80 80 // Boolean screen_alt = False; /* alternate screen? */
81 81 // Boolean is_altbuffer = False;
82 82  
83   -struct ea *ea_buf = NULL; /* 3270 device buffer */
84   - /* ea_buf[-1] is the dummy default field attribute */
  83 +// struct ea *ea_buf = NULL; /* 3270 device buffer */
  84 +// /* ea_buf[-1] is the dummy default field attribute */
85 85  
86 86 // Boolean formatted = False; /* set in screen_disp */
87 87 unsigned char reply_mode = SF_SRM_FIELD;
... ... @@ -168,7 +168,7 @@ void ctlr_reinit(H3270 *session, unsigned cmask)
168 168 if (real_ea_buf)
169 169 Free((char *)real_ea_buf);
170 170 real_ea_buf = (struct ea *)Calloc(sizeof(struct ea),(session->maxROWS * session->maxCOLS) + 1);
171   - ea_buf = real_ea_buf + 1;
  171 + session->ea_buf = real_ea_buf + 1;
172 172 if (real_aea_buf)
173 173 Free((char *)real_aea_buf);
174 174 real_aea_buf = (struct ea *)Calloc(sizeof(struct ea),(session->maxROWS * session->maxCOLS) + 1);
... ... @@ -274,7 +274,7 @@ static void set_formatted(H3270 *session)
274 274 baddr = 0;
275 275 do
276 276 {
277   - if (ea_buf[baddr].fa)
  277 + if(session->ea_buf[baddr].fa)
278 278 {
279 279 session->formatted = True;
280 280 break;
... ... @@ -301,10 +301,11 @@ static void ctlr_connect(H3270 *session, int ignored unused, void *dunno)
301 301 status_untiming(session);
302 302  
303 303 if (session->ever_3270)
304   - ea_buf[-1].fa = FA_PRINTABLE | FA_MODIFY;
  304 + session->ea_buf[-1].fa = FA_PRINTABLE | FA_MODIFY;
305 305 else
306   - ea_buf[-1].fa = FA_PRINTABLE | FA_PROTECT;
307   - if (!IN_3270 || (IN_SSCP && (kybdlock & KL_OIA_TWAIT))) {
  306 + session->ea_buf[-1].fa = FA_PRINTABLE | FA_PROTECT;
  307 + if (!IN_3270 || (IN_SSCP && (kybdlock & KL_OIA_TWAIT)))
  308 + {
308 309 kybdlock_clr(KL_OIA_TWAIT, "ctlr_connect");
309 310 status_reset(session);
310 311 }
... ... @@ -332,7 +333,7 @@ LIB3270_EXPORT int lib3270_field_addr(H3270 *h, int baddr)
332 333 sbaddr = baddr;
333 334 do
334 335 {
335   - if (ea_buf[baddr].fa)
  336 + if(h->ea_buf[baddr].fa)
336 337 return baddr;
337 338 DEC_BA(baddr);
338 339 } while (baddr != sbaddr);
... ... @@ -359,7 +360,7 @@ int lib3270_field_length(H3270 *h, int baddr)
359 360 saddr = addr;
360 361 INC_BA(addr);
361 362 do {
362   - if(ea_buf[addr].fa)
  363 + if(h->ea_buf[addr].fa)
363 364 return width;
364 365 INC_BA(addr);
365 366 width++;
... ... @@ -376,7 +377,7 @@ int lib3270_field_length(H3270 *h, int baddr)
376 377 unsigned char get_field_attribute(H3270 *h, int baddr)
377 378 {
378 379 CHECK_SESSION_HANDLE(h);
379   - return ea_buf[find_field_attribute(h,baddr)].fa;
  380 + return h->ea_buf[find_field_attribute(h,baddr)].fa;
380 381 }
381 382  
382 383 /*
... ... @@ -392,14 +393,14 @@ get_bounded_field_attribute(register int baddr, register int bound,
392 393 int sbaddr;
393 394  
394 395 if (!h3270.formatted) {
395   - *fa_out = ea_buf[-1].fa;
  396 + *fa_out = h3270.ea_buf[-1].fa;
396 397 return True;
397 398 }
398 399  
399 400 sbaddr = baddr;
400 401 do {
401   - if (ea_buf[baddr].fa) {
402   - *fa_out = ea_buf[baddr].fa;
  402 + if (h3270.ea_buf[baddr].fa) {
  403 + *fa_out = h3270.ea_buf[baddr].fa;
403 404 return True;
404 405 }
405 406 DEC_BA(baddr);
... ... @@ -407,7 +408,7 @@ get_bounded_field_attribute(register int baddr, register int bound,
407 408  
408 409 /* Screen is unformatted (and 'formatted' is inaccurate). */
409 410 if (baddr == sbaddr) {
410   - *fa_out = ea_buf[-1].fa;
  411 + *fa_out = h3270.ea_buf[-1].fa;
411 412 return True;
412 413 }
413 414  
... ... @@ -422,7 +423,7 @@ get_bounded_field_attribute(register int baddr, register int bound,
422 423 struct ea *
423 424 fa2ea(int baddr)
424 425 {
425   - return &ea_buf[baddr];
  426 + return &h3270.ea_buf[baddr];
426 427 }
427 428  
428 429 /*
... ... @@ -439,9 +440,9 @@ next_unprotected(int baddr0)
439 440 do {
440 441 baddr = nbaddr;
441 442 INC_BA(nbaddr);
442   - if (ea_buf[baddr].fa &&
443   - !FA_IS_PROTECTED(ea_buf[baddr].fa) &&
444   - !ea_buf[nbaddr].fa)
  443 + if (h3270.ea_buf[baddr].fa &&
  444 + !FA_IS_PROTECTED(h3270.ea_buf[baddr].fa) &&
  445 + !h3270.ea_buf[nbaddr].fa)
445 446 return nbaddr;
446 447 } while (nbaddr != baddr0);
447 448 return 0;
... ... @@ -610,20 +611,19 @@ insert_sa(int baddr, unsigned char *current_fgp, unsigned char *current_bgp,
610 611 return;
611 612  
612 613 if (memchr((char *)crm_attr, XA_FOREGROUND, crm_nattr))
613   - insert_sa1(XA_FOREGROUND, ea_buf[baddr].fg, current_fgp, anyp);
  614 + insert_sa1(XA_FOREGROUND, h3270.ea_buf[baddr].fg, current_fgp, anyp);
614 615 if (memchr((char *)crm_attr, XA_BACKGROUND, crm_nattr))
615   - insert_sa1(XA_BACKGROUND, ea_buf[baddr].bg, current_bgp, anyp);
  616 + insert_sa1(XA_BACKGROUND, h3270.ea_buf[baddr].bg, current_bgp, anyp);
616 617 if (memchr((char *)crm_attr, XA_HIGHLIGHTING, crm_nattr)) {
617 618 unsigned char gr;
618 619  
619   - gr = ea_buf[baddr].gr;
  620 + gr = h3270.ea_buf[baddr].gr;
620 621 if (gr)
621 622 gr |= 0xf0;
622 623 insert_sa1(XA_HIGHLIGHTING, gr, current_grp, anyp);
623 624 }
624 625 if (memchr((char *)crm_attr, XA_CHARSET, crm_nattr)) {
625   - insert_sa1(XA_CHARSET, host_cs(ea_buf[baddr].cs), current_csp,
626   - anyp);
  626 + insert_sa1(XA_CHARSET, host_cs(h3270.ea_buf[baddr].cs), current_csp,anyp);
627 627 }
628 628 }
629 629  
... ... @@ -699,13 +699,13 @@ ctlr_read_modified(unsigned char aid_byte, Boolean all)
699 699 if (h3270.formatted) {
700 700 /* find first field attribute */
701 701 do {
702   - if (ea_buf[baddr].fa)
  702 + if (h3270.ea_buf[baddr].fa)
703 703 break;
704 704 INC_BA(baddr);
705 705 } while (baddr != 0);
706 706 sbaddr = baddr;
707 707 do {
708   - if (FA_IS_MODIFIED(ea_buf[baddr].fa)) {
  708 + if (FA_IS_MODIFIED(h3270.ea_buf[baddr].fa)) {
709 709 Boolean any = False;
710 710  
711 711 INC_BA(baddr);
... ... @@ -713,17 +713,17 @@ ctlr_read_modified(unsigned char aid_byte, Boolean all)
713 713 *obptr++ = ORDER_SBA;
714 714 ENCODE_BADDR(obptr, baddr);
715 715 trace_ds(" SetBufferAddress%s (Cols: %d Rows: %d)", rcba(baddr), h3270.cols, h3270.rows);
716   - while (!ea_buf[baddr].fa) {
  716 + while (!h3270.ea_buf[baddr].fa) {
717 717  
718 718 if (send_data &&
719   - ea_buf[baddr].cc) {
  719 + h3270.ea_buf[baddr].cc) {
720 720 insert_sa(baddr,
721 721 &current_fg,
722 722 &current_bg,
723 723 &current_gr,
724 724 &current_cs,
725 725 &any);
726   - if (ea_buf[baddr].cs & CS_GE) {
  726 + if (h3270.ea_buf[baddr].cs & CS_GE) {
727 727 space3270out(1);
728 728 *obptr++ = ORDER_GE;
729 729 if (any)
... ... @@ -732,7 +732,7 @@ ctlr_read_modified(unsigned char aid_byte, Boolean all)
732 732 any = False;
733 733 }
734 734 space3270out(1);
735   - *obptr++ = ea_buf[baddr].cc;
  735 + *obptr++ = h3270.ea_buf[baddr].cc;
736 736 if (!any)
737 737 trace_ds(" '");
738 738 trace_ds("%s",
... ... @@ -747,7 +747,7 @@ ctlr_read_modified(unsigned char aid_byte, Boolean all)
747 747 else { /* not modified - skip */
748 748 do {
749 749 INC_BA(baddr);
750   - } while (!ea_buf[baddr].fa);
  750 + } while (!h3270.ea_buf[baddr].fa);
751 751 }
752 752 } while (baddr != sbaddr);
753 753 } else {
... ... @@ -762,14 +762,14 @@ ctlr_read_modified(unsigned char aid_byte, Boolean all)
762 762 baddr = sscp_start;
763 763  
764 764 do {
765   - if (ea_buf[baddr].cc) {
  765 + if (h3270.ea_buf[baddr].cc) {
766 766 insert_sa(baddr,
767 767 &current_fg,
768 768 &current_bg,
769 769 &current_gr,
770 770 &current_cs,
771 771 &any);
772   - if (ea_buf[baddr].cs & CS_GE) {
  772 + if (h3270.ea_buf[baddr].cs & CS_GE) {
773 773 space3270out(1);
774 774 *obptr++ = ORDER_GE;
775 775 if (any)
... ... @@ -778,7 +778,7 @@ ctlr_read_modified(unsigned char aid_byte, Boolean all)
778 778 any = False;
779 779 }
780 780 space3270out(1);
781   - *obptr++ = ea_buf[baddr].cc;
  781 + *obptr++ = h3270.ea_buf[baddr].cc;
782 782 if (!any)
783 783 trace_ds("%s","'");
784 784 trace_ds("%s",see_ebc(ea_buf[baddr].cc));
... ... @@ -836,7 +836,7 @@ ctlr_read_buffer(unsigned char aid_byte)
836 836  
837 837 baddr = 0;
838 838 do {
839   - if (ea_buf[baddr].fa) {
  839 + if (h3270.ea_buf[baddr].fa) {
840 840 if (reply_mode == SF_SRM_FIELD) {
841 841 space3270out(2);
842 842 *obptr++ = ORDER_SF;
... ... @@ -847,7 +847,7 @@ ctlr_read_buffer(unsigned char aid_byte)
847 847 *obptr++ = 1; /* for now */
848 848 *obptr++ = XA_3270;
849 849 }
850   - fa = ea_buf[baddr].fa & ~FA_PRINTABLE;
  850 + fa = h3270.ea_buf[baddr].fa & ~FA_PRINTABLE;
851 851 *obptr++ = code_table[fa];
852 852 if (any)
853 853 trace_ds("'");
... ... @@ -855,34 +855,34 @@ ctlr_read_buffer(unsigned char aid_byte)
855 855 (reply_mode == SF_SRM_FIELD) ? "" : "Extended",
856 856 rcba(baddr), see_attr(fa));
857 857 if (reply_mode != SF_SRM_FIELD) {
858   - if (ea_buf[baddr].fg) {
  858 + if (h3270.ea_buf[baddr].fg) {
859 859 space3270out(2);
860 860 *obptr++ = XA_FOREGROUND;
861   - *obptr++ = ea_buf[baddr].fg;
  861 + *obptr++ = h3270.ea_buf[baddr].fg;
862 862 trace_ds("%s", see_efa(XA_FOREGROUND,
863 863 ea_buf[baddr].fg));
864 864 (*(obuf + attr_count))++;
865 865 }
866   - if (ea_buf[baddr].bg) {
  866 + if (h3270.ea_buf[baddr].bg) {
867 867 space3270out(2);
868 868 *obptr++ = XA_BACKGROUND;
869   - *obptr++ = ea_buf[baddr].bg;
  869 + *obptr++ = h3270.ea_buf[baddr].bg;
870 870 trace_ds("%s", see_efa(XA_BACKGROUND,
871 871 ea_buf[baddr].bg));
872 872 (*(obuf + attr_count))++;
873 873 }
874   - if (ea_buf[baddr].gr) {
  874 + if (h3270.ea_buf[baddr].gr) {
875 875 space3270out(2);
876 876 *obptr++ = XA_HIGHLIGHTING;
877   - *obptr++ = ea_buf[baddr].gr | 0xf0;
  877 + *obptr++ = h3270.ea_buf[baddr].gr | 0xf0;
878 878 trace_ds("%s", see_efa(XA_HIGHLIGHTING,
879   - ea_buf[baddr].gr | 0xf0));
  879 + h3270.ea_buf[baddr].gr | 0xf0));
880 880 (*(obuf + attr_count))++;
881 881 }
882   - if (ea_buf[baddr].cs & CS_MASK) {
  882 + if (h3270.ea_buf[baddr].cs & CS_MASK) {
883 883 space3270out(2);
884 884 *obptr++ = XA_CHARSET;
885   - *obptr++ = host_cs(ea_buf[baddr].cs);
  885 + *obptr++ = host_cs(h3270.ea_buf[baddr].cs);
886 886 trace_ds("%s", see_efa(XA_CHARSET,
887 887 host_cs(ea_buf[baddr].cs)));
888 888 (*(obuf + attr_count))++;
... ... @@ -896,7 +896,7 @@ ctlr_read_buffer(unsigned char aid_byte)
896 896 &current_gr,
897 897 &current_cs,
898 898 &any);
899   - if (ea_buf[baddr].cs & CS_GE) {
  899 + if (h3270.ea_buf[baddr].cs & CS_GE) {
900 900 space3270out(1);
901 901 *obptr++ = ORDER_GE;
902 902 if (any)
... ... @@ -905,9 +905,9 @@ ctlr_read_buffer(unsigned char aid_byte)
905 905 any = False;
906 906 }
907 907 space3270out(1);
908   - *obptr++ = ea_buf[baddr].cc;
909   - if (ea_buf[baddr].cc <= 0x3f ||
910   - ea_buf[baddr].cc == 0xff) {
  908 + *obptr++ = h3270.ea_buf[baddr].cc;
  909 + if (h3270.ea_buf[baddr].cc <= 0x3f ||
  910 + h3270.ea_buf[baddr].cc == 0xff) {
911 911 if (any)
912 912 trace_ds("'");
913 913  
... ... @@ -1076,14 +1076,14 @@ ctlr_erase_all_unprotected(void)
1076 1076 /* find first field attribute */
1077 1077 baddr = 0;
1078 1078 do {
1079   - if (ea_buf[baddr].fa)
  1079 + if (h3270.ea_buf[baddr].fa)
1080 1080 break;
1081 1081 INC_BA(baddr);
1082 1082 } while (baddr != 0);
1083 1083 sbaddr = baddr;
1084 1084 f = False;
1085 1085 do {
1086   - fa = ea_buf[baddr].fa;
  1086 + fa = h3270.ea_buf[baddr].fa;
1087 1087 if (!FA_IS_PROTECTED(fa)) {
1088 1088 mdt_clear(baddr);
1089 1089 do {
... ... @@ -1092,15 +1092,15 @@ ctlr_erase_all_unprotected(void)
1092 1092 cursor_move(baddr);
1093 1093 f = True;
1094 1094 }
1095   - if (!ea_buf[baddr].fa) {
  1095 + if (!h3270.ea_buf[baddr].fa) {
1096 1096 ctlr_add(baddr, EBC_null, 0);
1097 1097 }
1098   - } while (!ea_buf[baddr].fa);
  1098 + } while (!h3270.ea_buf[baddr].fa);
1099 1099 }
1100 1100 else {
1101 1101 do {
1102 1102 INC_BA(baddr);
1103   - } while (!ea_buf[baddr].fa);
  1103 + } while (!h3270.ea_buf[baddr].fa);
1104 1104 }
1105 1105 } while (baddr != sbaddr);
1106 1106 if (!f)
... ... @@ -1203,7 +1203,7 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase)
1203 1203 if (appres.modified_sel)
1204 1204 ALL_CHANGED;
1205 1205 do {
1206   - if (ea_buf[baddr].fa) {
  1206 + if (h3270.ea_buf[baddr].fa) {
1207 1207 mdt_clear(baddr);
1208 1208 }
1209 1209 INC_BA(baddr);
... ... @@ -1271,8 +1271,8 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase)
1271 1271 * of an unprotected field, simply advance one
1272 1272 * position.
1273 1273 */
1274   - if (ea_buf[buffer_addr].fa &&
1275   - !FA_IS_PROTECTED(ea_buf[buffer_addr].fa)) {
  1274 + if (h3270.ea_buf[buffer_addr].fa &&
  1275 + !FA_IS_PROTECTED(h3270.ea_buf[buffer_addr].fa)) {
1276 1276 INC_BA(buffer_addr);
1277 1277 last_zpt = False;
1278 1278 last_cmd = True;
... ... @@ -1295,7 +1295,7 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase)
1295 1295 if (!last_cmd || last_zpt) {
1296 1296 trace_ds("(nulling)");
1297 1297 while ((buffer_addr != baddr) &&
1298   - (!ea_buf[buffer_addr].fa)) {
  1298 + (!h3270.ea_buf[buffer_addr].fa)) {
1299 1299 ctlr_add(buffer_addr, EBC_null, 0);
1300 1300 ctlr_add_cs(buffer_addr, 0);
1301 1301 ctlr_add_fg(buffer_addr, 0);
... ... @@ -1433,8 +1433,8 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase)
1433 1433 ABORT_WRITE("EUA overwriting left half of DBCS character");
1434 1434 }
1435 1435 do {
1436   - if (ea_buf[buffer_addr].fa)
1437   - current_fa = ea_buf[buffer_addr].fa;
  1436 + if (h3270.ea_buf[buffer_addr].fa)
  1437 + current_fa = h3270.ea_buf[buffer_addr].fa;
1438 1438 else if (!FA_IS_PROTECTED(current_fa)) {
1439 1439 ctlr_add(buffer_addr, EBC_null,
1440 1440 CS_BASE);
... ... @@ -1472,14 +1472,14 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase)
1472 1472 previous = ORDER;
1473 1473 cp++;
1474 1474 na = *cp;
1475   - if (ea_buf[buffer_addr].fa) {
  1475 + if (h3270.ea_buf[buffer_addr].fa) {
1476 1476 for (i = 0; i < (int)na; i++) {
1477 1477 cp++;
1478 1478 if (*cp == XA_3270) {
1479 1479 trace_ds(" 3270");
1480 1480 cp++;
1481 1481 ctlr_add_fa(buffer_addr, *cp,
1482   - ea_buf[buffer_addr].cs);
  1482 + h3270.ea_buf[buffer_addr].cs);
1483 1483 trace_ds("%s",see_attr(*cp));
1484 1484 } else if (*cp == XA_FOREGROUND) {
1485 1485 trace_ds("%s",
... ... @@ -1714,16 +1714,16 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase)
1714 1714 while (!aborted &&
1715 1715 ((fa_addr >= 0 && baddr != fa_addr) ||
1716 1716 (fa_addr < 0 && baddr != h3270.rows*h3270.cols - 1))) {
1717   - if (ea_buf[baddr].cc == FCORDER_SI) {
  1717 + if (h3270.ea_buf[baddr].cc == FCORDER_SI) {
1718 1718 ABORT_WRITE("double SI");
1719 1719 }
1720   - if (ea_buf[baddr].cc == FCORDER_SO)
  1720 + if (h3270.ea_buf[baddr].cc == FCORDER_SO)
1721 1721 break;
1722 1722 DEC_BA(baddr);
1723 1723 }
1724 1724 if (aborted)
1725 1725 break;
1726   - if (ea_buf[baddr].cc != FCORDER_SO) {
  1726 + if (h3270.ea_buf[baddr].cc != FCORDER_SO) {
1727 1727 ABORT_WRITE("SI without SO");
1728 1728 }
1729 1729 /* All is well. */
... ... @@ -2293,7 +2293,7 @@ ps_process(void)
2293 2293 !h3270.screen_alt && /* 24x80 screen */
2294 2294 !kybdlock && /* keyboard not locked */
2295 2295 /* magic field */
2296   - ea_buf[1919].fa && FA_IS_SKIP(ea_buf[1919].fa)) {
  2296 + h3270.ea_buf[1919].fa && FA_IS_SKIP(h3270.ea_buf[1919].fa)) {
2297 2297 ft_cut_data();
2298 2298 }
2299 2299 #endif /*]*/
... ... @@ -2308,7 +2308,7 @@ ctlr_any_data(void)
2308 2308 register int i;
2309 2309  
2310 2310 for (i = 0; i < h3270.rows*h3270.cols; i++) {
2311   - if (!IsBlank(ea_buf[i].cc))
  2311 + if (!IsBlank(h3270.ea_buf[i].cc))
2312 2312 return True;
2313 2313 }
2314 2314 return False;
... ... @@ -2334,7 +2334,7 @@ ctlr_clear(H3270 *session, Boolean can_snap)
2334 2334 #endif /*]*/
2335 2335  
2336 2336 /* Clear the screen. */
2337   - (void) memset((char *)ea_buf, 0, session->rows*session->cols*sizeof(struct ea));
  2337 + (void) memset((char *)session->ea_buf, 0, session->rows*session->cols*sizeof(struct ea));
2338 2338 cursor_move(0);
2339 2339 buffer_addr = 0;
2340 2340 // unselect(0, ROWS*COLS);
... ... @@ -2359,8 +2359,8 @@ ctlr_blanks(void)
2359 2359 int baddr;
2360 2360  
2361 2361 for (baddr = 0; baddr < h3270.rows*h3270.cols; baddr++) {
2362   - if (!ea_buf[baddr].fa)
2363   - ea_buf[baddr].cc = EBC_space;
  2362 + if (!h3270.ea_buf[baddr].fa)
  2363 + h3270.ea_buf[baddr].cc = EBC_space;
2364 2364 }
2365 2365 cursor_move(0);
2366 2366 buffer_addr = 0;
... ... @@ -2379,7 +2379,7 @@ ctlr_add(int baddr, unsigned char c, unsigned char cs)
2379 2379 {
2380 2380 unsigned char oc = 0;
2381 2381  
2382   - if(ea_buf[baddr].fa || ((oc = ea_buf[baddr].cc) != c || ea_buf[baddr].cs != cs))
  2382 + if(h3270.ea_buf[baddr].fa || ((oc = h3270.ea_buf[baddr].cc) != c || h3270.ea_buf[baddr].cs != cs))
2383 2383 {
2384 2384 if (trace_primed && !IsBlank(oc))
2385 2385 {
... ... @@ -2394,9 +2394,9 @@ ctlr_add(int baddr, unsigned char c, unsigned char cs)
2394 2394 if (SELECTED(baddr))
2395 2395 unselect(baddr, 1);
2396 2396 */
2397   - ea_buf[baddr].cc = c;
2398   - ea_buf[baddr].cs = cs;
2399   - ea_buf[baddr].fa = 0;
  2397 + h3270.ea_buf[baddr].cc = c;
  2398 + h3270.ea_buf[baddr].cs = cs;
  2399 + h3270.ea_buf[baddr].fa = 0;
2400 2400 ONE_CHANGED(baddr);
2401 2401 }
2402 2402 }
... ... @@ -2414,7 +2414,7 @@ ctlr_add_fa(int baddr, unsigned char fa, unsigned char cs)
2414 2414 * Store the new attribute, setting the 'printable' bits so that the
2415 2415 * value will be non-zero.
2416 2416 */
2417   - ea_buf[baddr].fa = FA_PRINTABLE | (fa & FA_MASK);
  2417 + h3270.ea_buf[baddr].fa = FA_PRINTABLE | (fa & FA_MASK);
2418 2418 }
2419 2419  
2420 2420 /*
... ... @@ -2423,13 +2423,13 @@ ctlr_add_fa(int baddr, unsigned char fa, unsigned char cs)
2423 2423 void
2424 2424 ctlr_add_cs(int baddr, unsigned char cs)
2425 2425 {
2426   - if (ea_buf[baddr].cs != cs)
  2426 + if (h3270.ea_buf[baddr].cs != cs)
2427 2427 {
2428 2428 /*
2429 2429 if (SELECTED(baddr))
2430 2430 unselect(baddr, 1);
2431 2431 */
2432   - ea_buf[baddr].cs = cs;
  2432 + h3270.ea_buf[baddr].cs = cs;
2433 2433 ONE_CHANGED(baddr);
2434 2434 }
2435 2435 }
... ... @@ -2440,13 +2440,9 @@ ctlr_add_cs(int baddr, unsigned char cs)
2440 2440 void
2441 2441 ctlr_add_gr(int baddr, unsigned char gr)
2442 2442 {
2443   - if (ea_buf[baddr].gr != gr)
  2443 + if (h3270.ea_buf[baddr].gr != gr)
2444 2444 {
2445   - /*
2446   - if (SELECTED(baddr))
2447   - unselect(baddr, 1);
2448   - */
2449   - ea_buf[baddr].gr = gr;
  2445 + h3270.ea_buf[baddr].gr = gr;
2450 2446 if (gr & GR_BLINK)
2451 2447 blink_start();
2452 2448 ONE_CHANGED(baddr);
... ... @@ -2463,13 +2459,9 @@ ctlr_add_fg(int baddr, unsigned char color)
2463 2459 return;
2464 2460 if ((color & 0xf0) != 0xf0)
2465 2461 color = 0;
2466   - if (ea_buf[baddr].fg != color)
  2462 + if (h3270.ea_buf[baddr].fg != color)
2467 2463 {
2468   - /*
2469   - if (SELECTED(baddr))
2470   - unselect(baddr, 1);
2471   - */
2472   - ea_buf[baddr].fg = color;
  2464 + h3270.ea_buf[baddr].fg = color;
2473 2465 ONE_CHANGED(baddr);
2474 2466 }
2475 2467 }
... ... @@ -2484,13 +2476,9 @@ ctlr_add_bg(int baddr, unsigned char color)
2484 2476 return;
2485 2477 if ((color & 0xf0) != 0xf0)
2486 2478 color = 0;
2487   - if (ea_buf[baddr].bg != color)
  2479 + if (h3270.ea_buf[baddr].bg != color)
2488 2480 {
2489   - /*
2490   - if (SELECTED(baddr))
2491   - unselect(baddr, 1);
2492   - */
2493   - ea_buf[baddr].bg = color;
  2481 + h3270.ea_buf[baddr].bg = color;
2494 2482 ONE_CHANGED(baddr);
2495 2483 }
2496 2484 }
... ... @@ -2501,7 +2489,7 @@ ctlr_add_bg(int baddr, unsigned char color)
2501 2489 static void
2502 2490 ctlr_add_ic(int baddr, unsigned char ic)
2503 2491 {
2504   - ea_buf[baddr].ic = ic;
  2492 + h3270.ea_buf[baddr].ic = ic;
2505 2493 }
2506 2494  
2507 2495 /*
... ... @@ -2548,21 +2536,12 @@ void
2548 2536 ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea)
2549 2537 {
2550 2538 /* Move the characters. */
2551   - if (memcmp((char *) &ea_buf[baddr_from],
2552   - (char *) &ea_buf[baddr_to],
  2539 + if (memcmp((char *) &h3270.ea_buf[baddr_from],
  2540 + (char *) &h3270.ea_buf[baddr_to],
2553 2541 count * sizeof(struct ea))) {
2554   - (void) memmove(&ea_buf[baddr_to], &ea_buf[baddr_from],
  2542 + (void) memmove(&h3270.ea_buf[baddr_to], &h3270.ea_buf[baddr_from],
2555 2543 count * sizeof(struct ea));
2556 2544 REGION_CHANGED(baddr_to, baddr_to + count);
2557   - /*
2558   - * For the time being, if any selected text shifts around on
2559   - * the screen, unhighlight it. Eventually there should be
2560   - * logic for preserving the highlight if the *all* of the
2561   - * selected text moves.
2562   - */ /*
2563   - if (area_is_selected(baddr_to, count))
2564   - unselect(baddr_to, count);
2565   - */
2566 2545 }
2567 2546 /* XXX: What about move_ea? */
2568 2547 }
... ... @@ -2575,15 +2554,11 @@ ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea)
2575 2554 void
2576 2555 ctlr_aclear(int baddr, int count, int clear_ea)
2577 2556 {
2578   - if (memcmp((char *) &ea_buf[baddr], (char *) zero_buf,
  2557 + if (memcmp((char *) &h3270.ea_buf[baddr], (char *) zero_buf,
2579 2558 count * sizeof(struct ea))) {
2580   - (void) memset((char *) &ea_buf[baddr], 0,
  2559 + (void) memset((char *) &h3270.ea_buf[baddr], 0,
2581 2560 count * sizeof(struct ea));
2582 2561 REGION_CHANGED(baddr, baddr + count);
2583   - /*
2584   - if (area_is_selected(baddr, count))
2585   - unselect(baddr, count);
2586   - */
2587 2562 }
2588 2563 /* XXX: What about clear_ea? */
2589 2564 }
... ... @@ -2604,10 +2579,10 @@ void ctlr_scroll(void)
2604 2579 /* Synchronize pending changes prior to this. */
2605 2580  
2606 2581 /* Move ea_buf. */
2607   - (void) memmove(&ea_buf[0], &ea_buf[h3270.cols],qty * sizeof(struct ea));
  2582 + (void) memmove(&h3270.ea_buf[0], &h3270.ea_buf[h3270.cols],qty * sizeof(struct ea));
2608 2583  
2609 2584 /* Clear the last line. */
2610   - (void) memset((char *) &ea_buf[qty], 0, h3270.cols * sizeof(struct ea));
  2585 + (void) memset((char *) &h3270.ea_buf[qty], 0, h3270.cols * sizeof(struct ea));
2611 2586  
2612 2587 screen_disp(&h3270);
2613 2588  
... ... @@ -2646,8 +2621,8 @@ void ctlr_altbuffer(H3270 *session, int alt)
2646 2621 if (alt != session->is_altbuffer)
2647 2622 {
2648 2623  
2649   - etmp = ea_buf;
2650   - ea_buf = aea_buf;
  2624 + etmp = session->ea_buf;
  2625 + session->ea_buf = aea_buf;
2651 2626 aea_buf = etmp;
2652 2627  
2653 2628 session->is_altbuffer = alt;
... ... @@ -2672,8 +2647,8 @@ mdt_set(int baddr)
2672 2647 int faddr;
2673 2648  
2674 2649 faddr = find_field_attribute(&h3270,baddr);
2675   - if (faddr >= 0 && !(ea_buf[faddr].fa & FA_MODIFY)) {
2676   - ea_buf[faddr].fa |= FA_MODIFY;
  2650 + if (faddr >= 0 && !(h3270.ea_buf[faddr].fa & FA_MODIFY)) {
  2651 + h3270.ea_buf[faddr].fa |= FA_MODIFY;
2677 2652 if (appres.modified_sel)
2678 2653 ALL_CHANGED;
2679 2654 }
... ... @@ -2685,8 +2660,8 @@ mdt_clear(int baddr)
2685 2660 int faddr;
2686 2661  
2687 2662 faddr = find_field_attribute(&h3270,baddr);
2688   - if (faddr >= 0 && (ea_buf[faddr].fa & FA_MODIFY)) {
2689   - ea_buf[faddr].fa &= ~FA_MODIFY;
  2663 + if (faddr >= 0 && (h3270.ea_buf[faddr].fa & FA_MODIFY)) {
  2664 + h3270.ea_buf[faddr].fa &= ~FA_MODIFY;
2690 2665 if (appres.modified_sel)
2691 2666 ALL_CHANGED;
2692 2667 }
... ... @@ -2702,9 +2677,8 @@ ctlr_shrink(void)
2702 2677 int baddr;
2703 2678  
2704 2679 for (baddr = 0; baddr < h3270.rows*h3270.cols; baddr++) {
2705   - if (!ea_buf[baddr].fa)
2706   - ea_buf[baddr].cc =
2707   - visible_control? EBC_space : EBC_null;
  2680 + if (!h3270.ea_buf[baddr].fa)
  2681 + h3270.ea_buf[baddr].cc = visible_control? EBC_space : EBC_null;
2708 2682 }
2709 2683 ALL_CHANGED;
2710 2684 screen_disp(&h3270);
... ...
src/lib3270/ft_cut.c
... ... @@ -276,7 +276,7 @@ download_convert(unsigned const char *buf, unsigned len, unsigned char *xobuf)
276 276 void
277 277 ft_cut_data(void)
278 278 {
279   - switch (ea_buf[O_FRAME_TYPE].cc) {
  279 + switch (h3270.ea_buf[O_FRAME_TYPE].cc) {
280 280 case FT_CONTROL_CODE:
281 281 cut_control_code();
282 282 break;
... ... @@ -308,8 +308,7 @@ cut_control_code(void)
308 308 int i;
309 309  
310 310 trace_ds("< FT CONTROL_CODE ");
311   - code = (ea_buf[O_CC_STATUS_CODE].cc << 8) |
312   - ea_buf[O_CC_STATUS_CODE + 1].cc;
  311 + code = (h3270.ea_buf[O_CC_STATUS_CODE].cc << 8) | h3270.ea_buf[O_CC_STATUS_CODE + 1].cc;
313 312 switch (code) {
314 313 case SC_HOST_ACK:
315 314 trace_ds("HOST_ACK\n");
... ... @@ -338,7 +337,7 @@ cut_control_code(void)
338 337 } else {
339 338 bp = buf = Malloc(81);
340 339 for (i = 0; i < 80; i++)
341   - *bp++ = ebc2asc[ea_buf[O_CC_MESSAGE + i].cc];
  340 + *bp++ = ebc2asc[h3270.ea_buf[O_CC_MESSAGE + i].cc];
342 341 *bp-- = '\0';
343 342 while (bp >= buf && *bp == ' ')
344 343 *bp-- = '\0';
... ... @@ -365,7 +364,7 @@ cut_control_code(void)
365 364 static void
366 365 cut_data_request(void)
367 366 {
368   - unsigned char seq = ea_buf[O_DR_FRAME_SEQ].cc;
  367 + unsigned char seq = h3270.ea_buf[O_DR_FRAME_SEQ].cc;
369 368 int count;
370 369 unsigned char cs;
371 370 int c;
... ... @@ -413,13 +412,13 @@ cut_data_request(void)
413 412 ctlr_add(O_UP_FRAME_SEQ, seq, 0);
414 413 cs = 0;
415 414 for (i = 0; i < count; i++)
416   - cs ^= ea_buf[O_UP_DATA + i].cc;
  415 + cs ^= h3270.ea_buf[O_UP_DATA + i].cc;
417 416 ctlr_add(O_UP_CSUM, asc2ebc[(int)table6[cs & 0x3f]], 0);
418 417 ctlr_add(O_UP_LEN, asc2ebc[(int)table6[(count >> 6) & 0x3f]], 0);
419 418 ctlr_add(O_UP_LEN+1, asc2ebc[(int)table6[count & 0x3f]], 0);
420 419  
421 420 /* XXX: Change the data field attribute so it doesn't display. */
422   - attr = ea_buf[O_DR_SF].fa;
  421 + attr = h3270.ea_buf[O_DR_SF].fa;
423 422 attr = (attr & ~FA_INTENSITY) | FA_INT_ZERO_NSEL;
424 423 ctlr_add_fa(O_DR_SF, attr, 0);
425 424  
... ... @@ -474,14 +473,14 @@ cut_data(void)
474 473 }
475 474  
476 475 /* Copy and convert the data. */
477   - raw_length = from6(ea_buf[O_DT_LEN].cc) << 6 |
478   - from6(ea_buf[O_DT_LEN + 1].cc);
  476 + raw_length = from6(h3270.ea_buf[O_DT_LEN].cc) << 6 |
  477 + from6(h3270.ea_buf[O_DT_LEN + 1].cc);
479 478 if ((int)raw_length > O_RESPONSE - O_DT_DATA) {
480 479 cut_abort(MSG_("ftCutOversize","Illegal frame length"), SC_ABORT_XMIT);
481 480 return;
482 481 }
483 482 for (i = 0; i < (int)raw_length; i++)
484   - cvbuf[i] = ea_buf[O_DT_DATA + i].cc;
  483 + cvbuf[i] = h3270.ea_buf[O_DT_DATA + i].cc;
485 484  
486 485 if (raw_length == 2 && cvbuf[0] == EOF_DATA1 && cvbuf[1] == EOF_DATA2) {
487 486 trace_ds("< FT EOF\n");
... ... @@ -527,7 +526,7 @@ cut_abort(const char *s, unsigned short reason)
527 526  
528 527 /* Send the abort sequence. */
529 528 ctlr_add(RO_FRAME_TYPE, RFT_CONTROL_CODE, 0);
530   - ctlr_add(RO_FRAME_SEQ, ea_buf[O_DT_FRAME_SEQ].cc, 0);
  529 + ctlr_add(RO_FRAME_SEQ, h3270.ea_buf[O_DT_FRAME_SEQ].cc, 0);
531 530 ctlr_add(RO_REASON_CODE, HIGH8(reason), 0);
532 531 ctlr_add(RO_REASON_CODE+1, LOW8(reason), 0);
533 532 trace_ds("> FT CONTROL_CODE ABORT\n");
... ...
src/lib3270/kybd.c
... ... @@ -639,7 +639,7 @@ static Boolean ins_prep(int faddr, int baddr, int count)
639 639 } else {
640 640 next_faddr = faddr;
641 641 INC_BA(next_faddr);
642   - while (next_faddr != faddr && !ea_buf[next_faddr].fa) {
  642 + while (next_faddr != faddr && !h3270.ea_buf[next_faddr].fa) {
643 643 INC_BA(next_faddr);
644 644 }
645 645 }
... ... @@ -649,11 +649,11 @@ static Boolean ins_prep(int faddr, int baddr, int count)
649 649 need = count;
650 650 ntb = 0;
651 651 while (need && (xaddr != next_faddr)) {
652   - if (ea_buf[xaddr].cc == EBC_null)
  652 + if (h3270.ea_buf[xaddr].cc == EBC_null)
653 653 need--;
654 654 else if (toggled(LIB3270_TOGGLE_BLANK_FILL) &&
655   - ((ea_buf[xaddr].cc == EBC_space) ||
656   - (ea_buf[xaddr].cc == EBC_underscore))) {
  655 + ((h3270.ea_buf[xaddr].cc == EBC_space) ||
  656 + (h3270.ea_buf[xaddr].cc == EBC_underscore))) {
657 657 if (tb_start == -1)
658 658 tb_start = xaddr;
659 659 ntb++;
... ... @@ -682,7 +682,7 @@ static Boolean ins_prep(int faddr, int baddr, int count)
682 682 int first_null = -1;
683 683  
684 684 while (need &&
685   - ((ea_buf[xaddr].cc == EBC_null) ||
  685 + ((h3270.ea_buf[xaddr].cc == EBC_null) ||
686 686 (tb_start >= 0 && xaddr >= tb_start))) {
687 687 need--;
688 688 n_nulls++;
... ... @@ -768,7 +768,7 @@ key_Character(int code, Boolean with_ge, Boolean pasting, Boolean *skipped)
768 768 baddr = h3270.cursor_addr;
769 769 faddr = find_field_attribute(&h3270,baddr);
770 770 fa = get_field_attribute(&h3270,baddr);
771   - if (ea_buf[baddr].fa || FA_IS_PROTECTED(fa)) {
  771 + if (h3270.ea_buf[baddr].fa || FA_IS_PROTECTED(fa)) {
772 772 operator_error(KL_OERR_PROTECTED);
773 773 return False;
774 774 }
... ... @@ -780,13 +780,13 @@ key_Character(int code, Boolean with_ge, Boolean pasting, Boolean *skipped)
780 780 }
781 781  
782 782 /* Can't put an SBCS in a DBCS field. */
783   - if (ea_buf[faddr].cs == CS_DBCS) {
  783 + if (h3270.ea_buf[faddr].cs == CS_DBCS) {
784 784 operator_error(KL_OERR_DBCS);
785 785 return False;
786 786 }
787 787  
788 788 /* If it's an SI (end of DBCS subfield), move over one position. */
789   - if (ea_buf[baddr].cc == EBC_si) {
  789 + if (h3270.ea_buf[baddr].cc == EBC_si) {
790 790 INC_BA(baddr);
791 791 if (baddr == faddr) {
792 792 operator_error(KL_OERR_OVERFLOW);
... ... @@ -795,7 +795,7 @@ key_Character(int code, Boolean with_ge, Boolean pasting, Boolean *skipped)
795 795 }
796 796  
797 797 /* Add the character. */
798   - if (ea_buf[baddr].cc == EBC_so) {
  798 + if (h3270.ea_buf[baddr].cc == EBC_so) {
799 799  
800 800 if (toggled(INSERT)) {
801 801 if (!ins_prep(faddr, baddr, 1))
... ... @@ -812,7 +812,7 @@ key_Character(int code, Boolean with_ge, Boolean pasting, Boolean *skipped)
812 812 */
813 813 xaddr = baddr;
814 814 INC_BA(xaddr);
815   - was_si = (ea_buf[xaddr].cc == EBC_si);
  815 + was_si = (h3270.ea_buf[xaddr].cc == EBC_si);
816 816 ctlr_add(xaddr, EBC_space, CS_BASE);
817 817 ctlr_add_fg(xaddr, 0);
818 818 #if defined(X3270_ANSI) /*[*/
... ... @@ -935,7 +935,7 @@ key_Character(int code, Boolean with_ge, Boolean pasting, Boolean *skipped)
935 935 * for NULLs.
936 936 */
937 937 while (baddr_scan != faddr) {
938   - if (ea_buf[baddr_scan].cc != EBC_null) {
  938 + if (h3270.ea_buf[baddr_scan].cc != EBC_null) {
939 939 aborted = False;
940 940 break;
941 941 }
... ... @@ -947,7 +947,7 @@ key_Character(int code, Boolean with_ge, Boolean pasting, Boolean *skipped)
947 947 break;
948 948 }
949 949  
950   - if (ea_buf[baddr_fill].cc == EBC_null)
  950 + if (h3270.ea_buf[baddr_fill].cc == EBC_null)
951 951 ctlr_add(baddr_fill, EBC_space, 0);
952 952 DEC_BA(baddr_fill);
953 953 }
... ... @@ -961,10 +961,10 @@ key_Character(int code, Boolean with_ge, Boolean pasting, Boolean *skipped)
961 961 * keyboard-generated data except DUP.
962 962 */
963 963 if (pasting || (code != EBC_dup)) {
964   - while (ea_buf[baddr].fa) {
  964 + while (h3270.ea_buf[baddr].fa) {
965 965 if (skipped != NULL)
966 966 *skipped = True;
967   - if (FA_IS_SKIP(ea_buf[baddr].fa))
  967 + if (FA_IS_SKIP(h3270.ea_buf[baddr].fa))
968 968 baddr = next_unprotected(baddr);
969 969 else
970 970 INC_BA(baddr);
... ... @@ -1463,15 +1463,15 @@ LIB3270_KEY_ACTION( backtab )
1463 1463 return 0;
1464 1464 baddr = h3270.cursor_addr;
1465 1465 DEC_BA(baddr);
1466   - if (ea_buf[baddr].fa) /* at bof */
  1466 + if (h3270.ea_buf[baddr].fa) /* at bof */
1467 1467 DEC_BA(baddr);
1468 1468 sbaddr = baddr;
1469 1469 while (True) {
1470 1470 nbaddr = baddr;
1471 1471 INC_BA(nbaddr);
1472   - if (ea_buf[baddr].fa &&
1473   - !FA_IS_PROTECTED(ea_buf[baddr].fa) &&
1474   - !ea_buf[nbaddr].fa)
  1472 + if (h3270.ea_buf[baddr].fa &&
  1473 + !FA_IS_PROTECTED(h3270.ea_buf[baddr].fa) &&
  1474 + !h3270.ea_buf[nbaddr].fa)
1475 1475 break;
1476 1476 DEC_BA(baddr);
1477 1477 if (baddr == sbaddr) {
... ... @@ -1685,25 +1685,25 @@ do_delete(void)
1685 1685  
1686 1686 /* Can't delete a field attribute. */
1687 1687 fa = get_field_attribute(&h3270,baddr);
1688   - if (FA_IS_PROTECTED(fa) || ea_buf[baddr].fa) {
  1688 + if (FA_IS_PROTECTED(fa) || h3270.ea_buf[baddr].fa) {
1689 1689 operator_error(KL_OERR_PROTECTED);
1690 1690 return False;
1691 1691 }
1692   - if (ea_buf[baddr].cc == EBC_so || ea_buf[baddr].cc == EBC_si) {
  1692 + if (h3270.ea_buf[baddr].cc == EBC_so || h3270.ea_buf[baddr].cc == EBC_si) {
1693 1693 /*
1694 1694 * Can't delete SO or SI, unless it's adjacent to its
1695 1695 * opposite.
1696 1696 */
1697 1697 xaddr = baddr;
1698 1698 INC_BA(xaddr);
1699   - if (ea_buf[xaddr].cc == SOSI(ea_buf[baddr].cc)) {
  1699 + if (h3270.ea_buf[xaddr].cc == SOSI(h3270.ea_buf[baddr].cc)) {
1700 1700 ndel = 2;
1701 1701 } else {
1702 1702 operator_error(KL_OERR_PROTECTED);
1703 1703 return False;
1704 1704 }
1705   - } else if (IS_DBCS(ea_buf[baddr].db)) {
1706   - if (IS_RIGHT(ea_buf[baddr].db))
  1705 + } else if (IS_DBCS(h3270.ea_buf[baddr].db)) {
  1706 + if (IS_RIGHT(h3270.ea_buf[baddr].db))
1707 1707 DEC_BA(baddr);
1708 1708 ndel = 2;
1709 1709 } else
... ... @@ -1714,7 +1714,7 @@ do_delete(void)
1714 1714 end_baddr = baddr;
1715 1715 do {
1716 1716 INC_BA(end_baddr);
1717   - if (ea_buf[end_baddr].fa)
  1717 + if (h3270.ea_buf[end_baddr].fa)
1718 1718 break;
1719 1719 } while (end_baddr != baddr);
1720 1720 DEC_BA(end_baddr);
... ... @@ -1768,7 +1768,7 @@ LIB3270_ACTION( delete )
1768 1768 int baddr = hSession->cursor_addr;
1769 1769  
1770 1770 DEC_BA(baddr);
1771   - if (!ea_buf[baddr].fa)
  1771 + if (!hSession->ea_buf[baddr].fa)
1772 1772 cursor_move(baddr);
1773 1773 }
1774 1774 screen_disp(hSession);
... ... @@ -1819,7 +1819,7 @@ do_erase(void)
1819 1819  
1820 1820 baddr = h3270.cursor_addr;
1821 1821 faddr = find_field_attribute(&h3270,baddr);
1822   - if (faddr == baddr || FA_IS_PROTECTED(ea_buf[baddr].fa)) {
  1822 + if (faddr == baddr || FA_IS_PROTECTED(h3270.ea_buf[baddr].fa)) {
1823 1823 operator_error(KL_OERR_PROTECTED);
1824 1824 return;
1825 1825 }
... ... @@ -1830,7 +1830,7 @@ do_erase(void)
1830 1830 /*
1831 1831 * If we are now on an SI, move left again.
1832 1832 */
1833   - if (ea_buf[h3270.cursor_addr].cc == EBC_si) {
  1833 + if (h3270.ea_buf[h3270.cursor_addr].cc == EBC_si) {
1834 1834 baddr = h3270.cursor_addr;
1835 1835 DEC_BA(baddr);
1836 1836 cursor_move(baddr);
... ... @@ -1861,7 +1861,7 @@ do_erase(void)
1861 1861 */
1862 1862 baddr = h3270.cursor_addr;
1863 1863 DEC_BA(baddr);
1864   - if (ea_buf[baddr].cc == EBC_so && ea_buf[h3270.cursor_addr].cc == EBC_si) {
  1864 + if (h3270.ea_buf[baddr].cc == EBC_so && h3270.ea_buf[h3270.cursor_addr].cc == EBC_si) {
1865 1865 cursor_move(baddr);
1866 1866 (void) do_delete();
1867 1867 }
... ... @@ -1994,20 +1994,20 @@ LIB3270_ACTION( previousword )
1994 1994  
1995 1995 /* Skip to before this word, if in one now. */
1996 1996 if (!prot) {
1997   - c = ea_buf[baddr].cc;
1998   - while (!ea_buf[baddr].fa && c != EBC_space && c != EBC_null) {
  1997 + c = h3270.ea_buf[baddr].cc;
  1998 + while (!h3270.ea_buf[baddr].fa && c != EBC_space && c != EBC_null) {
1999 1999 DEC_BA(baddr);
2000 2000 if (baddr == h3270.cursor_addr)
2001 2001 return 0;
2002   - c = ea_buf[baddr].cc;
  2002 + c = h3270.ea_buf[baddr].cc;
2003 2003 }
2004 2004 }
2005 2005 baddr0 = baddr;
2006 2006  
2007 2007 /* Find the end of the preceding word. */
2008 2008 do {
2009   - c = ea_buf[baddr].cc;
2010   - if (ea_buf[baddr].fa) {
  2009 + c = h3270.ea_buf[baddr].cc;
  2010 + if (h3270.ea_buf[baddr].fa) {
2011 2011 DEC_BA(baddr);
2012 2012 prot = FA_IS_PROTECTED(get_field_attribute(&h3270,baddr));
2013 2013 continue;
... ... @@ -2023,8 +2023,8 @@ LIB3270_ACTION( previousword )
2023 2023 /* Go it its front. */
2024 2024 for (;;) {
2025 2025 DEC_BA(baddr);
2026   - c = ea_buf[baddr].cc;
2027   - if (ea_buf[baddr].fa || c == EBC_space || c == EBC_null) {
  2026 + c = h3270.ea_buf[baddr].cc;
  2027 + if (h3270.ea_buf[baddr].fa || c == EBC_space || c == EBC_null) {
2028 2028 break;
2029 2029 }
2030 2030 }
... ... @@ -2082,9 +2082,9 @@ nu_word(int baddr)
2082 2082 prot = FA_IS_PROTECTED(get_field_attribute(&h3270,baddr));
2083 2083  
2084 2084 do {
2085   - c = ea_buf[baddr].cc;
2086   - if (ea_buf[baddr].fa)
2087   - prot = FA_IS_PROTECTED(ea_buf[baddr].fa);
  2085 + c = h3270.ea_buf[baddr].cc;
  2086 + if (h3270.ea_buf[baddr].fa)
  2087 + prot = FA_IS_PROTECTED(h3270.ea_buf[baddr].fa);
2088 2088 else if (!prot && c != EBC_space && c != EBC_null)
2089 2089 return baddr;
2090 2090 INC_BA(baddr);
... ... @@ -2102,8 +2102,8 @@ nt_word(int baddr)
2102 2102 Boolean in_word = True;
2103 2103  
2104 2104 do {
2105   - c = ea_buf[baddr].cc;
2106   - if (ea_buf[baddr].fa)
  2105 + c = h3270.ea_buf[baddr].cc;
  2106 + if (h3270.ea_buf[baddr].fa)
2107 2107 return -1;
2108 2108 if (in_word) {
2109 2109 if (c == EBC_space || c == EBC_null)
... ... @@ -2141,7 +2141,7 @@ LIB3270_ACTION( nextword )
2141 2141 return 0;
2142 2142  
2143 2143 /* If not in an unprotected field, go to the next unprotected word. */
2144   - if (ea_buf[h3270.cursor_addr].fa ||
  2144 + if (h3270.ea_buf[h3270.cursor_addr].fa ||
2145 2145 FA_IS_PROTECTED(get_field_attribute(&h3270,h3270.cursor_addr))) {
2146 2146 baddr = nu_word(h3270.cursor_addr);
2147 2147 if (baddr != -1)
... ... @@ -2157,15 +2157,15 @@ LIB3270_ACTION( nextword )
2157 2157 }
2158 2158  
2159 2159 /* If in a word, go to just after its end. */
2160   - c = ea_buf[h3270.cursor_addr].cc;
  2160 + c = h3270.ea_buf[h3270.cursor_addr].cc;
2161 2161 if (c != EBC_space && c != EBC_null) {
2162 2162 baddr = h3270.cursor_addr;
2163 2163 do {
2164   - c = ea_buf[baddr].cc;
  2164 + c = h3270.ea_buf[baddr].cc;
2165 2165 if (c == EBC_space || c == EBC_null) {
2166 2166 cursor_move(baddr);
2167 2167 return 0;
2168   - } else if (ea_buf[baddr].fa) {
  2168 + } else if (h3270.ea_buf[baddr].fa) {
2169 2169 baddr = nu_word(baddr);
2170 2170 if (baddr != -1)
2171 2171 cursor_move(baddr);
... ... @@ -2304,7 +2304,7 @@ LIB3270_CURSOR_ACTION( newline )
2304 2304 baddr = (h3270.cursor_addr + h3270.cols) % (h3270.cols * h3270.rows); /* down */
2305 2305 baddr = (baddr / h3270.cols) * h3270.cols; /* 1st col */
2306 2306 faddr = find_field_attribute(&h3270,baddr);
2307   - fa = ea_buf[faddr].fa;
  2307 + fa = h3270.ea_buf[faddr].fa;
2308 2308 if (faddr != baddr && !FA_IS_PROTECTED(fa))
2309 2309 cursor_move(baddr);
2310 2310 else
... ... @@ -2559,7 +2559,7 @@ LIB3270_ACTION( eraseeol )
2559 2559  
2560 2560 baddr = h3270.cursor_addr;
2561 2561 fa = get_field_attribute(&h3270,baddr);
2562   - if (FA_IS_PROTECTED(fa) || ea_buf[baddr].fa)
  2562 + if (FA_IS_PROTECTED(fa) || h3270.ea_buf[baddr].fa)
2563 2563 {
2564 2564 operator_error(KL_OERR_PROTECTED);
2565 2565 return -1;
... ... @@ -2572,7 +2572,7 @@ LIB3270_ACTION( eraseeol )
2572 2572 {
2573 2573 ctlr_add(baddr, EBC_null, 0);
2574 2574 INC_BA(baddr);
2575   - } while (!ea_buf[baddr].fa && BA_TO_COL(baddr) > 0);
  2575 + } while (!h3270.ea_buf[baddr].fa && BA_TO_COL(baddr) > 0);
2576 2576  
2577 2577 mdt_set(h3270.cursor_addr);
2578 2578 }
... ... @@ -2592,9 +2592,9 @@ LIB3270_ACTION( eraseeol )
2592 2592 if (d == DBCS_RIGHT) {
2593 2593 baddr = h3270.cursor_addr;
2594 2594 DEC_BA(baddr);
2595   - ea_buf[baddr].cc = EBC_si;
  2595 + h3270.ea_buf[baddr].cc = EBC_si;
2596 2596 } else
2597   - ea_buf[h3270.cursor_addr].cc = EBC_si;
  2597 + h3270.ea_buf[h3270.cursor_addr].cc = EBC_si;
2598 2598 }
2599 2599 (void) ctlr_dbcs_postprocess();
2600 2600 screen_disp(&h3270);
... ... @@ -2624,7 +2624,7 @@ LIB3270_ACTION( eraseeof )
2624 2624 #endif /*]*/
2625 2625 baddr = hSession->cursor_addr;
2626 2626 fa = get_field_attribute(hSession,baddr);
2627   - if (FA_IS_PROTECTED(fa) || ea_buf[baddr].fa) {
  2627 + if (FA_IS_PROTECTED(fa) || h3270.ea_buf[baddr].fa) {
2628 2628 operator_error(KL_OERR_PROTECTED);
2629 2629 return -1;
2630 2630 }
... ... @@ -2632,7 +2632,7 @@ LIB3270_ACTION( eraseeof )
2632 2632 do {
2633 2633 ctlr_add(baddr, EBC_null, 0);
2634 2634 INC_BA(baddr);
2635   - } while (!ea_buf[baddr].fa);
  2635 + } while (!h3270.ea_buf[baddr].fa);
2636 2636 mdt_set(hSession->cursor_addr);
2637 2637 } else { /* erase to end of screen */
2638 2638 do {
... ... @@ -2647,9 +2647,9 @@ LIB3270_ACTION( eraseeof )
2647 2647 if (d == DBCS_RIGHT) {
2648 2648 baddr = hSession->cursor_addr;
2649 2649 DEC_BA(baddr);
2650   - ea_buf[baddr].cc = EBC_si;
  2650 + h3270.ea_buf[baddr].cc = EBC_si;
2651 2651 } else
2652   - ea_buf[hSession->cursor_addr].cc = EBC_si;
  2652 + h3270.ea_buf[hSession->cursor_addr].cc = EBC_si;
2653 2653 }
2654 2654 (void) ctlr_dbcs_postprocess();
2655 2655 screen_disp(hSession);
... ... @@ -2675,14 +2675,14 @@ LIB3270_ACTION( eraseinput )
2675 2675 /* find first field attribute */
2676 2676 baddr = 0;
2677 2677 do {
2678   - if (ea_buf[baddr].fa)
  2678 + if (h3270.ea_buf[baddr].fa)
2679 2679 break;
2680 2680 INC_BA(baddr);
2681 2681 } while (baddr != 0);
2682 2682 sbaddr = baddr;
2683 2683 f = False;
2684 2684 do {
2685   - fa = ea_buf[baddr].fa;
  2685 + fa = h3270.ea_buf[baddr].fa;
2686 2686 if (!FA_IS_PROTECTED(fa)) {
2687 2687 mdt_clear(baddr);
2688 2688 do {
... ... @@ -2691,14 +2691,14 @@ LIB3270_ACTION( eraseinput )
2691 2691 cursor_move(baddr);
2692 2692 f = True;
2693 2693 }
2694   - if (!ea_buf[baddr].fa) {
  2694 + if (!h3270.ea_buf[baddr].fa) {
2695 2695 ctlr_add(baddr, EBC_null, 0);
2696 2696 }
2697   - } while (!ea_buf[baddr].fa);
  2697 + } while (!h3270.ea_buf[baddr].fa);
2698 2698 } else { /* skip protected */
2699 2699 do {
2700 2700 INC_BA(baddr);
2701   - } while (!ea_buf[baddr].fa);
  2701 + } while (!h3270.ea_buf[baddr].fa);
2702 2702 }
2703 2703 } while (baddr != sbaddr);
2704 2704 if (!f)
... ... @@ -2744,7 +2744,7 @@ LIB3270_ACTION( deleteword )
2744 2744 fa = get_field_attribute(hSession,baddr);
2745 2745  
2746 2746 /* Make sure we're on a modifiable field. */
2747   - if (FA_IS_PROTECTED(fa) || ea_buf[baddr].fa) {
  2747 + if (FA_IS_PROTECTED(fa) || hSession->ea_buf[baddr].fa) {
2748 2748 operator_error(KL_OERR_PROTECTED);
2749 2749 return -1;
2750 2750 }
... ... @@ -2753,10 +2753,10 @@ LIB3270_ACTION( deleteword )
2753 2753 for (;;) {
2754 2754 baddr = hSession->cursor_addr;
2755 2755 DEC_BA(baddr);
2756   - if (ea_buf[baddr].fa)
  2756 + if (hSession->ea_buf[baddr].fa)
2757 2757 return 0;
2758   - if (ea_buf[baddr].cc == EBC_null ||
2759   - ea_buf[baddr].cc == EBC_space)
  2758 + if (hSession->ea_buf[baddr].cc == EBC_null ||
  2759 + hSession->ea_buf[baddr].cc == EBC_space)
2760 2760 do_erase();
2761 2761 else
2762 2762 break;
... ... @@ -2766,10 +2766,10 @@ LIB3270_ACTION( deleteword )
2766 2766 for (;;) {
2767 2767 baddr = hSession->cursor_addr;
2768 2768 DEC_BA(baddr);
2769   - if (ea_buf[baddr].fa)
  2769 + if (hSession->ea_buf[baddr].fa)
2770 2770 return 0;
2771   - if (ea_buf[baddr].cc == EBC_null ||
2772   - ea_buf[baddr].cc == EBC_space)
  2771 + if (hSession->ea_buf[baddr].cc == EBC_null ||
  2772 + hSession->ea_buf[baddr].cc == EBC_space)
2773 2773 break;
2774 2774 else
2775 2775 do_erase();
... ... @@ -2809,16 +2809,16 @@ LIB3270_ACTION( deletefield )
2809 2809  
2810 2810 baddr = hSession->cursor_addr;
2811 2811 fa = get_field_attribute(hSession,baddr);
2812   - if (FA_IS_PROTECTED(fa) || ea_buf[baddr].fa) {
  2812 + if (FA_IS_PROTECTED(fa) || hSession->ea_buf[baddr].fa) {
2813 2813 operator_error(KL_OERR_PROTECTED);
2814 2814 return -1;
2815 2815 }
2816   - while (!ea_buf[baddr].fa)
  2816 + while (!hSession->ea_buf[baddr].fa)
2817 2817 DEC_BA(baddr);
2818 2818 INC_BA(baddr);
2819 2819 mdt_set(hSession->cursor_addr);
2820 2820 cursor_move(baddr);
2821   - while (!ea_buf[baddr].fa) {
  2821 + while (!hSession->ea_buf[baddr].fa) {
2822 2822 ctlr_add(baddr, EBC_null, 0);
2823 2823 INC_BA(baddr);
2824 2824 }
... ... @@ -2912,15 +2912,15 @@ LIB3270_ACTION( fieldend )
2912 2912 return 0;
2913 2913 baddr = hSession->cursor_addr;
2914 2914 faddr = find_field_attribute(hSession,baddr);
2915   - fa = ea_buf[faddr].fa;
  2915 + fa = hSession->ea_buf[faddr].fa;
2916 2916 if (faddr == baddr || FA_IS_PROTECTED(fa))
2917 2917 return 0;
2918 2918  
2919 2919 baddr = faddr;
2920 2920 while (True) {
2921 2921 INC_BA(baddr);
2922   - c = ea_buf[baddr].cc;
2923   - if (ea_buf[baddr].fa)
  2922 + c = hSession->ea_buf[baddr].cc;
  2923 + if (hSession->ea_buf[baddr].fa)
2924 2924 break;
2925 2925 if (c != EBC_null && c != EBC_space)
2926 2926 last_nonblank = baddr;
... ... @@ -2932,7 +2932,7 @@ LIB3270_ACTION( fieldend )
2932 2932 } else {
2933 2933 baddr = last_nonblank;
2934 2934 INC_BA(baddr);
2935   - if (ea_buf[baddr].fa)
  2935 + if (h3270.ea_buf[baddr].fa)
2936 2936 baddr = last_nonblank;
2937 2937 }
2938 2938 cursor_move(baddr);
... ... @@ -2997,7 +2997,7 @@ remargin(int lmargin)
2997 2997 ever = True;
2998 2998 }
2999 2999 faddr = find_field_attribute(&h3270,baddr);
3000   - fa = ea_buf[faddr].fa;
  3000 + fa = h3270.ea_buf[faddr].fa;
3001 3001 if (faddr == baddr || FA_IS_PROTECTED(fa)) {
3002 3002 baddr = next_unprotected(baddr);
3003 3003 if (baddr <= b0)
... ... @@ -3523,7 +3523,7 @@ kybd_prime(void)
3523 3523 return 0;
3524 3524  
3525 3525 fa = get_field_attribute(&h3270,h3270.cursor_addr);
3526   - if (ea_buf[h3270.cursor_addr].fa || FA_IS_PROTECTED(fa)) {
  3526 + if (h3270.ea_buf[h3270.cursor_addr].fa || FA_IS_PROTECTED(fa)) {
3527 3527 /*
3528 3528 * The cursor is not in an unprotected field. Find the
3529 3529 * next one.
... ... @@ -3538,7 +3538,7 @@ kybd_prime(void)
3538 3538 } else {
3539 3539 /* Already in an unprotected field. Find its start. */
3540 3540 baddr = h3270.cursor_addr;
3541   - while (!ea_buf[baddr].fa) {
  3541 + while (!h3270.ea_buf[baddr].fa) {
3542 3542 DEC_BA(baddr);
3543 3543 }
3544 3544 INC_BA(baddr);
... ... @@ -3548,7 +3548,7 @@ kybd_prime(void)
3548 3548 cursor_move(baddr);
3549 3549  
3550 3550 /* Erase it. */
3551   - while (!ea_buf[baddr].fa) {
  3551 + while (!h3270.ea_buf[baddr].fa) {
3552 3552 ctlr_add(baddr, 0, 0);
3553 3553 len++;
3554 3554 INC_BA(baddr);
... ...
src/lib3270/paste.c
... ... @@ -112,7 +112,7 @@
112 112 }
113 113  
114 114 faddr = find_field_attribute(&h3270,baddr);
115   - fa = ea_buf[faddr].fa;
  115 + fa = h3270.ea_buf[faddr].fa;
116 116 if (faddr == baddr || FA_IS_PROTECTED(fa))
117 117 {
118 118 baddr = next_unprotected(baddr);
... ... @@ -133,7 +133,7 @@
133 133 if(toggled(SMART_PASTE))
134 134 {
135 135 int faddr = find_field_attribute(&h3270,h3270.cursor_addr);
136   - if(FA_IS_PROTECTED(ea_buf[faddr].fa))
  136 + if(FA_IS_PROTECTED(h3270.ea_buf[faddr].fa))
137 137 h3270.cursor_addr++;
138 138 else
139 139 key_ACharacter(c, KT_STD, IA_PASTE, NULL);
... ... @@ -191,7 +191,7 @@ LIB3270_EXPORT int lib3270_set_string(H3270 *h, const unsigned char *str)
191 191 baddr = (h->cursor_addr + h->cols) % (h->cols * h->rows); /* down */
192 192 baddr = (baddr / h->cols) * h->cols; /* 1st col */
193 193 faddr = find_field_attribute(h,baddr);
194   - fa = ea_buf[faddr].fa;
  194 + fa = h3270.ea_buf[faddr].fa;
195 195 if (faddr != baddr && !FA_IS_PROTECTED(fa))
196 196 cursor_move(baddr);
197 197 else
... ...
src/lib3270/print.c
... ... @@ -151,7 +151,7 @@ fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html)
151 151 int nr = 0;
152 152 Boolean any = False;
153 153 int fa_addr = find_field_attribute(&h3270,0);
154   - unsigned char fa = ea_buf[fa_addr].fa;
  154 + unsigned char fa = h3270.ea_buf[fa_addr].fa;
155 155 int fa_color, current_color;
156 156 Bool fa_high, current_high;
157 157  
... ... @@ -159,13 +159,13 @@ fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html)
159 159 even_if_empty = True;
160 160 }
161 161  
162   - if (ea_buf[fa_addr].fg)
163   - fa_color = ea_buf[fa_addr].fg & 0x0f;
  162 + if (h3270.ea_buf[fa_addr].fg)
  163 + fa_color = h3270.ea_buf[fa_addr].fg & 0x0f;
164 164 else
165 165 fa_color = color_from_fa(fa);
166 166 current_color = fa_color;
167 167  
168   - if (ea_buf[fa_addr].gr & GR_INTENSIFY)
  168 + if (h3270.ea_buf[fa_addr].gr & GR_INTENSIFY)
169 169 fa_high = True;
170 170 else
171 171 fa_high = FA_IS_HIGH(fa);
... ... @@ -181,14 +181,14 @@ fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html)
181 181 nr++;
182 182 ns = 0;
183 183 }
184   - if (ea_buf[i].fa) {
  184 + if (h3270.ea_buf[i].fa) {
185 185 c = ' ';
186   - fa = ea_buf[i].fa;
187   - if (ea_buf[i].fg)
188   - fa_color = ea_buf[i].fg & 0x0f;
  186 + fa = h3270.ea_buf[i].fa;
  187 + if (h3270.ea_buf[i].fg)
  188 + fa_color = h3270.ea_buf[i].fg & 0x0f;
189 189 else
190 190 fa_color = color_from_fa(fa);
191   - if (ea_buf[i].gr & GR_INTENSIFY)
  191 + if (h3270.ea_buf[i].gr & GR_INTENSIFY)
192 192 fa_high = True;
193 193 else
194 194 fa_high = FA_IS_HIGH(fa);
... ... @@ -215,7 +215,7 @@ fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html)
215 215 }
216 216 #else /*][*/
217 217 else
218   - c = ebc2asc[ea_buf[i].cc];
  218 + c = ebc2asc[h3270.ea_buf[i].cc];
219 219 #endif /*]*/
220 220 if (c == ' ')
221 221 ns++;
... ... @@ -232,8 +232,8 @@ fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html)
232 232 int color;
233 233 Bool high;
234 234  
235   - if (ea_buf[i].fg)
236   - color = ea_buf[i].fg & 0x0f;
  235 + if (h3270.ea_buf[i].fg)
  236 + color = h3270.ea_buf[i].fg & 0x0f;
237 237 else
238 238 color = fa_color;
239 239 if (color != current_color) {
... ... @@ -242,7 +242,7 @@ fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html)
242 242 html_color(color));
243 243 current_color = color;
244 244 }
245   - if (ea_buf[i].gr & GR_INTENSIFY)
  245 + if (h3270.ea_buf[i].gr & GR_INTENSIFY)
246 246 high = True;
247 247 else
248 248 high = fa_high;
... ...
src/lib3270/screen.c
... ... @@ -99,12 +99,12 @@ void set_display_charset(char *dcs)
99 99  
100 100 static void addch(H3270 *session, int baddr, unsigned char c, unsigned short attr)
101 101 {
102   - if(ea_buf[baddr].chr == c && ea_buf[baddr].attr == attr)
  102 + if(session->ea_buf[baddr].chr == c && session->ea_buf[baddr].attr == attr)
103 103 return;
104 104  
105 105 /* Converted char has changed, update it */
106   - ea_buf[baddr].chr = c;
107   - ea_buf[baddr].attr = attr;
  106 + session->ea_buf[baddr].chr = c;
  107 + session->ea_buf[baddr].attr = attr;
108 108  
109 109 if(session->update)
110 110 session->update(session,baddr,c,attr,baddr == session->cursor_addr);
... ... @@ -161,10 +161,10 @@ static unsigned short calc_attrs(int baddr, int fa_addr, int fa)
161 161  
162 162 /* Monochrome is easy, and so is color if nothing is specified. */
163 163 if (!appres.m3279 ||
164   - (!ea_buf[baddr].fg &&
165   - !ea_buf[fa_addr].fg &&
166   - !ea_buf[baddr].bg &&
167   - !ea_buf[fa_addr].bg))
  164 + (!h3270.ea_buf[baddr].fg &&
  165 + !h3270.ea_buf[fa_addr].fg &&
  166 + !h3270.ea_buf[baddr].bg &&
  167 + !h3270.ea_buf[fa_addr].bg))
168 168 {
169 169 a = color_from_fa(fa);
170 170 }
... ... @@ -172,23 +172,23 @@ static unsigned short calc_attrs(int baddr, int fa_addr, int fa)
172 172 {
173 173  
174 174 /* The current location or the fa specifies the fg or bg. */
175   - if (ea_buf[baddr].fg)
  175 + if (h3270.ea_buf[baddr].fg)
176 176 {
177   - fg = ea_buf[baddr].fg & 0x0f;
  177 + fg = h3270.ea_buf[baddr].fg & 0x0f;
178 178 }
179   - else if (ea_buf[fa_addr].fg)
  179 + else if (h3270.ea_buf[fa_addr].fg)
180 180 {
181   - fg = ea_buf[fa_addr].fg & 0x0f;
  181 + fg = h3270.ea_buf[fa_addr].fg & 0x0f;
182 182 }
183 183 else
184 184 {
185 185 fg = DEFCOLOR_MAP(fa);
186 186 }
187 187  
188   - if (ea_buf[baddr].bg)
189   - bg = ea_buf[baddr].bg & 0x0f;
190   - else if (ea_buf[fa_addr].bg)
191   - bg = ea_buf[fa_addr].bg & 0x0f;
  188 + if (h3270.ea_buf[baddr].bg)
  189 + bg = h3270.ea_buf[baddr].bg & 0x0f;
  190 + else if (h3270.ea_buf[fa_addr].bg)
  191 + bg = h3270.ea_buf[fa_addr].bg & 0x0f;
192 192 else
193 193 bg = 0;
194 194  
... ... @@ -197,10 +197,10 @@ static unsigned short calc_attrs(int baddr, int fa_addr, int fa)
197 197  
198 198 /* Compute the display attributes. */
199 199  
200   - if (ea_buf[baddr].gr)
201   - gr = ea_buf[baddr].gr;
202   - else if (ea_buf[fa_addr].gr)
203   - gr = ea_buf[fa_addr].gr;
  200 + if (h3270.ea_buf[baddr].gr)
  201 + gr = h3270.ea_buf[baddr].gr;
  202 + else if (h3270.ea_buf[fa_addr].gr)
  203 + gr = h3270.ea_buf[fa_addr].gr;
204 204 else
205 205 gr = 0;
206 206  
... ... @@ -271,8 +271,8 @@ LIB3270_EXPORT int lib3270_get_contents(H3270 *h, int first, int last, unsigned
271 271  
272 272 for(baddr = first; baddr <= last;baddr++)
273 273 {
274   - *(chr++) = ea_buf[baddr].chr ? ea_buf[baddr].chr : ' ';
275   - *(attr++) = ea_buf[baddr].attr;
  274 + *(chr++) = h3270.ea_buf[baddr].chr ? h3270.ea_buf[baddr].chr : ' ';
  275 + *(attr++) = h3270.ea_buf[baddr].attr;
276 276 }
277 277  
278 278 return 0;
... ... @@ -294,13 +294,13 @@ int screen_read(char *dest, int baddr, int count)
294 294 return EFAULT;
295 295 }
296 296  
297   - if (ea_buf[baddr].fa)
298   - fa = ea_buf[baddr].fa;
  297 + if (h3270.ea_buf[baddr].fa)
  298 + fa = h3270.ea_buf[baddr].fa;
299 299  
300 300 if(FA_IS_ZERO(fa))
301 301 *dest = ' ';
302   - else if(ea_buf[baddr].cc)
303   - *dest = ebc2asc[ea_buf[baddr].cc];
  302 + else if(h3270.ea_buf[baddr].cc)
  303 + *dest = ebc2asc[h3270.ea_buf[baddr].cc];
304 304 else
305 305 *dest = ' ';
306 306  
... ... @@ -329,11 +329,11 @@ static void screen_update(H3270 *session, int bstart, int bend)
329 329  
330 330 for(baddr = bstart; baddr < bend; baddr++)
331 331 {
332   - if(ea_buf[baddr].fa)
  332 + if(session->ea_buf[baddr].fa)
333 333 {
334 334 // Field attribute.
335 335 fa_addr = baddr;
336   - fa = ea_buf[baddr].fa;
  336 + fa = session->ea_buf[baddr].fa;
337 337 a = calc_attrs(baddr, baddr, fa);
338 338 addch(session,baddr,' ',(attr = COLOR_GREEN)|CHAR_ATTR_MARKER);
339 339 }
... ... @@ -345,7 +345,7 @@ static void screen_update(H3270 *session, int bstart, int bend)
345 345 else
346 346 {
347 347 // Normal text.
348   - if (!(ea_buf[baddr].gr || ea_buf[baddr].fg || ea_buf[baddr].bg))
  348 + if (!(session->ea_buf[baddr].gr || session->ea_buf[baddr].fg || session->ea_buf[baddr].bg))
349 349 {
350 350 attr = a;
351 351 }
... ... @@ -361,20 +361,20 @@ static void screen_update(H3270 *session, int bstart, int bend)
361 361 attr = calc_attrs(baddr, fa_addr, fa);
362 362 }
363 363  
364   - if (ea_buf[baddr].cs == CS_LINEDRAW)
  364 + if (session->ea_buf[baddr].cs == CS_LINEDRAW)
365 365 {
366   - addch(session,baddr,ea_buf[baddr].cc,attr);
  366 + addch(session,baddr,session->ea_buf[baddr].cc,attr);
367 367 }
368   - else if (ea_buf[baddr].cs == CS_APL || (ea_buf[baddr].cs & CS_GE))
  368 + else if (session->ea_buf[baddr].cs == CS_APL || (session->ea_buf[baddr].cs & CS_GE))
369 369 {
370   - addch(session,baddr,ea_buf[baddr].cc,attr|CHAR_ATTR_CG);
  370 + addch(session,baddr,session->ea_buf[baddr].cc,attr|CHAR_ATTR_CG);
371 371 }
372 372 else
373 373 {
374 374 if (toggled(MONOCASE))
375   - addch(session,baddr,asc2uc[ebc2asc[ea_buf[baddr].cc]],attr);
  375 + addch(session,baddr,asc2uc[ebc2asc[session->ea_buf[baddr].cc]],attr);
376 376 else
377   - addch(session,baddr,ebc2asc[ea_buf[baddr].cc],attr);
  377 + addch(session,baddr,ebc2asc[session->ea_buf[baddr].cc],attr);
378 378 }
379 379 }
380 380  
... ... @@ -419,7 +419,7 @@ LIB3270_EXPORT int lib3270_set_cursor_address(H3270 *h, int baddr)
419 419 h->cursor_addr = baddr;
420 420  
421 421 if(h->update_cursor)
422   - h->update_cursor(h,(unsigned short) (baddr/h->cols),(unsigned short) (baddr%h->cols),ea_buf[baddr].chr,ea_buf[baddr].attr);
  422 + h->update_cursor(h,(unsigned short) (baddr/h->cols),(unsigned short) (baddr%h->cols),h->ea_buf[baddr].chr,h->ea_buf[baddr].attr);
423 423  
424 424 return ret;
425 425 }
... ... @@ -778,10 +778,10 @@ LIB3270_ACTION( testpattern )
778 778 }
779 779 pos = 0;
780 780 }
781   - ea_buf[f].fg = fg;
782   - ea_buf[f].bg = (fg == COLOR_BLACK) ? COLOR_WHITE : COLOR_BLACK;
783   - ea_buf[f].cs = pat[row].cs;
784   - ea_buf[f].cc = pat[row].cc[pos++];
  781 + hSession->ea_buf[f].fg = fg;
  782 + hSession->ea_buf[f].bg = (fg == COLOR_BLACK) ? COLOR_WHITE : COLOR_BLACK;
  783 + hSession->ea_buf[f].cs = pat[row].cs;
  784 + hSession->ea_buf[f].cc = pat[row].cc[pos++];
785 785 }
786 786  
787 787 Trace("%s display",__FUNCTION__);
... ...
src/lib3270/selection.c
... ... @@ -67,10 +67,10 @@ static void update_selected_rectangle(H3270 *session)
67 67 {
68 68 for(col = 0; col < session->cols;col++)
69 69 {
70   - if(!(row >= p[0].row && row <= p[1].row && col >= p[0].col && col <= p[1].col) && (ea_buf[baddr].attr & LIB3270_ATTR_SELECTED))
  70 + if(!(row >= p[0].row && row <= p[1].row && col >= p[0].col && col <= p[1].col) && (session->ea_buf[baddr].attr & LIB3270_ATTR_SELECTED))
71 71 {
72   - ea_buf[baddr].attr &= ~LIB3270_ATTR_SELECTED;
73   - session->update(session,baddr,ea_buf[baddr].chr,ea_buf[baddr].attr,baddr == session->cursor_addr);
  72 + session->ea_buf[baddr].attr &= ~LIB3270_ATTR_SELECTED;
  73 + session->update(session,baddr,session->ea_buf[baddr].chr,session->ea_buf[baddr].attr,baddr == session->cursor_addr);
74 74 }
75 75 baddr++;
76 76 }
... ... @@ -82,10 +82,10 @@ static void update_selected_rectangle(H3270 *session)
82 82 {
83 83 for(col = 0; col < session->cols;col++)
84 84 {
85   - if((row >= p[0].row && row <= p[1].row && col >= p[0].col && col <= p[1].col) && !(ea_buf[baddr].attr & LIB3270_ATTR_SELECTED))
  85 + if((row >= p[0].row && row <= p[1].row && col >= p[0].col && col <= p[1].col) && !(session->ea_buf[baddr].attr & LIB3270_ATTR_SELECTED))
86 86 {
87   - ea_buf[baddr].attr |= LIB3270_ATTR_SELECTED;
88   - session->update(session,baddr,ea_buf[baddr].chr,ea_buf[baddr].attr,baddr == session->cursor_addr);
  87 + session->ea_buf[baddr].attr |= LIB3270_ATTR_SELECTED;
  88 + session->update(session,baddr,session->ea_buf[baddr].chr,session->ea_buf[baddr].attr,baddr == session->cursor_addr);
89 89 }
90 90 baddr++;
91 91 }
... ... @@ -110,29 +110,29 @@ static void update_selected_region(H3270 *session)
110 110 // First remove unselected areas
111 111 for(baddr = 0; baddr < begin; baddr++)
112 112 {
113   - if(ea_buf[baddr].attr & LIB3270_ATTR_SELECTED)
  113 + if(session->ea_buf[baddr].attr & LIB3270_ATTR_SELECTED)
114 114 {
115   - ea_buf[baddr].attr &= ~LIB3270_ATTR_SELECTED;
116   - session->update(session,baddr,ea_buf[baddr].chr,ea_buf[baddr].attr,baddr == session->cursor_addr);
  115 + session->ea_buf[baddr].attr &= ~LIB3270_ATTR_SELECTED;
  116 + session->update(session,baddr,session->ea_buf[baddr].chr,session->ea_buf[baddr].attr,baddr == session->cursor_addr);
117 117 }
118 118 }
119 119  
120 120 for(baddr = end+1; baddr < len; baddr++)
121 121 {
122   - if(ea_buf[baddr].attr & LIB3270_ATTR_SELECTED)
  122 + if(session->ea_buf[baddr].attr & LIB3270_ATTR_SELECTED)
123 123 {
124   - ea_buf[baddr].attr &= ~LIB3270_ATTR_SELECTED;
125   - session->update(session,baddr,ea_buf[baddr].chr,ea_buf[baddr].attr,baddr == session->cursor_addr);
  124 + session->ea_buf[baddr].attr &= ~LIB3270_ATTR_SELECTED;
  125 + session->update(session,baddr,session->ea_buf[baddr].chr,session->ea_buf[baddr].attr,baddr == session->cursor_addr);
126 126 }
127 127 }
128 128  
129 129 // Then draw the selected ones
130 130 for(baddr = begin; baddr <= end; baddr++)
131 131 {
132   - if(!(ea_buf[baddr].attr & LIB3270_ATTR_SELECTED))
  132 + if(!(session->ea_buf[baddr].attr & LIB3270_ATTR_SELECTED))
133 133 {
134   - ea_buf[baddr].attr |= LIB3270_ATTR_SELECTED;
135   - session->update(session,baddr,ea_buf[baddr].chr,ea_buf[baddr].attr,baddr == session->cursor_addr);
  134 + session->ea_buf[baddr].attr |= LIB3270_ATTR_SELECTED;
  135 + session->update(session,baddr,session->ea_buf[baddr].chr,session->ea_buf[baddr].attr,baddr == session->cursor_addr);
136 136 }
137 137 }
138 138  
... ... @@ -173,22 +173,23 @@ LIB3270_ACTION(unselect)
173 173 CHECK_SESSION_HANDLE(hSession);
174 174  
175 175 if(!hSession->selected)
176   - return;
  176 + return 0;
177 177  
178 178 hSession->selected = 0;
179 179  
180 180 for(a = 0; a < hSession->rows*hSession->cols; a++)
181 181 {
182   - if(ea_buf[a].attr & LIB3270_ATTR_SELECTED)
  182 + if(hSession->ea_buf[a].attr & LIB3270_ATTR_SELECTED)
183 183 {
184   - ea_buf[a].attr &= ~LIB3270_ATTR_SELECTED;
  184 + hSession->ea_buf[a].attr &= ~LIB3270_ATTR_SELECTED;
185 185 if(hSession->update)
186   - hSession->update(hSession,a,ea_buf[a].chr,ea_buf[a].attr,a == hSession->cursor_addr);
  186 + hSession->update(hSession,a,hSession->ea_buf[a].chr,hSession->ea_buf[a].attr,a == hSession->cursor_addr);
187 187 }
188 188 }
189 189  
190 190 hSession->set_selection(hSession,0);
191 191  
  192 + return 0;
192 193 }
193 194  
194 195 LIB3270_EXPORT void lib3270_select_to(H3270 *session, int baddr)
... ... @@ -216,17 +217,17 @@ LIB3270_EXPORT void lib3270_select_word(H3270 *session, int baddr)
216 217  
217 218 CHECK_SESSION_HANDLE(session);
218 219  
219   - if(!lib3270_connected(session) || isspace(ea_buf[baddr].chr))
  220 + if(!lib3270_connected(session) || isspace(session->ea_buf[baddr].chr))
220 221 {
221 222 lib3270_ring_bell(session);
222 223 return;
223 224 }
224 225  
225   - for(pos = baddr; pos > 0 && !isspace(ea_buf[pos].chr);pos--);
  226 + for(pos = baddr; pos > 0 && !isspace(session->ea_buf[pos].chr);pos--);
226 227 session->select.begin = pos > 0 ? pos+1 : 0;
227 228  
228 229 len = session->rows * session->cols;
229   - for(pos = baddr; pos < len && !isspace(ea_buf[pos].chr);pos++);
  230 + for(pos = baddr; pos < len && !isspace(session->ea_buf[pos].chr);pos++);
230 231 session->select.end = pos < len ? pos-1 : len;
231 232  
232 233 set_selected(session);
... ... @@ -271,6 +272,7 @@ LIB3270_ACTION( selectfield )
271 272 {
272 273 CHECK_SESSION_HANDLE(hSession);
273 274 lib3270_select_field_at(hSession,hSession->cursor_addr);
  275 + return 0;
274 276 }
275 277  
276 278 LIB3270_ACTION( selectall )
... ... @@ -283,14 +285,16 @@ LIB3270_ACTION( selectall )
283 285 // First remove unselected areas
284 286 for(baddr = 0; baddr < len; baddr++)
285 287 {
286   - if(!(ea_buf[baddr].attr & LIB3270_ATTR_SELECTED))
  288 + if(!(hSession->ea_buf[baddr].attr & LIB3270_ATTR_SELECTED))
287 289 {
288   - ea_buf[baddr].attr |= LIB3270_ATTR_SELECTED;
289   - hSession->update(hSession,baddr,ea_buf[baddr].chr,ea_buf[baddr].attr,baddr == hSession->cursor_addr);
  290 + hSession->ea_buf[baddr].attr |= LIB3270_ATTR_SELECTED;
  291 + hSession->update(hSession,baddr,hSession->ea_buf[baddr].chr,hSession->ea_buf[baddr].attr,baddr == hSession->cursor_addr);
290 292 }
291 293 }
292 294  
293 295 set_selected(hSession);
  296 +
  297 + return 0;
294 298 }
295 299  
296 300 LIB3270_ACTION( reselect )
... ... @@ -298,8 +302,11 @@ LIB3270_ACTION( reselect )
298 302 CHECK_SESSION_HANDLE(hSession);
299 303  
300 304 if(hSession->selected || hSession->select.begin == hSession->select.end)
301   - return;
  305 + return 0;
302 306  
303 307 update_selection(hSession);
304 308 set_selected(hSession);
  309 +
  310 + return 0;
305 311 }
  312 +
... ...