aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1993-05-27 02:12:20 +0000
committerJim Blandy1993-05-27 02:12:20 +0000
commit50b8cf60325f92026d3fc768a433a5579c642df2 (patch)
tree5acda07c8407dd48778d61b146431508c9daf5eb /src
parent7ad1552990092f3c0301a2bb946bf368def41b08 (diff)
downloademacs-50b8cf60325f92026d3fc768a433a5579c642df2.tar.gz
emacs-50b8cf60325f92026d3fc768a433a5579c642df2.zip
* systty.h (HAVE_LTCHARS, HAVE_TCHARS): New macros; define them if
we have those structures, but *don't* define them if we have TERMIOS, whose functions take care of those parameters; that screws up AIX. (struct emacs_tty): Test those symbols, instead of the ioctl commands. * sysdep.c (emacs_get_tty, emacs_set_tty, new_ltchars, new_tchars, init_sys_modes): Same.
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c20
-rw-r--r--src/systty.h21
2 files changed, 29 insertions, 12 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 300ad654f1e..15a0da97190 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -765,13 +765,13 @@ emacs_get_tty (fd, settings)
765#endif 765#endif
766 766
767 /* Suivant - Do we have to get struct ltchars data? */ 767 /* Suivant - Do we have to get struct ltchars data? */
768#ifdef TIOCGLTC 768#ifdef HAVE_LTCHARS
769 if (ioctl (fd, TIOCGLTC, &settings->ltchars) < 0) 769 if (ioctl (fd, TIOCGLTC, &settings->ltchars) < 0)
770 return -1; 770 return -1;
771#endif 771#endif
772 772
773 /* How about a struct tchars and a wordful of lmode bits? */ 773 /* How about a struct tchars and a wordful of lmode bits? */
774#ifdef TIOCGETC 774#ifdef HAVE_TCHARS
775 if (ioctl (fd, TIOCGETC, &settings->tchars) < 0 775 if (ioctl (fd, TIOCGETC, &settings->tchars) < 0
776 || ioctl (fd, TIOCLGET, &settings->lmode) < 0) 776 || ioctl (fd, TIOCLGET, &settings->lmode) < 0)
777 return -1; 777 return -1;
@@ -846,13 +846,13 @@ emacs_set_tty (fd, settings, waitp)
846#endif 846#endif
847 847
848 /* Suivant - Do we have to get struct ltchars data? */ 848 /* Suivant - Do we have to get struct ltchars data? */
849#ifdef TIOCGLTC 849#ifdef HAVE_LTCHARS
850 if (ioctl (fd, TIOCSLTC, &settings->ltchars) < 0) 850 if (ioctl (fd, TIOCSLTC, &settings->ltchars) < 0)
851 return -1; 851 return -1;
852#endif 852#endif
853 853
854 /* How about a struct tchars and a wordful of lmode bits? */ 854 /* How about a struct tchars and a wordful of lmode bits? */
855#ifdef TIOCGETC 855#ifdef HAVE_TCHARS
856 if (ioctl (fd, TIOCSETC, &settings->tchars) < 0 856 if (ioctl (fd, TIOCSETC, &settings->tchars) < 0
857 || ioctl (fd, TIOCLSET, &settings->lmode) < 0) 857 || ioctl (fd, TIOCLSET, &settings->lmode) < 0)
858 return -1; 858 return -1;
@@ -888,10 +888,10 @@ unsigned char _sobuf[BUFSIZ+8];
888char _sobuf[BUFSIZ]; 888char _sobuf[BUFSIZ];
889#endif 889#endif
890 890
891#ifdef TIOCGLTC 891#ifdef HAVE_LTCHARS
892static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1}; 892static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1};
893#endif 893#endif
894#ifdef TIOCGETC 894#ifdef HAVE_TCHARS
895 static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1}; 895 static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1};
896#endif 896#endif
897 897
@@ -1042,7 +1042,7 @@ init_sys_modes ()
1042 control for user coming over network on 4.2; in this case, 1042 control for user coming over network on 4.2; in this case,
1043 only t_stopc and t_startc really matter. */ 1043 only t_stopc and t_startc really matter. */
1044#ifndef HAVE_TERMIO 1044#ifndef HAVE_TERMIO
1045#ifdef TIOCGETC 1045#ifdef HAVE_TCHARS
1046 /* Note: if not using CBREAK mode, it makes no difference how we 1046 /* Note: if not using CBREAK mode, it makes no difference how we
1047 set this */ 1047 set this */
1048 tty.tchars = new_tchars; 1048 tty.tchars = new_tchars;
@@ -1068,12 +1068,12 @@ init_sys_modes ()
1068 lmode = tty.lmode; 1068 lmode = tty.lmode;
1069#endif 1069#endif
1070 1070
1071#endif /* TIOCGETC */ 1071#endif /* HAVE_TCHARS */
1072#endif /* not HAVE_TERMIO */ 1072#endif /* not HAVE_TERMIO */
1073 1073
1074#ifdef TIOCGLTC 1074#ifdef HAVE_LTCHARS
1075 tty.ltchars = new_ltchars; 1075 tty.ltchars = new_ltchars;
1076#endif /* TIOCGLTC */ 1076#endif /* HAVE_LTCHARS */
1077 1077
1078 EMACS_SET_TTY (input_fd, &tty, 0); 1078 EMACS_SET_TTY (input_fd, &tty, 0);
1079 1079
diff --git a/src/systty.h b/src/systty.h
index 98e97960540..d4a77d2847f 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -157,6 +157,17 @@ static struct sensemode {
157#undef SIGIO 157#undef SIGIO
158#endif 158#endif
159 159
160/* On TERMIOS systems, the tcmumbleattr calls take care of these
161 parameters, and it's a bad idea to use them (on AIX, it makes the
162 tty hang for a long time).
163#if defined (TIOCGLTC) && !defined (HAVE_TERMIOS)
164#define HAVE_LTCHARS
165#endif
166
167#if defined (TIOCGETC) && !defined (HAVE_TERMIOS)
168#define HAVE_TCHARS
169#endif
170
160 171
161/* Try to establish the correct character to disable terminal functions 172/* Try to establish the correct character to disable terminal functions
162 in a system-independent manner. Note that USG (at least) define 173 in a system-independent manner. Note that USG (at least) define
@@ -286,13 +297,19 @@ struct emacs_tty {
286#endif 297#endif
287#endif 298#endif
288#endif 299#endif
289#ifdef TIOCGLTC 300
301/* If we have TERMIOS, we don't need to do this - they're taken care of
302 by the tc*attr calls. */
303#ifndef HAVE_TERMIOS
304#ifdef HAVE_LTCHARS
290 struct ltchars ltchars; 305 struct ltchars ltchars;
291#endif 306#endif
292#ifdef TIOCGETC 307
308#ifdef HAVE_TCHARS
293 struct tchars tchars; 309 struct tchars tchars;
294 int lmode; 310 int lmode;
295#endif 311#endif
312#endif
296}; 313};
297 314
298/* Define EMACS_GET_TTY and EMACS_SET_TTY, 315/* Define EMACS_GET_TTY and EMACS_SET_TTY,