2
* Modifications Copyright 1993, 1994, 1995, 1996, 1999, 2000, 2001, 2002,
3
* 2003, 2004, 2005, 2006 by Paul Mattes.
4
* Original X11 Port Copyright 1990 by Jeff Sparkes.
5
* Permission to use, copy, modify, and distribute this software and its
6
* documentation for any purpose and without fee is hereby granted,
7
* provided that the above copyright notice appear in all copies and that
8
* both that copyright notice and this permission notice appear in
9
* supporting documentation.
11
* Copyright 1989 by Georgia Tech Research Corporation, Atlanta, GA 30332.
12
* All Rights Reserved. GTRC hereby grants public use of this software.
13
* Derivative works based on this software must incorporate this copyright
16
* x3270, c3270, s3270 and tcl3270 are distributed in the hope that they will
17
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE
2
* Copyright (c) 1993-2009, Paul Mattes.
3
* Copyright (c) 1990, Jeff Sparkes.
4
* Copyright (c) 1989, Georgia Tech Research Corporation (GTRC), Atlanta, GA
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions are met:
10
* * Redistributions of source code must retain the above copyright
11
* notice, this list of conditions and the following disclaimer.
12
* * Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in the
14
* documentation and/or other materials provided with the distribution.
15
* * Neither the names of Paul Mattes, Jeff Sparkes, GTRC nor the names of
16
* their contributors may be used to endorse or promote products derived
17
* from this software without specific prior written permission.
19
* THIS SOFTWARE IS PROVIDED BY PAUL MATTES, JEFF SPARKES AND GTRC "AS IS" AND
20
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
* ARE DISCLAIMED. IN NO EVENT SHALL PAUL MATTES, JEFF SPARKES OR GTRC BE
23
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
* POSSIBILITY OF SUCH DAMAGE.
301
325
* Called when a host connects, disconnects, or changes ANSI/3270 modes.
304
ctlr_connect(Boolean ignored unused)
328
ctlr_connect(Boolean ignored _is_unused)
307
331
status_untiming();
310
334
ea_buf[-1].fa = FA_PRINTABLE | FA_MODIFY;
335
aea_buf[-1].fa = FA_PRINTABLE | FA_MODIFY;
312
337
ea_buf[-1].fa = FA_PRINTABLE | FA_PROTECT;
338
aea_buf[-1].fa = FA_PRINTABLE | FA_PROTECT;
313
340
if (!IN_3270 || (IN_SSCP && (kybdlock & KL_OIA_TWAIT))) {
314
341
kybdlock_clr(KL_OIA_TWAIT, "ctlr_connect");
483
527
switch (buf[0]) { /* 3270 command */
484
528
case CMD_EAU: /* erase all unprotected */
485
529
case SNA_CMD_EAU:
530
ctlr_erase_all_unprotected();
486
531
trace_ds("EraseAllUnprotected\n");
487
ctlr_erase_all_unprotected();
488
532
return PDS_OKAY_NO_OUTPUT;
490
534
case CMD_EWA: /* erase/write alternate */
491
535
case SNA_CMD_EWA:
492
537
trace_ds("EraseWriteAlternate");
494
538
if ((rv = ctlr_write(buf, buflen, True)) < 0)
496
540
return PDS_OKAY_NO_OUTPUT;
498
542
case CMD_EW: /* erase/write */
500
545
trace_ds("EraseWrite");
502
546
if ((rv = ctlr_write(buf, buflen, True)) < 0)
504
548
return PDS_OKAY_NO_OUTPUT;
1052
1097
*obptr++ = crm_attr[i];
1102
* Construct a 3270 command to reproduce the current state of the display
1106
ctlr_snap_buffer_sscp_lu(void)
1108
register int baddr = 0;
1110
/* Write out the screen contents once. */
1112
if (ea_buf[baddr].cc == 0xff) {
1117
*obptr++ = ea_buf[baddr].cc;
1119
} while (baddr != 0);
1121
/* Write them out again, until we hit where the cursor is. */
1122
if (cursor_addr != baddr) {
1124
if (ea_buf[baddr].cc == 0xff) {
1129
*obptr++ = ea_buf[baddr].cc;
1131
} while (baddr != cursor_addr);
1241
1320
buffer_addr = DECODE_BADDR(*(cp-1), *cp);
1242
1321
END_TEXT("SetBufferAddress");
1243
1322
previous = SBA;
1244
trace_ds(rcba(buffer_addr));
1323
trace_ds("%s", rcba(buffer_addr));
1245
1324
if (buffer_addr >= COLS * ROWS) {
1325
trace_ds("COLS %d ROWS %d\n", COLS, ROWS);
1246
1326
ABORT_WRITE("invalid SBA address");
1248
1328
current_fa = get_field_attribute(buffer_addr);