1 /* rlwinsize.h -- an attempt to isolate some of the system-specific defines
2 for `struct winsize' and TIOCGWINSZ. */
4 /* Copyright (C) 1997-2009 Free Software Foundation, Inc.
6 This file is part of the GNU Readline Library (Readline), a library
7 for reading lines of text with interactive input and history editing.
9 Readline is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Readline is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Readline. If not, see <http://www.gnu.org/licenses/>.
23 #if !defined (_RLWINSIZE_H_)
26 #if defined (HAVE_CONFIG_H)
30 /* Try to find the definitions of `struct winsize' and TIOGCWINSZ */
32 #if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ)
33 # include <sys/ioctl.h>
34 #endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */
36 #if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL)
38 #endif /* STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */
40 /* Not in either of the standard places, look around. */
41 #if !defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL)
42 # if defined (HAVE_SYS_STREAM_H)
43 # include <sys/stream.h>
44 # endif /* HAVE_SYS_STREAM_H */
45 # if defined (HAVE_SYS_PTEM_H) /* SVR4.2, at least, has it here */
46 # include <sys/ptem.h>
47 # define _IO_PTEM_H /* work around SVR4.2 1.1.4 bug */
48 # endif /* HAVE_SYS_PTEM_H */
49 # if defined (HAVE_SYS_PTE_H) /* ??? */
51 # endif /* HAVE_SYS_PTE_H */
52 #endif /* !STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */
54 #if defined (M_UNIX) && !defined (_SCO_DS) && !defined (tcflow)
55 # define tcflow(fd, action) ioctl(fd, TCXONC, action)
58 #endif /* _RL_WINSIZE_H */