comparison src/systty.h @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents de805c49cfc1
children
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */ 19 Boston, MA 02111-1307, USA. */
20 20
21 /* Synched up with: FSF 19.30. */ 21 /* Synched up with: FSF 19.30. */
22 22
23 #ifndef INCLUDED_systty_h_ 23 #ifndef _XEMACS_SYSTTY_H_
24 #define INCLUDED_systty_h_ 24 #define _XEMACS_SYSTTY_H_
25 25
26 #ifdef HAVE_TERMIOS 26 #ifdef HAVE_TERMIOS
27 # define HAVE_TCATTR 27 # define HAVE_TCATTR
28 #endif 28 #endif
29 29
92 # ifndef INCLUDED_FCNTL 92 # ifndef INCLUDED_FCNTL
93 # define INCLUDED_FCNTL 93 # define INCLUDED_FCNTL
94 # include <fcntl.h> 94 # include <fcntl.h>
95 # endif 95 # endif
96 96
97 #elif defined (WIN32_NATIVE) 97 #elif defined (DOS_NT)
98 98
99 /***** (3) The WIN32_NATIVE way *****/ 99 /***** (3) The MSDOS/NT way *****/
100 100
101 /* Nothing doing */ 101 /* Nothing doing */
102 102
103 #else 103 #else
104 104
122 USG5_4 was defined, but this is already included in s/usg5-4.h */ 122 USG5_4 was defined, but this is already included in s/usg5-4.h */
123 123
124 /* Generally useful to include this file: */ 124 /* Generally useful to include this file: */
125 125
126 /* But Sun OS has broken include files and doesn't want it included */ 126 /* But Sun OS has broken include files and doesn't want it included */
127 #if !defined (WIN32_NATIVE) && !defined (SUNOS4) 127 #if !defined (DOS_NT) && !defined (WIN32) && !defined (SUNOS4)
128 # include <sys/ioctl.h> 128 # include <sys/ioctl.h>
129 #endif 129 #endif
130 /* UNIPLUS systems may have FIONREAD. */ 130 /* UNIPLUS systems may have FIONREAD. */
131 #ifdef UNIPLUS 131 #ifdef UNIPLUS
132 #include <sys.ioctl.h> 132 #include <sys.ioctl.h>
178 178
179 /* ----------------------------------------------------- */ 179 /* ----------------------------------------------------- */
180 /* inhibiting particular features */ 180 /* inhibiting particular features */
181 /* ----------------------------------------------------- */ 181 /* ----------------------------------------------------- */
182 182
183
184 #ifdef APOLLO
185 #undef TIOCSTART
186 #endif
183 187
184 #if defined (XENIX) || defined (BROKEN_TIOCGETC) 188 #if defined (XENIX) || defined (BROKEN_TIOCGETC)
185 #undef TIOCGETC /* Avoid confusing some conditionals that test this. */ 189 #undef TIOCGETC /* Avoid confusing some conditionals that test this. */
186 #endif 190 #endif
187 191
331 # define EMACS_SEPARATE_PROCESS_GROUP() setpgrp () 335 # define EMACS_SEPARATE_PROCESS_GROUP() setpgrp ()
332 /* old (pre-SVR4) USG's don't provide any way to do this. 336 /* old (pre-SVR4) USG's don't provide any way to do this.
333 No big loss -- it just means that ^Z won't work right 337 No big loss -- it just means that ^Z won't work right
334 if we're run from sh. */ 338 if we're run from sh. */
335 # define EMACS_SET_PROCESS_GROUP(pg) 339 # define EMACS_SET_PROCESS_GROUP(pg)
336 #elif defined(MINGW) 340 #elif defined(__MINGW32__)
337 # define EMACS_SEPARATE_PROCESS_GROUP() 341 # define EMACS_SEPARATE_PROCESS_GROUP()
338 #else 342 #else
339 /* Under NeXTstep, a process group of 0 is not the same as specifying 343 /* Under NeXTstep, a process group of 0 is not the same as specifying
340 your own process ID, so we go ahead and specify it explicitly. */ 344 your own process ID, so we go ahead and specify it explicitly. */
341 # define EMACS_SEPARATE_PROCESS_GROUP() setpgrp (0, getpid ()) 345 # define EMACS_SEPARATE_PROCESS_GROUP() setpgrp (0, getpid ())
342 # define EMACS_SET_PROCESS_GROUP(pg) setpgrp (0, pg) 346 # define EMACS_SET_PROCESS_GROUP(pg) setpgrp (0, pg)
352 state, for example a struct tchars, a struct sgttyb, a struct 356 state, for example a struct tchars, a struct sgttyb, a struct
353 tchars, a struct ltchars, and a struct pagechars, struct 357 tchars, a struct ltchars, and a struct pagechars, struct
354 emacs_tty should contain an element for each parameter struct 358 emacs_tty should contain an element for each parameter struct
355 that Emacs may change. 359 that Emacs may change.
356 360
357 emacs_get_tty (int FD, struct emacs_tty *P) stores the parameters 361 EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the parameters
358 of the tty on FD in *P. Return zero if all's well, or -1 if we ran 362 of the tty on FD in *P. Return zero if all's well, or -1 if we ran
359 into an error we couldn't deal with. 363 into an error we couldn't deal with.
360 364
361 emacs_set_tty (int FD, struct emacs_tty *P, int flushp) 365 EMACS_SET_TTY (int FD, struct emacs_tty *P, int flushp)
362 sets the parameters of the tty on FD according to the contents of 366 sets the parameters of the tty on FD according to the contents of
363 *P. If flushp is non-zero, we discard queued input to be 367 *P. If flushp is non-zero, we discard queued input to be
364 written before making the change. 368 written before making the change.
365 Return 0 if all went well, and -1 if anything failed. 369 Return 0 if all went well, and -1 if anything failed.
366 370
382 struct termios main; 386 struct termios main;
383 #else /* !HAVE_TCATTR */ 387 #else /* !HAVE_TCATTR */
384 #ifdef HAVE_TERMIO 388 #ifdef HAVE_TERMIO
385 struct termio main; 389 struct termio main;
386 #else /* !HAVE_TERMIO */ 390 #else /* !HAVE_TERMIO */
387 #ifdef WIN32_NATIVE 391 #ifdef DOS_NT
388 int main; 392 int main;
389 #else /* not WIN32_NATIVE */ 393 #else /* not DOS_NT */
390 struct sgttyb main; 394 struct sgttyb main;
391 #endif /* not WIN32_NATIVE */ 395 #endif /* not DOS_NT */
392 #endif /* !HAVE_TERMIO */ 396 #endif /* !HAVE_TERMIO */
393 #endif /* !HAVE_TCATTR */ 397 #endif /* !HAVE_TCATTR */
394 398
395 /* If we have TERMIOS, we don't need to do this - they're taken care of 399 /* If we have TERMIOS, we don't need to do this - they're taken care of
396 by the tc*attr calls. */ 400 by the tc*attr calls. */
403 struct tchars tchars; 407 struct tchars tchars;
404 int lmode; 408 int lmode;
405 #endif /* HAVE_TCHARS */ 409 #endif /* HAVE_TCHARS */
406 #endif /* HAVE_TERMIOS */ 410 #endif /* HAVE_TERMIOS */
407 }; 411 };
408 412
409 int emacs_get_tty (int fd, struct emacs_tty *settings); 413 /* Define EMACS_GET_TTY and EMACS_SET_TTY,
410 int emacs_set_tty (int fd, struct emacs_tty *settings, int flushp); 414 the macros for reading and setting parts of `struct emacs_tty'.
415
416 These got pretty unmanageable (huge macros are hard to debug), and
417 finally needed some code which couldn't be done as part of an
418 expression, so we moved them out to their own functions in sysdep.c. */
419 #define EMACS_GET_TTY(fd, p) emacs_get_tty (fd, p)
420 #define EMACS_SET_TTY(fd, p, waitp) emacs_set_tty (fd, p, waitp)
411 421
412 422
413 /* --------------------------------------------------------- */ 423 /* --------------------------------------------------------- */
414 /* Define EMACS_TTY_TABS_OK */ 424 /* Define EMACS_TTY_TABS_OK */
415 /* --------------------------------------------------------- */ 425 /* --------------------------------------------------------- */
426 #ifdef HAVE_TERMIO 436 #ifdef HAVE_TERMIO
427 437
428 #define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3) 438 #define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3)
429 439
430 #else /* neither HAVE_TERMIO nor HAVE_TERMIOS */ 440 #else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
431 #ifdef WIN32_NATIVE 441 #ifdef DOS_NT
432 #define EMACS_TTY_TABS_OK(p) 0 442 #define EMACS_TTY_TABS_OK(p) 0
433 #else /* not WIN32_NATIVE */ 443 #else /* not DOS_NT */
434 #define EMACS_TTY_TABS_OK(p) (((p)->main.sg_flags & XTABS) != XTABS) 444 #define EMACS_TTY_TABS_OK(p) (((p)->main.sg_flags & XTABS) != XTABS)
435 #endif /* not WIN32_NATIVE */ 445 #endif /* not DOS_NT */
436 446
437 #endif /* not def HAVE_TERMIO */ 447 #endif /* not def HAVE_TERMIO */
438 #endif /* not def HAVE_TERMIOS */ 448 #endif /* not def HAVE_TERMIOS */
439 449
440 #endif /* INCLUDED_systty_h_ */ 450 #endif /* _XEMACS_SYSTTY_H_ */