1 /* Structure types for pre-termios terminal ioctls.  Generic Unix version.
2    Copyright (C) 1996-2022 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4 
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9 
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14 
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, see
17    <https://www.gnu.org/licenses/>.  */
18 
19 #ifndef _SYS_IOCTL_H
20 # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
21 #endif
22 
23 #if defined TIOCGETC || defined TIOCSETC
24 /* Type of ARG for TIOCGETC and TIOCSETC requests.  */
25 struct tchars
26 {
27   char t_intrc;			/* Interrupt character.  */
28   char t_quitc;			/* Quit character.  */
29   char t_startc;		/* Start-output character.  */
30   char t_stopc;			/* Stop-output character.  */
31   char t_eofc;			/* End-of-file character.  */
32   char t_brkc;			/* Input delimiter character.  */
33 };
34 
35 # define	_IOT_tchars	/* Hurd ioctl type field.  */ \
36   _IOT (_IOTS (char), 6, 0, 0, 0, 0)
37 #endif
38 
39 #if defined TIOCGLTC || defined TIOCSLTC
40 /* Type of ARG for TIOCGLTC and TIOCSLTC requests.  */
41 struct ltchars
42 {
43   char t_suspc;			/* Suspend character.  */
44   char t_dsuspc;		/* Delayed suspend character.  */
45   char t_rprntc;		/* Reprint-line character.  */
46   char t_flushc;		/* Flush-output character.  */
47   char t_werasc;		/* Word-erase character.  */
48   char t_lnextc;		/* Literal-next character.  */
49 };
50 
51 # define	_IOT_ltchars	/* Hurd ioctl type field.  */ \
52   _IOT (_IOTS (char), 6, 0, 0, 0, 0)
53 #endif
54 
55 /* Type of ARG for TIOCGETP and TIOCSETP requests (and gtty and stty).  */
56 struct sgttyb
57 {
58   char sg_ispeed;		/* Input speed.  */
59   char sg_ospeed;		/* Output speed.  */
60   char sg_erase;		/* Erase character.  */
61   char sg_kill;			/* Kill character.  */
62   short int sg_flags;		/* Mode flags.  */
63 };
64 
65 #define	_IOT_sgttyb	/* Hurd ioctl type field.  */ \
66   _IOT (_IOTS (char), 4, _IOTS (short int), 1, 0, 0)
67 
68 #if defined TIOCGWINSZ || defined TIOCSWINSZ
69 /* Type of ARG for TIOCGWINSZ and TIOCSWINSZ requests.  */
70 struct winsize
71 {
72   unsigned short int ws_row;	/* Rows, in characters.  */
73   unsigned short int ws_col;	/* Columns, in characters.  */
74 
75   /* These are not actually used.  */
76   unsigned short int ws_xpixel;	/* Horizontal pixels.  */
77   unsigned short int ws_ypixel;	/* Vertical pixels.  */
78 };
79 
80 # define	_IOT_winsize	/* Hurd ioctl type field.  */ \
81   _IOT (_IOTS (unsigned short int), 4, 0, 0, 0, 0)
82 #endif
83 
84 #if defined TIOCGSIZE || defined TIOCSSIZE
85 /* The BSD-style ioctl constructor macros use `sizeof', which can't be used
86    in a preprocessor conditional.  Since the commands are always unique
87    regardless of the size bits, we can safely define away `sizeof' for the
88    purpose of the conditional.  */
89 # define sizeof(type) 0
90 # if defined TIOCGWINSZ && TIOCGSIZE == TIOCGWINSZ
91 /* Many systems that have TIOCGWINSZ define TIOCGSIZE for source
92    compatibility with Sun; they define `struct ttysize' to have identical
93    layout as `struct winsize' and #define TIOCGSIZE to be TIOCGWINSZ
94    (likewise TIOCSSIZE and TIOCSWINSZ).  */
95 struct ttysize
96 {
97   unsigned short int ts_lines;
98   unsigned short int ts_cols;
99   unsigned short int ts_xxx;
100   unsigned short int ts_yyy;
101 };
102 #  define	_IOT_ttysize	_IOT_winsize
103 # else
104 /* Suns use a different layout for `struct ttysize', and TIOCGSIZE and
105    TIOCGWINSZ are separate commands that do the same thing with different
106    structures (likewise TIOCSSIZE and TIOCSWINSZ).  */
107 struct ttysize
108 {
109   int ts_lines, ts_cols;	/* Lines and columns, in characters.  */
110 };
111 # endif
112 # undef sizeof			/* See above.  */
113 #endif
114