diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-12-18 20:55:53 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-12-18 20:55:53 +0000 |
commit | 62c19679be069ef2770e79fb05fdbc3a9749c612 (patch) | |
tree | bbdc0d9152836bab35763618d41fe24d089c34d0 /bin/ksh/tty.h | |
parent | 220f5907de5bdc773b687af762aa5d835e26025c (diff) |
Remove unused OS dependent #ifdef blocks, #defines and macro abstraction.
First step in making the ksh code easier to read. From Matthias Kilian
Diffstat (limited to 'bin/ksh/tty.h')
-rw-r--r-- | bin/ksh/tty.h | 76 |
1 files changed, 6 insertions, 70 deletions
diff --git a/bin/ksh/tty.h b/bin/ksh/tty.h index a6cd2dae1e9..f51ee9a6235 100644 --- a/bin/ksh/tty.h +++ b/bin/ksh/tty.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.h,v 1.2 1996/11/21 07:59:36 downsj Exp $ */ +/* $OpenBSD: tty.h,v 1.3 2004/12/18 20:55:52 millert Exp $ */ /* tty.h -- centralized definitions for a variety of terminal interfaces @@ -20,72 +20,8 @@ # define EXTERN_DEFINED #endif -/* Don't know of a system on which including sys/ioctl.h with termios.h - * causes problems. If there is one, these lines need to be deleted and - * aclocal.m4 needs to have stuff un-commented. - */ -#ifdef SYS_IOCTL_WITH_TERMIOS -# define SYS_IOCTL_WITH_TERMIOS -#endif /* SYS_IOCTL_WITH_TERMIOS */ -#ifdef SYS_IOCTL_WITH_TERMIO -# define SYS_IOCTL_WITH_TERMIO -#endif /* SYS_IOCTL_WITH_TERMIO */ - -#ifdef HAVE_TERMIOS_H -# include <termios.h> -# ifdef SYS_IOCTL_WITH_TERMIOS -# if !(defined(sun) && !defined(__svr4__)) /* too many warnings on sunos */ - /* Need to include sys/ioctl.h on some systems to get the TIOCGWINSZ - * stuff (eg, digital unix). - */ -# include <sys/ioctl.h> -# endif /* !(sun && !__svr4__) */ -# endif /* SYS_IOCTL_WITH_TERMIOS */ +#include <termios.h> typedef struct termios TTY_state; -#else -# ifdef HAVE_TERMIO_H -# include <termio.h> -# ifdef SYS_IOCTL_WITH_TERMIO -# include <sys/ioctl.h> /* see comment above in termios stuff */ -# endif /* SYS_IOCTL_WITH_TERMIO */ -# if _BSD_SYSV /* BRL UNIX System V emulation */ -# ifndef NTTYDISC -# define TIOCGETD _IOR( 't', 0, int ) -# define TIOCSETD _IOW( 't', 1, int ) -# define NTTYDISC 2 -# endif -# ifndef TIOCSTI -# define TIOCSTI _IOW( 't', 114, char ) -# endif -# ifndef TIOCSPGRP -# define TIOCSPGRP _IOW( 't', 118, int ) -# endif -# endif /* _BSD_SYSV */ -typedef struct termio TTY_state; -# else /* HAVE_TERMIO_H */ -/* Assume BSD tty stuff. Uses TIOCGETP, TIOCSETN; uses TIOCGATC/TIOCSATC if - * available, otherwise it uses TIOCGETC/TIOCSETC (also uses TIOCGLTC/TIOCSLTC - * if available) - */ -# ifdef _MINIX -# include <sgtty.h> -# define TIOCSETN TIOCSETP -# else -# include <sys/ioctl.h> -# endif -typedef struct { - struct sgttyb sgttyb; -# ifdef TIOCGATC - struct lchars lchars; -# else /* TIOCGATC */ - struct tchars tchars; -# ifdef TIOCGLTC - struct ltchars ltchars; -# endif /* TIOCGLTC */ -# endif /* TIOCGATC */ -} TTY_state; -# endif /* HAVE_TERMIO_H */ -#endif /* HAVE_TERMIOS_H */ /* Flags for set_tty() */ #define TF_NONE 0x00 @@ -96,10 +32,10 @@ EXTERN int tty_fd I__(-1); /* dup'd tty file descriptor */ EXTERN int tty_devtty; /* true if tty_fd is from /dev/tty */ EXTERN TTY_state tty_state; /* saved tty state */ -extern int get_tty ARGS((int fd, TTY_state *ts)); -extern int set_tty ARGS((int fd, TTY_state *ts, int flags)); -extern void tty_init ARGS((int init_ttystate)); -extern void tty_close ARGS((void)); +extern int get_tty(int fd, TTY_state *ts); +extern int set_tty(int fd, TTY_state *ts, int flags); +extern void tty_init(int init_ttystate); +extern void tty_close(void); /* be sure not to interfere with anyone else's idea about EXTERN */ #ifdef EXTERN_DEFINED |