Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 1 | /* rltty.h - tty driver-related definitions used by some library files. */ |
| 2 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 3 | /* Copyright (C) 1995-2009 Free Software Foundation, Inc. |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 4 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 5 | This file is part of the GNU Readline Library (Readline), a library |
| 6 | for reading lines of text with interactive input and history editing. |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 7 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 8 | Readline is free software: you can redistribute it and/or modify |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 9 | it under the terms of the GNU General Public License as published by |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 10 | the Free Software Foundation, either version 3 of the License, or |
| 11 | (at your option) any later version. |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 12 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 13 | Readline 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. |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 17 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 18 | You should have received a copy of the GNU General Public License |
| 19 | along with Readline. If not, see <http://www.gnu.org/licenses/>. |
| 20 | */ |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 21 | |
| 22 | #if !defined (_RLTTY_H_) |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 23 | #define _RLTTY_H_ |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 24 | |
| 25 | /* Posix systems use termios and the Posix signal functions. */ |
| 26 | #if defined (TERMIOS_TTY_DRIVER) |
| 27 | # include <termios.h> |
| 28 | #endif /* TERMIOS_TTY_DRIVER */ |
| 29 | |
| 30 | /* System V machines use termio. */ |
| 31 | #if defined (TERMIO_TTY_DRIVER) |
| 32 | # include <termio.h> |
| 33 | # if !defined (TCOON) |
| 34 | # define TCOON 1 |
| 35 | # endif |
| 36 | #endif /* TERMIO_TTY_DRIVER */ |
| 37 | |
| 38 | /* Other (BSD) machines use sgtty. */ |
| 39 | #if defined (NEW_TTY_DRIVER) |
| 40 | # include <sgtty.h> |
| 41 | #endif |
| 42 | |
Jari Aalto | cce855b | 1998-04-17 19:52:44 +0000 | [diff] [blame] | 43 | #include "rlwinsize.h" |
Jari Aalto | d166f04 | 1997-06-05 14:59:13 +0000 | [diff] [blame] | 44 | |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 45 | /* Define _POSIX_VDISABLE if we are not using the `new' tty driver and |
| 46 | it is not already defined. It is used both to determine if a |
| 47 | special character is disabled and to disable certain special |
| 48 | characters. Posix systems should set to 0, USG systems to -1. */ |
| 49 | #if !defined (NEW_TTY_DRIVER) && !defined (_POSIX_VDISABLE) |
| 50 | # if defined (_SVR4_VDISABLE) |
| 51 | # define _POSIX_VDISABLE _SVR4_VDISABLE |
| 52 | # else |
| 53 | # if defined (_POSIX_VERSION) |
| 54 | # define _POSIX_VDISABLE 0 |
| 55 | # else /* !_POSIX_VERSION */ |
| 56 | # define _POSIX_VDISABLE -1 |
| 57 | # endif /* !_POSIX_VERSION */ |
| 58 | # endif /* !_SVR4_DISABLE */ |
| 59 | #endif /* !NEW_TTY_DRIVER && !_POSIX_VDISABLE */ |
| 60 | |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 61 | typedef struct _rl_tty_chars { |
Jari Aalto | b80f644 | 2004-07-27 13:29:18 +0000 | [diff] [blame] | 62 | unsigned char t_eof; |
| 63 | unsigned char t_eol; |
| 64 | unsigned char t_eol2; |
| 65 | unsigned char t_erase; |
| 66 | unsigned char t_werase; |
| 67 | unsigned char t_kill; |
| 68 | unsigned char t_reprint; |
| 69 | unsigned char t_intr; |
| 70 | unsigned char t_quit; |
| 71 | unsigned char t_susp; |
| 72 | unsigned char t_dsusp; |
| 73 | unsigned char t_start; |
| 74 | unsigned char t_stop; |
| 75 | unsigned char t_lnext; |
| 76 | unsigned char t_flush; |
| 77 | unsigned char t_status; |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 78 | } _RL_TTY_CHARS; |
| 79 | |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 80 | #endif /* _RLTTY_H_ */ |