/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#ifndef _terminal_
/*
* terminal interface
* complicated by the fact that there are so many variations
* This will use POSIX <termios.h> interface where available
*/
#ifdef _hdr_termios
# include <termios.h>
# ifndef ECHOCTL
# endif /* ECHOCTL */
# ifndef CNSUSP
# endif /* CNSUSP */
# endif /* sgi */
# ifdef _NEXT_SOURCE
# endif /* _NEXT_SOURCE */
#else
# if defined(_sys_termios) && defined(_lib_tcgetattr)
# define _hdr_termios
# else
# endif /* _sys_termios */
#endif /* _hdr_termios */
#ifdef _hdr_termios
# ifndef TCSANOW
# endif /* TCSANOW */
/* The following corrects bugs in some implementations */
# if defined(TCSADFLUSH) && !defined(TCSAFLUSH)
# endif /* TCSADFLUSH */
# ifndef _lib_tcgetattr
# endif /* _lib_tcgetattr */
# if SHOPT_OLDTERMIO /* use both termios and termio */
# ifdef _hdr_termio
# include <termio.h>
# else
# ifdef _sys_termio
# else
# endif /* _sys_termio */
# endif /* _hdr_termio */
# endif /* SHOPT_OLDTERMIO */
#else
# ifdef _hdr_termio
# include <termio.h>
# else
# ifdef _sys_termio
# endif /* _sys_termio */
# endif /* _hdr_termio */
# ifdef _hdr_termio
# ifdef _sys_bsdtty
# endif /* _sys_bsdtty */
# else
# ifdef _hdr_sgtty
# include <sgtty.h>
# ifndef LPENDIN
# ifdef _sys_nttyio
# endif /* _sys_nttyio */
# endif /* LPENDIN */
# ifdef TIOCSETN
# endif /* TIOCSETN */
# ifdef TIOCGETP
# else
# endif /* TIOCGETP */
# endif /* _hdr_sgtty */
# endif /* hdr_termio */
# ifndef TCSANOW
# ifdef TCSETAW
# ifdef u370
/* delays are too long, don't wait for output to drain */
# else
# endif /* u370 */
# else
# ifdef TIOCSETN
# endif /* TIOCSETN */
# endif /* TCSETAW */
# endif /* TCSANOW */
#endif /* _hdr_termios */
/* set ECHOCTL if driver can echo control charaters as ^c */
#ifdef LCTLECH
# ifndef ECHOCTL
# endif /* !ECHOCTL */
#endif /* LCTLECH */
#ifdef LNEW_CTLECH
# ifndef ECHOCTL
# endif /* !ECHOCTL */
#endif /* LNEW_CTLECH */
#ifdef LNEW_PENDIN
# ifndef PENDIN
# endif /* !PENDIN */
#endif /* LNEW_PENDIN */
#ifndef ECHOCTL
# ifndef VEOL
# endif /* !VEOL */
#endif /* !ECHOCTL */
#ifdef _sys_filio
# ifndef FIONREAD
# endif /* FIONREAD */
#endif /* _sys_filio */
/* set FIORDCHK if you can check for characters in input queue */
#ifdef FIONREAD
# ifndef FIORDCHK
# endif /* !FIORDCHK */
#endif /* FIONREAD */
extern int tty_alt(int);
extern void tty_cooked(int);
extern int tty_raw(int,int);
extern int tty_check(int);
extern int sh_ioctl(int,int,void*,int);
#ifdef _lib_tcgetattr
extern int sh_tcgetattr(int,struct termios*);
extern int sh_tcsetattr(int,int,struct termios*);
#endif
#endif /* _terminal_ */