diff options
| author | Jim Blandy | 1993-05-04 02:39:05 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-05-04 02:39:05 +0000 |
| commit | c2e4f49a68cdfedaca2c2a785a80b64ca677b1fe (patch) | |
| tree | 2ccabe6dc35310f4f6fc54c6fb186c19a13f7c18 /src | |
| parent | 7f86bdacd5c76cd2a25321bba9e744c05cd584bf (diff) | |
| download | emacs-c2e4f49a68cdfedaca2c2a785a80b64ca677b1fe.tar.gz emacs-c2e4f49a68cdfedaca2c2a785a80b64ca677b1fe.zip | |
* systty.h (EMACS_GET_TTY, EMACS_SET_TTY): Move these into
functions in sysdep.c.
* sysdep.c (emacs_get_tty, emacs_set_tty): Here they are.
Diffstat (limited to 'src')
| -rw-r--r-- | src/systty.h | 74 |
1 files changed, 6 insertions, 68 deletions
diff --git a/src/systty.h b/src/systty.h index 5c6b04ee91b..7e416f05e2b 100644 --- a/src/systty.h +++ b/src/systty.h | |||
| @@ -294,76 +294,14 @@ struct emacs_tty { | |||
| 294 | }; | 294 | }; |
| 295 | 295 | ||
| 296 | /* Define EMACS_GET_TTY and EMACS_SET_TTY, | 296 | /* Define EMACS_GET_TTY and EMACS_SET_TTY, |
| 297 | the macros for reading and setting parts of `struct emacs_tty'. */ | 297 | the macros for reading and setting parts of `struct emacs_tty'. |
| 298 | 298 | ||
| 299 | #ifdef HAVE_TCATTR | 299 | These got pretty unmanageable (huge macros are hard to debug), and |
| 300 | 300 | finally needed some code which couldn't be done as part of an | |
| 301 | #define EMACS_GET_TTY_1(fd, p) (tcgetattr ((fd), &(p)->main) != -1) | 301 | expression, so we moved them out to their own functions in sysdep.c. */ |
| 302 | #define EMACS_SET_TTY_1(fd, p, waitp) \ | 302 | #define EMACS_GET_TTY(fd, p) (emacs_get_tty ((fd), (p))) |
| 303 | (tcsetattr ((fd), (waitp) ? TCSAFLUSH : TCSADRAIN, &(p)->main) != -1) | 303 | #define EMACS_SET_TTY(fd, p, waitp) (emacs_set_tty ((fd), (p), (waitp))) |
| 304 | |||
| 305 | #else | ||
| 306 | #ifdef HAVE_TERMIO | ||
| 307 | |||
| 308 | #define EMACS_GET_TTY_1(fd, p) (ioctl ((fd), TCGETA, &(p)->main) != -1) | ||
| 309 | #define EMACS_SET_TTY_1(fd, p, waitp) \ | ||
| 310 | (ioctl ((fd), (waitp) ? TCSETAW : TCSETAF, &(p)->main) != -1) | ||
| 311 | |||
| 312 | #else | ||
| 313 | #ifdef VMS | ||
| 314 | |||
| 315 | /* These definitions will really only work in sysdep.c, because of their | ||
| 316 | use of input_iosb. I don't know enough about VMS QIO to fix this. */ | ||
| 317 | #define EMACS_GET_TTY_1(fd, p) \ | ||
| 318 | (1 & SYS$QIOW (0, (fd), IO$_SENSEMODE, (p), 0, 0, \ | ||
| 319 | &(p)->main.class, 12, 0, 0, 0, 0)) | ||
| 320 | #define EMACS_SET_TTY_1(fd, p, waitp) \ | ||
| 321 | (1 & SYS$QIOW (0, (fd), IO$_SETMODE, &input_iosb, 0, 0, \ | ||
| 322 | &(p)->main.class, 12, 0, 0, 0, 0)) | ||
| 323 | |||
| 324 | #else | ||
| 325 | |||
| 326 | #define EMACS_GET_TTY_1(fd, p) (ioctl ((fd), TIOCGETP, &(p)->main) != -1) | ||
| 327 | #define EMACS_SET_TTY_1(fd, p, waitp) \ | ||
| 328 | (ioctl ((fd), (waitp) ? TIOCSETP : TIOCSETN, &(p)->main) != -1) | ||
| 329 | |||
| 330 | #endif | ||
| 331 | #endif | ||
| 332 | #endif | ||
| 333 | 304 | ||
| 334 | #ifdef TIOCGLTC | ||
| 335 | #define EMACS_GET_TTY_2(fd, p) \ | ||
| 336 | (ioctl ((fd), TIOCGLTC, &(p)->ltchars) != -1) | ||
| 337 | #define EMACS_SET_TTY_2(fd, p, waitp) \ | ||
| 338 | (ioctl ((fd), TIOCSLTC, &(p)->ltchars) != -1) | ||
| 339 | #else | ||
| 340 | #define EMACS_GET_TTY_2(fd, p) 1 | ||
| 341 | #define EMACS_SET_TTY_2(fd, p, waitp) 1 | ||
| 342 | #endif /* TIOCGLTC */ | ||
| 343 | |||
| 344 | #ifdef TIOCGETC | ||
| 345 | #define EMACS_GET_TTY_3(fd, p) \ | ||
| 346 | (ioctl ((fd), TIOCGETC, &(p)->tchars) != -1 \ | ||
| 347 | && ioctl ((fd), TIOCLGET, &(p)->lmode) != -1) | ||
| 348 | #define EMACS_SET_TTY_3(fd, p, waitp) \ | ||
| 349 | (ioctl ((fd), TIOCSETC, &(p)->tchars) != -1 \ | ||
| 350 | && ioctl ((fd), TIOCLSET, &(p)->lmode) != -1) | ||
| 351 | #else | ||
| 352 | #define EMACS_GET_TTY_3(fd, p) 1 | ||
| 353 | #define EMACS_SET_TTY_3(fd, p, waitp) 1 | ||
| 354 | #endif /* TIOCGLTC */ | ||
| 355 | |||
| 356 | /* Define these to be a concatenation of all the EMACS_{GET,SET}_TTY_n | ||
| 357 | macros. */ | ||
| 358 | #define EMACS_GET_TTY(fd, tc) \ | ||
| 359 | (EMACS_GET_TTY_1 (fd, tc) \ | ||
| 360 | && EMACS_GET_TTY_2 (fd, tc) \ | ||
| 361 | && EMACS_GET_TTY_3 (fd, tc)) | ||
| 362 | |||
| 363 | #define EMACS_SET_TTY(fd, tc, waitp) \ | ||
| 364 | (EMACS_SET_TTY_1 (fd, tc, waitp) \ | ||
| 365 | && EMACS_SET_TTY_2 (fd, tc, waitp) \ | ||
| 366 | && EMACS_SET_TTY_3 (fd, tc, waitp)) | ||
| 367 | 305 | ||
| 368 | /* Define EMACS_TTY_TABS_OK. */ | 306 | /* Define EMACS_TTY_TABS_OK. */ |
| 369 | 307 | ||