rltty.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* rltty.h - tty driver-related definitions used by some library files. */
  2. /* Copyright (C) 1995-2009 Free Software Foundation, Inc.
  3. This file is part of the GNU Readline Library (Readline), a library
  4. for reading lines of text with interactive input and history editing.
  5. Readline is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. Readline is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Readline. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #if !defined (_RLTTY_H_)
  17. #define _RLTTY_H_
  18. /* Posix systems use termios and the Posix signal functions. */
  19. #if defined (TERMIOS_TTY_DRIVER)
  20. # include <termios.h>
  21. #endif /* TERMIOS_TTY_DRIVER */
  22. /* System V machines use termio. */
  23. #if defined (TERMIO_TTY_DRIVER)
  24. # include <termio.h>
  25. # if !defined (TCOON)
  26. # define TCOON 1
  27. # endif
  28. #endif /* TERMIO_TTY_DRIVER */
  29. /* Other (BSD) machines use sgtty. */
  30. #if defined (NEW_TTY_DRIVER)
  31. # include <sgtty.h>
  32. #endif
  33. #include "rlwinsize.h"
  34. /* Define _POSIX_VDISABLE if we are not using the `new' tty driver and
  35. it is not already defined. It is used both to determine if a
  36. special character is disabled and to disable certain special
  37. characters. Posix systems should set to 0, USG systems to -1. */
  38. #if !defined (NEW_TTY_DRIVER) && !defined (_POSIX_VDISABLE)
  39. # if defined (_SVR4_VDISABLE)
  40. # define _POSIX_VDISABLE _SVR4_VDISABLE
  41. # else
  42. # if defined (_POSIX_VERSION)
  43. # define _POSIX_VDISABLE 0
  44. # else /* !_POSIX_VERSION */
  45. # define _POSIX_VDISABLE -1
  46. # endif /* !_POSIX_VERSION */
  47. # endif /* !_SVR4_DISABLE */
  48. #endif /* !NEW_TTY_DRIVER && !_POSIX_VDISABLE */
  49. typedef struct _rl_tty_chars {
  50. unsigned char t_eof;
  51. unsigned char t_eol;
  52. unsigned char t_eol2;
  53. unsigned char t_erase;
  54. unsigned char t_werase;
  55. unsigned char t_kill;
  56. unsigned char t_reprint;
  57. unsigned char t_intr;
  58. unsigned char t_quit;
  59. unsigned char t_susp;
  60. unsigned char t_dsusp;
  61. unsigned char t_start;
  62. unsigned char t_stop;
  63. unsigned char t_lnext;
  64. unsigned char t_flush;
  65. unsigned char t_status;
  66. } _RL_TTY_CHARS;
  67. #endif /* _RLTTY_H_ */