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