1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
$NetBSD: patch-ck,v 1.2 2008/08/30 20:01:28 dholland Exp $
--- lib/libxview/ttysw/tty_main.c.orig 1993-06-29 01:17:22.000000000 -0400
+++ lib/libxview/ttysw/tty_main.c 2008-08-30 15:06:22.000000000 -0400
@@ -75,6 +75,11 @@ static char sccsid[] = "@(#)tty_main
int committed_left = 0;
#endif
+static int ttysw_process_point();
+static int ttysw_process_adjust();
+static int ttysw_process_motion();
+static int ttysw_process_keyboard();
+
extern Textsw_index textsw_insert();
#ifdef OW_I18N
extern Textsw_index textsw_insert_wcs();
@@ -906,8 +911,12 @@ ttysw_pty_input(ttysw, pty)
if (int_ucntl == (tiocsti & 0xff))
ttysw_process_STI(ttysw, owbp, cc - 1);
+#ifndef XV_USE_TERMIOS
(void) ioctl(ttysw->ttysw_tty, TIOCGETC, &ttysw->tchars);
(void) ioctl(ttysw->ttysw_tty, TIOCGLTC, &ttysw->ltchars);
+#else
+ (void) tcgetattr(ttysw->ttysw_tty, &ttysw->termios);
+#endif
ttysw_getp(TTY_VIEW_HANDLE_FROM_TTY_FOLIO(ttysw)); /* jcb for nng */
} else
#ifdef OW_I18N
@@ -1491,11 +1500,12 @@ xv_tty_new_size(ttysw, cols, lines)
struct ttysize ts;
#ifndef SVR4
- struct sigvec vec, ovec;
+ struct sigaction vec, ovec;
+ (void) sigaction(SIGTTOU, NULL, &ovec);
+ vec = ovec;
+ vec.sa_handler = SIG_IGN;
- vec.sv_handler = SIG_IGN;
- vec.sv_mask = vec.sv_onstack = 0;
- (void) sigvec(SIGTTOU, &vec, &ovec);
+ (void) sigaction(SIGTTOU, &vec, NULL);
#endif
ts.ts_lines = lines;
@@ -1504,7 +1514,7 @@ xv_tty_new_size(ttysw, cols, lines)
perror(XV_MSG("ttysw-TIOCSSIZE"));
#ifndef SVR4
- (void) sigvec(SIGTTOU, &ovec, 0);
+ (void) sigaction(SIGTTOU, &ovec, NULL);
#endif
#else /* sun */
/*
@@ -1512,11 +1522,12 @@ xv_tty_new_size(ttysw, cols, lines)
*/
struct winsize ws;
#ifndef SVR4
- struct sigvec vec, ovec;
+ struct sigaction vec, ovec;
+ (void) sigaction(SIGTTOU, NULL, &ovec);
+ vec = ovec;
+ vec.sa_handler = SIG_IGN;
- vec.sv_handler = SIG_IGN;
- vec.sv_mask = vec.sv_onstack = 0;
- (void) sigvec(SIGTTOU, &vec, &ovec);
+ (void) sigaction(SIGTTOU, &vec, NULL);
#endif
ws.ws_row = lines;
@@ -1525,7 +1536,7 @@ xv_tty_new_size(ttysw, cols, lines)
perror(XV_MSG("ttysw-TIOCSWINSZ"));
#ifndef SVR4
- (void) sigvec(SIGTTOU, &ovec, 0);
+ (void) sigaction(SIGTTOU, &ovec, NULL);
#endif
#endif /* sun */
}
@@ -1624,7 +1635,7 @@ Pkg_private void
ttysw_flush_input(ttysw)
Ttysw_folio ttysw;
{
-#ifndef SVR4
+#if 0 /*ndef SVR4*/
struct sigvec vec, ovec; /* Sys V compatibility */
int flushf = 0;
@@ -1655,7 +1666,7 @@ ttysw_flush_input(ttysw)
# endif /* XV_USE_TERMIOS */
perror(XV_MSG("TIOCFLUSH"));
-#ifndef SVR4
+#if 0 /*ndef SVR4*/
(void) sigvec(SIGTTOU, &ovec, (struct sigvec *) 0);
#else
sigaction(SIGTTOU, &ovec, (struct sigaction *) 0);
|