Back to index

glibc  2.9
ioctl-types.h
Go to the documentation of this file.
00001 /* Structure types for pre-termios terminal ioctls.  Generic Unix version.
00002    Copyright (C) 1996, 1997 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _SYS_IOCTL_H
00021 # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
00022 #endif
00023 
00024 #if defined TIOCGETC || defined TIOCSETC
00025 /* Type of ARG for TIOCGETC and TIOCSETC requests.  */
00026 struct tchars
00027 {
00028   char t_intrc;                    /* Interrupt character.  */
00029   char t_quitc;                    /* Quit character.  */
00030   char t_startc;            /* Start-output character.  */
00031   char t_stopc;                    /* Stop-output character.  */
00032   char t_eofc;                     /* End-of-file character.  */
00033   char t_brkc;                     /* Input delimiter character.  */
00034 };
00035 
00036 #define       _IOT_tchars   /* Hurd ioctl type field.  */ \
00037   _IOT (_IOTS (char), 6, 0, 0, 0, 0)
00038 #endif
00039 
00040 #if defined TIOCGLTC || defined TIOCSLTC
00041 /* Type of ARG for TIOCGLTC and TIOCSLTC requests.  */
00042 struct ltchars
00043 {
00044   char t_suspc;                    /* Suspend character.  */
00045   char t_dsuspc;            /* Delayed suspend character.  */
00046   char t_rprntc;            /* Reprint-line character.  */
00047   char t_flushc;            /* Flush-output character.  */
00048   char t_werasc;            /* Word-erase character.  */
00049   char t_lnextc;            /* Literal-next character.  */
00050 };
00051 
00052 #define       _IOT_ltchars  /* Hurd ioctl type field.  */ \
00053   _IOT (_IOTS (char), 6, 0, 0, 0, 0)
00054 #endif
00055 
00056 /* Type of ARG for TIOCGETP and TIOCSETP requests (and gtty and stty).  */
00057 struct sgttyb
00058 {
00059   char sg_ispeed;           /* Input speed.  */
00060   char sg_ospeed;           /* Output speed.  */
00061   char sg_erase;            /* Erase character.  */
00062   char sg_kill;                    /* Kill character.  */
00063   short int sg_flags;              /* Mode flags.  */
00064 };
00065 
00066 #define       _IOT_sgttyb   /* Hurd ioctl type field.  */ \
00067   _IOT (_IOTS (char), 6, _IOTS (short int), 1, 0, 0)
00068 
00069 #if defined TIOCGWINSZ || defined TIOCSWINSZ
00070 /* Type of ARG for TIOCGWINSZ and TIOCSWINSZ requests.  */
00071 struct winsize
00072 {
00073   unsigned short int ws_row;       /* Rows, in characters.  */
00074   unsigned short int ws_col;       /* Columns, in characters.  */
00075 
00076   /* These are not actually used.  */
00077   unsigned short int ws_xpixel;    /* Horizontal pixels.  */
00078   unsigned short int ws_ypixel;    /* Vertical pixels.  */
00079 };
00080 
00081 #define       _IOT_winsize  /* Hurd ioctl type field.  */ \
00082   _IOT (_IOTS (unsigned short int), 4, 0, 0, 0, 0)
00083 #endif
00084 
00085 #if defined TIOCGSIZE || defined TIOCSSIZE
00086 /* The BSD-style ioctl constructor macros use `sizeof', which can't be used
00087    in a preprocessor conditional.  Since the commands are always unique
00088    regardless of the size bits, we can safely define away `sizeof' for the
00089    purpose of the conditional.  */
00090 #  define sizeof(type) 0
00091 #  if defined TIOCGWINSZ && TIOCGSIZE == TIOCGWINSZ
00092 /* Many systems that have TIOCGWINSZ define TIOCGSIZE for source
00093    compatibility with Sun; they define `struct ttysize' to have identical
00094    layout as `struct winsize' and #define TIOCGSIZE to be TIOCGWINSZ
00095    (likewise TIOCSSIZE and TIOCSWINSZ).  */
00096 struct ttysize
00097 {
00098   unsigned short int ts_lines;
00099   unsigned short int ts_cols;
00100   unsigned short int ts_xxx;
00101   unsigned short int ts_yyy;
00102 };
00103 #define       _IOT_ttysize  _IOT_winsize
00104 #  else
00105 /* Suns use a different layout for `struct ttysize', and TIOCGSIZE and
00106    TIOCGWINSZ are separate commands that do the same thing with different
00107    structures (likewise TIOCSSIZE and TIOCSWINSZ).  */
00108 struct ttysize
00109 {
00110   int ts_lines, ts_cols;    /* Lines and columns, in characters.  */
00111 };
00112 #  endif
00113 #  undef sizeof                    /* See above.  */
00114 #endif