1274578Sngie/* rlwinsize.h -- an attempt to isolate some of the system-specific defines
2274578Sngie   for `struct winsize' and TIOCGWINSZ. */
3298107Sgjb
4298107Sgjb/* Copyright (C) 1997-2009 Free Software Foundation, Inc.
5298107Sgjb
6274578Sngie   This file is part of the GNU Readline Library (Readline), a library
7274578Sngie   for reading lines of text with interactive input and history editing.
8274578Sngie
9274578Sngie   Readline is free software: you can redistribute it and/or modify
10274578Sngie   it under the terms of the GNU General Public License as published by
11274578Sngie   the Free Software Foundation, either version 3 of the License, or
12274578Sngie   (at your option) any later version.
13274578Sngie
14274578Sngie   Readline is distributed in the hope that it will be useful,
15274578Sngie   but WITHOUT ANY WARRANTY; without even the implied warranty of
16274578Sngie   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17274578Sngie   GNU General Public License for more details.
18274578Sngie
19274578Sngie   You should have received a copy of the GNU General Public License
20274578Sngie   along with Readline.  If not, see <http://www.gnu.org/licenses/>.
21274578Sngie*/
22274578Sngie
23274578Sngie#if !defined (_RLWINSIZE_H_)
24274578Sngie#define _RLWINSIZE_H_
25274578Sngie
26274578Sngie#if defined (HAVE_CONFIG_H)
27282091Sandrew#  include "config.h"
28274578Sngie#endif
29282091Sandrew
30274578Sngie/* Try to find the definitions of `struct winsize' and TIOGCWINSZ */
31274578Sngie
32274578Sngie#if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ)
33274578Sngie#  include <sys/ioctl.h>
34274578Sngie#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */
35274578Sngie
36291738Sbdrewery#if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL)
37291738Sbdrewery#  include <termios.h>
38291738Sbdrewery#endif /* STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */
39274578Sngie
40274578Sngie/* Not in either of the standard places, look around. */
41274578Sngie#if !defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL)
42274578Sngie#  if defined (HAVE_SYS_STREAM_H)
43274578Sngie#    include <sys/stream.h>
44274578Sngie#  endif /* HAVE_SYS_STREAM_H */
45274578Sngie#  if defined (HAVE_SYS_PTEM_H) /* SVR4.2, at least, has it here */
46274578Sngie#    include <sys/ptem.h>
47274578Sngie#    define _IO_PTEM_H          /* work around SVR4.2 1.1.4 bug */
48274578Sngie#  endif /* HAVE_SYS_PTEM_H */
49274578Sngie#  if defined (HAVE_SYS_PTE_H)  /* ??? */
50274578Sngie#    include <sys/pte.h>
51274578Sngie#  endif /* HAVE_SYS_PTE_H */
52274578Sngie#endif /* !STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */
53274578Sngie
54274578Sngie#if defined (M_UNIX) && !defined (_SCO_DS) && !defined (tcflow)
55274578Sngie#  define tcflow(fd, action)	ioctl(fd, TCXONC, action)
56274578Sngie#endif
57
58#endif /* _RL_WINSIZE_H */
59