1 /* @(#)ttydefs.h 1.26 03/02/28 Copyright 1984-2003 J. Schilling */ 2 /* 3 * Terminal driver tty mode handling 4 * 5 * Copyright (c) 1984-2003 J. Schilling 6 */ 7 /* 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2, or (at your option) 11 * any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License along with 19 * this program; see the file COPYING. If not, write to the Free Software 20 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 */ 22 23 24 #ifndef _TTYDEFS_H 25 #define _TTYDEFS_H 26 27 #ifndef _MCONFIG_H 28 #include <mconfig.h> 29 #endif 30 31 #ifndef _INCL_SYS_TYPES_H 32 #include <sys/types.h> 33 #define _INCL_SYS_TYPES_H 34 #endif 35 36 #ifdef JOS 37 # include <ttymodes.h> 38 # include <spfcode.h> 39 #else 40 #ifdef HAVE_TERMIOS_H 41 # include <termios.h> 42 # define _INCL_TERMIOS_H 43 # ifdef TIOCGETA /* FreeBSD */ 44 # define TCGETS TIOCGETA 45 # define TCSETSW TIOCSETAW 46 # endif 47 # ifdef TCGETATTR 48 # define TCGETS TCGETATTR 49 # define TCSETSW TCSETATTRD 50 # endif 51 #else 52 # ifdef HAVE_TERMIO_H 53 # include <termio.h> 54 # define _INCL_TERMIO_H 55 # ifndef TCGETS 56 # define termios termio 57 # define TCGETS TCGETA 58 # define TCSETSW TCSETAW 59 # endif 60 # else 61 # define USE_V7_TTY 62 # endif 63 #endif 64 #endif 65 66 #if !defined(HAVE_TCGETATTR) || !defined(HAVE_TCSETATTR) 67 # undef TCSANOW 68 #endif 69 70 #ifndef TCSANOW 71 # if !defined(TCGETS) || !defined(TCSETSW) 72 # define USE_V7_TTY 73 # endif 74 #endif 75 76 #if !defined(_INCL_TERMIOS_H) && !defined(_INCL_TERMIO_H) 77 #ifdef HAVE_SYS_IOCTL_H 78 # ifndef _INCL_SYS_IOCTl_H 79 # include <sys/ioctl.h> 80 # define _INCL_SYS_IOCTL_H 81 # endif 82 #endif 83 #endif 84 85 #ifdef HAVE_SYS_BSDTTY_H 86 #include <sys/bsdtty.h> 87 #endif 88 89 #if !defined(TIOCGWINSZ) && ! defined(TIOCGSIZE) 90 # ifndef _INCL_SYS_IOCTl_H 91 # include <sys/ioctl.h> 92 # define _INCL_SYS_IOCTL_H 93 # endif 94 #endif 95 96 #ifndef OXTABS /* OS/2 EMX */ 97 #define OXTABS 0 98 #endif 99 #ifndef XTABS 100 # ifndef TAB3 /* FreeBSD */ 101 # define TABDLY OXTABS 102 # define XTABS OXTABS 103 # else 104 # define XTABS TAB3 105 # endif 106 #endif 107 #ifndef ONLCR /* OS/2 EMX */ 108 #define ONLCR 0 109 #endif 110 #ifndef OCRNL /* FreeBSD */ 111 # define OCRNL 0 112 #endif 113 #ifndef ONLRET /* FreeBSD */ 114 # define ONLRET 0 115 #endif 116 #ifndef _POSIX_VDISABLE 117 # define _POSIX_VDISABLE 0 118 #endif 119 120 #endif /* _TTYDEFS_H */ 121