diff --git a/ctlr.c b/ctlr.c index 89170ab..e97a813 100644 --- a/ctlr.c +++ b/ctlr.c @@ -357,7 +357,7 @@ unsigned char get_field_attribute(H3270 *h, int baddr) * buffer address. Return the attribute in a parameter. * * Returns True if an attribute is found, False if boundary hit. - */ + */ /* Boolean get_bounded_field_attribute(register int baddr, register int bound, unsigned char *fa_out) @@ -378,25 +378,26 @@ get_bounded_field_attribute(register int baddr, register int bound, DEC_BA(baddr); } while (baddr != sbaddr && baddr != bound); - /* Screen is unformatted (and 'formatted' is inaccurate). */ + // Screen is unformatted (and 'formatted' is inaccurate). if (baddr == sbaddr) { *fa_out = h3270.ea_buf[-1].fa; return True; } - /* Wrapped to boundary. */ + // Wrapped to boundary. return False; -} +} */ /* * Given the address of a field attribute, return the address of the * extended attribute structure. - */ + */ /* struct ea * fa2ea(int baddr) { return &h3270.ea_buf[baddr]; } +*/ /* * Find the next unprotected field. Returns the address following the @@ -507,7 +508,7 @@ process_ds(unsigned char *buf, int buflen) case CMD_RB: /* read buffer */ case SNA_CMD_RB: trace_ds("ReadBuffer\n"); - ctlr_read_buffer(h3270.aid); + ctlr_read_buffer(&h3270,h3270.aid); return PDS_OKAY_OUTPUT; break; case CMD_RM: /* read modifed */ @@ -777,8 +778,7 @@ ctlr_read_modified(unsigned char aid_byte, Boolean all) * Process a 3270 Read-Buffer command and transmit the data back to the * host. */ -void -ctlr_read_buffer(unsigned char aid_byte) +void ctlr_read_buffer(H3270 *hSession, unsigned char aid_byte) { register int baddr; unsigned char fa; @@ -801,13 +801,13 @@ ctlr_read_buffer(unsigned char aid_byte) space3270out(3); *obptr++ = aid_byte; - ENCODE_BADDR(obptr, h3270.cursor_addr); - trace_ds("%s%s", see_aid(aid_byte), rcba(&h3270,h3270.cursor_addr)); + ENCODE_BADDR(obptr, hSession->cursor_addr); + trace_ds("%s%s", see_aid(aid_byte), rcba(hSession,hSession->cursor_addr)); baddr = 0; do { - if (h3270.ea_buf[baddr].fa) { - if (h3270.reply_mode == SF_SRM_FIELD) { + if (hSession->ea_buf[baddr].fa) { + if (hSession->reply_mode == SF_SRM_FIELD) { space3270out(2); *obptr++ = ORDER_SF; } else { @@ -817,41 +817,41 @@ ctlr_read_buffer(unsigned char aid_byte) *obptr++ = 1; /* for now */ *obptr++ = XA_3270; } - fa = h3270.ea_buf[baddr].fa & ~FA_PRINTABLE; + fa = hSession->ea_buf[baddr].fa & ~FA_PRINTABLE; *obptr++ = code_table[fa]; if (any) trace_ds("'"); trace_ds(" StartField%s%s%s", - (h3270.reply_mode == SF_SRM_FIELD) ? "" : "Extended", - rcba(&h3270,baddr), see_attr(fa)); - if (h3270.reply_mode != SF_SRM_FIELD) { - if (h3270.ea_buf[baddr].fg) { + (hSession->reply_mode == SF_SRM_FIELD) ? "" : "Extended", + rcba(hSession,baddr), see_attr(fa)); + if (hSession->reply_mode != SF_SRM_FIELD) { + if (hSession->ea_buf[baddr].fg) { space3270out(2); *obptr++ = XA_FOREGROUND; - *obptr++ = h3270.ea_buf[baddr].fg; - trace_ds("%s", see_efa(XA_FOREGROUND, h3270.ea_buf[baddr].fg)); + *obptr++ = hSession->ea_buf[baddr].fg; + trace_ds("%s", see_efa(XA_FOREGROUND, hSession->ea_buf[baddr].fg)); (*(obuf + attr_count))++; } - if (h3270.ea_buf[baddr].bg) { + if (hSession->ea_buf[baddr].bg) { space3270out(2); *obptr++ = XA_BACKGROUND; - *obptr++ = h3270.ea_buf[baddr].bg; - trace_ds("%s", see_efa(XA_BACKGROUND, h3270.ea_buf[baddr].bg)); + *obptr++ = hSession->ea_buf[baddr].bg; + trace_ds("%s", see_efa(XA_BACKGROUND, hSession->ea_buf[baddr].bg)); (*(obuf + attr_count))++; } - if (h3270.ea_buf[baddr].gr) { + if (hSession->ea_buf[baddr].gr) { space3270out(2); *obptr++ = XA_HIGHLIGHTING; - *obptr++ = h3270.ea_buf[baddr].gr | 0xf0; + *obptr++ = hSession->ea_buf[baddr].gr | 0xf0; trace_ds("%s", see_efa(XA_HIGHLIGHTING, - h3270.ea_buf[baddr].gr | 0xf0)); + hSession->ea_buf[baddr].gr | 0xf0)); (*(obuf + attr_count))++; } - if (h3270.ea_buf[baddr].cs & CS_MASK) { + if (hSession->ea_buf[baddr].cs & CS_MASK) { space3270out(2); *obptr++ = XA_CHARSET; - *obptr++ = host_cs(h3270.ea_buf[baddr].cs); - trace_ds("%s", see_efa(XA_CHARSET,host_cs(h3270.ea_buf[baddr].cs))); + *obptr++ = host_cs(hSession->ea_buf[baddr].cs); + trace_ds("%s", see_efa(XA_CHARSET,host_cs(hSession->ea_buf[baddr].cs))); (*(obuf + attr_count))++; } } @@ -863,7 +863,7 @@ ctlr_read_buffer(unsigned char aid_byte) ¤t_gr, ¤t_cs, &any); - if (h3270.ea_buf[baddr].cs & CS_GE) { + if (hSession->ea_buf[baddr].cs & CS_GE) { space3270out(1); *obptr++ = ORDER_GE; if (any) @@ -872,18 +872,18 @@ ctlr_read_buffer(unsigned char aid_byte) any = False; } space3270out(1); - *obptr++ = h3270.ea_buf[baddr].cc; - if (h3270.ea_buf[baddr].cc <= 0x3f || - h3270.ea_buf[baddr].cc == 0xff) { + *obptr++ = hSession->ea_buf[baddr].cc; + if (hSession->ea_buf[baddr].cc <= 0x3f || + hSession->ea_buf[baddr].cc == 0xff) { if (any) trace_ds("'"); - trace_ds(" %s", see_ebc(h3270.ea_buf[baddr].cc)); + trace_ds(" %s", see_ebc(hSession->ea_buf[baddr].cc)); any = False; } else { if (!any) trace_ds(" '"); - trace_ds("%s", see_ebc(h3270.ea_buf[baddr].cc)); + trace_ds("%s", see_ebc(hSession->ea_buf[baddr].cc)); any = True; } } diff --git a/ctlrc.h b/ctlrc.h index 97c577b..d39ff73 100644 --- a/ctlrc.h +++ b/ctlrc.h @@ -50,10 +50,10 @@ LIB3270_INTERNAL void ctlr_altbuffer(H3270 *session, int alt); LIB3270_INTERNAL int ctlr_any_data(H3270 *session); LIB3270_INTERNAL void ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea); // LIB3270_INTERNAL void ctlr_changed(int bstart, int bend); -LIB3270_INTERNAL void ctlr_clear(H3270 *session, Boolean can_snap); +LIB3270_INTERNAL void ctlr_clear(H3270 *hSession, Boolean can_snap); LIB3270_INTERNAL void ctlr_erase_all_unprotected(H3270 *hSession); LIB3270_INTERNAL void ctlr_init(H3270 *session, unsigned cmask); -LIB3270_INTERNAL void ctlr_read_buffer(unsigned char aid_byte); +LIB3270_INTERNAL void ctlr_read_buffer(H3270 *session, unsigned char aid_byte); LIB3270_INTERNAL void ctlr_read_modified(unsigned char aid_byte, Boolean all); LIB3270_INTERNAL void ctlr_reinit(H3270 *session, unsigned cmask); LIB3270_INTERNAL void ctlr_scroll(H3270 *hSession); @@ -63,9 +63,9 @@ LIB3270_INTERNAL void ctlr_scroll(H3270 *hSession); LIB3270_INTERNAL void ctlr_wrapping_memmove(H3270 *session, int baddr_to, int baddr_from, int count); LIB3270_INTERNAL enum pds ctlr_write(unsigned char buf[], int buflen, Boolean erase); LIB3270_INTERNAL void ctlr_write_sscp_lu(H3270 *session, unsigned char buf[], int buflen); -LIB3270_INTERNAL struct ea *fa2ea(int baddr); +// LIB3270_INTERNAL struct ea *fa2ea(int baddr); -LIB3270_INTERNAL Boolean get_bounded_field_attribute(register int baddr, register int bound, unsigned char *fa_out); +// LIB3270_INTERNAL Boolean get_bounded_field_attribute(register int baddr, register int bound, unsigned char *fa_out); LIB3270_INTERNAL void mdt_clear(int baddr); LIB3270_INTERNAL void mdt_set(int baddr); LIB3270_INTERNAL int next_unprotected(H3270 *session, int baddr0); diff --git a/sf.c b/sf.c index 78488f5..cf4619e 100644 --- a/sf.c +++ b/sf.c @@ -369,7 +369,7 @@ sf_read_part(unsigned char buf[], unsigned buflen) return PDS_BAD_CMD; } trace_ds("\n"); - ctlr_read_buffer(AID_QREPLY); + ctlr_read_buffer(&h3270,AID_QREPLY); break; case SNA_CMD_RM: trace_ds(" ReadModified"); diff --git a/telnet.c b/telnet.c index e89e26b..82697ef 100644 --- a/telnet.c +++ b/telnet.c @@ -2514,8 +2514,7 @@ store3270in(unsigned char c) * Allocates the buffer in BUFSIZ chunks. * Allocates hidden space at the front of the buffer for TN3270E. */ -void -space3270out(int n) +void space3270out(int n) { unsigned nc = 0; /* amount of data currently in obuf */ unsigned more = 0; -- libgit2 0.21.2