The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/termios.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: termios.h,v 1.26 2003/08/07 16:34:17 agc Exp $ */
    2 
    3 /*
    4  * Copyright (c) 1988, 1989, 1993, 1994
    5  *      The Regents of the University of California.  All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. Redistributions in binary form must reproduce the above copyright
   13  *    notice, this list of conditions and the following disclaimer in the
   14  *    documentation and/or other materials provided with the distribution.
   15  * 3. Neither the name of the University nor the names of its contributors
   16  *    may be used to endorse or promote products derived from this software
   17  *    without specific prior written permission.
   18  *
   19  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   29  * SUCH DAMAGE.
   30  *
   31  *      @(#)termios.h   8.3 (Berkeley) 3/28/94
   32  */
   33 
   34 #ifndef _SYS_TERMIOS_H_
   35 #define _SYS_TERMIOS_H_
   36 
   37 #include <sys/ansi.h>
   38 #include <sys/featuretest.h>
   39 
   40 /*
   41  * Special Control Characters
   42  *
   43  * Index into c_cc[] character array.
   44  *
   45  *      Name         Subscript  Enabled by
   46  */
   47 #define VEOF            0       /* ICANON */
   48 #define VEOL            1       /* ICANON */
   49 #if defined(_NETBSD_SOURCE)
   50 #define VEOL2           2       /* ICANON */
   51 #endif
   52 #define VERASE          3       /* ICANON */
   53 #if defined(_NETBSD_SOURCE)
   54 #define VWERASE         4       /* ICANON */
   55 #endif
   56 #define VKILL           5       /* ICANON */
   57 #if defined(_NETBSD_SOURCE)
   58 #define VREPRINT        6       /* ICANON */
   59 #endif
   60 /*                      7          spare 1 */
   61 #define VINTR           8       /* ISIG */
   62 #define VQUIT           9       /* ISIG */
   63 #define VSUSP           10      /* ISIG */
   64 #if defined(_NETBSD_SOURCE)
   65 #define VDSUSP          11      /* ISIG */
   66 #endif
   67 #define VSTART          12      /* IXON, IXOFF */
   68 #define VSTOP           13      /* IXON, IXOFF */
   69 #if defined(_NETBSD_SOURCE)
   70 #define VLNEXT          14      /* IEXTEN */
   71 #define VDISCARD        15      /* IEXTEN */
   72 #endif
   73 #define VMIN            16      /* !ICANON */
   74 #define VTIME           17      /* !ICANON */
   75 #if defined(_NETBSD_SOURCE)
   76 #define VSTATUS         18      /* ICANON */
   77 /*                      19         spare 2 */
   78 #endif
   79 #define NCCS            20
   80 
   81 #define _POSIX_VDISABLE ((unsigned char)'\377')
   82 
   83 #if defined(_NETBSD_SOURCE)
   84 #define CCEQ(val, c)    (c == val ? val != _POSIX_VDISABLE : 0)
   85 #endif
   86 
   87 /*
   88  * Input flags - software input processing
   89  */
   90 #define IGNBRK          0x00000001      /* ignore BREAK condition */
   91 #define BRKINT          0x00000002      /* map BREAK to SIGINTR */
   92 #define IGNPAR          0x00000004      /* ignore (discard) parity errors */
   93 #define PARMRK          0x00000008      /* mark parity and framing errors */
   94 #define INPCK           0x00000010      /* enable checking of parity errors */
   95 #define ISTRIP          0x00000020      /* strip 8th bit off chars */
   96 #define INLCR           0x00000040      /* map NL into CR */
   97 #define IGNCR           0x00000080      /* ignore CR */
   98 #define ICRNL           0x00000100      /* map CR to NL (ala CRMOD) */
   99 #define IXON            0x00000200      /* enable output flow control */
  100 #define IXOFF           0x00000400      /* enable input flow control */
  101 #if defined(_NETBSD_SOURCE)
  102 #define IXANY           0x00000800      /* any char will restart after stop */
  103 #endif
  104 #if defined(_NETBSD_SOURCE)
  105 #define IMAXBEL         0x00002000      /* ring bell on input queue full */
  106 #endif
  107 
  108 /*
  109  * Output flags - software output processing
  110  */
  111 #define OPOST           0x00000001      /* enable following output processing */
  112 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
  113 #define ONLCR           0x00000002      /* map NL to CR-NL (ala CRMOD) */
  114 #endif
  115 #if defined(_NETBSD_SOURCE)
  116 #define OXTABS          0x00000004      /* expand tabs to spaces */
  117 #define ONOEOT          0x00000008      /* discard EOT's (^D) on output */
  118 #endif
  119 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
  120 #define OCRNL           0x00000010      /* map CR to NL */
  121 #define ONOCR           0x00000020      /* discard CR's when on column 0 */
  122 #define ONLRET          0x00000040      /* move to column 0 on CR */
  123 #endif  /* defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) */
  124 
  125 /*
  126  * Control flags - hardware control of terminal
  127  */
  128 #if defined(_NETBSD_SOURCE)
  129 #define CIGNORE         0x00000001      /* ignore control flags */
  130 #endif
  131 #define CSIZE           0x00000300      /* character size mask */
  132 #define     CS5             0x00000000      /* 5 bits (pseudo) */
  133 #define     CS6             0x00000100      /* 6 bits */
  134 #define     CS7             0x00000200      /* 7 bits */
  135 #define     CS8             0x00000300      /* 8 bits */
  136 #define CSTOPB          0x00000400      /* send 2 stop bits */
  137 #define CREAD           0x00000800      /* enable receiver */
  138 #define PARENB          0x00001000      /* parity enable */
  139 #define PARODD          0x00002000      /* odd parity, else even */
  140 #define HUPCL           0x00004000      /* hang up on last close */
  141 #define CLOCAL          0x00008000      /* ignore modem status lines */
  142 #if defined(_NETBSD_SOURCE)
  143 #define CRTSCTS         0x00010000      /* RTS/CTS full-duplex flow control */
  144 #define CRTS_IFLOW      CRTSCTS         /* XXX compat */
  145 #define CCTS_OFLOW      CRTSCTS         /* XXX compat */
  146 #define CDTRCTS         0x00020000      /* DTR/CTS full-duplex flow control */
  147 #define MDMBUF          0x00100000      /* DTR/DCD hardware flow control */
  148 #define CHWFLOW         (MDMBUF|CRTSCTS|CDTRCTS) /* all types of hw flow control */
  149 #endif
  150 
  151 
  152 /*
  153  * "Local" flags - dumping ground for other state
  154  *
  155  * Warning: some flags in this structure begin with
  156  * the letter "I" and look like they belong in the
  157  * input flag.
  158  */
  159 
  160 #if defined(_NETBSD_SOURCE)
  161 #define ECHOKE          0x00000001      /* visual erase for line kill */
  162 #endif
  163 #define ECHOE           0x00000002      /* visually erase chars */
  164 #define ECHOK           0x00000004      /* echo NL after line kill */
  165 #define ECHO            0x00000008      /* enable echoing */
  166 #define ECHONL          0x00000010      /* echo NL even if ECHO is off */
  167 #if defined(_NETBSD_SOURCE)
  168 #define ECHOPRT         0x00000020      /* visual erase mode for hardcopy */
  169 #define ECHOCTL         0x00000040      /* echo control chars as ^(Char) */
  170 #endif  /* defined(_NETBSD_SOURCE) */
  171 #define ISIG            0x00000080      /* enable signals INTR, QUIT, [D]SUSP */
  172 #define ICANON          0x00000100      /* canonicalize input lines */
  173 #if defined(_NETBSD_SOURCE)
  174 #define ALTWERASE       0x00000200      /* use alternate WERASE algorithm */
  175 #endif /* defined(_NETBSD_SOURCE) */
  176 #define IEXTEN          0x00000400      /* enable DISCARD and LNEXT */
  177 #if defined(_NETBSD_SOURCE)
  178 #define EXTPROC         0x00000800      /* external processing */
  179 #endif /* defined(_NETBSD_SOURCE) */
  180 #define TOSTOP          0x00400000      /* stop background jobs on output */
  181 #if defined(_NETBSD_SOURCE)
  182 #define FLUSHO          0x00800000      /* output being flushed (state) */
  183 #define NOKERNINFO      0x02000000      /* no kernel output from VSTATUS */
  184 #define PENDIN          0x20000000      /* re-echo input buffer at next read */
  185 #endif /* defined(_NETBSD_SOURCE) */
  186 #define NOFLSH          0x80000000      /* don't flush output on signal */
  187 
  188 typedef unsigned int    tcflag_t;
  189 typedef unsigned char   cc_t;
  190 typedef unsigned int    speed_t;
  191 
  192 struct termios {
  193         tcflag_t        c_iflag;        /* input flags */
  194         tcflag_t        c_oflag;        /* output flags */
  195         tcflag_t        c_cflag;        /* control flags */
  196         tcflag_t        c_lflag;        /* local flags */
  197         cc_t            c_cc[NCCS];     /* control chars */
  198         int             c_ispeed;       /* input speed */
  199         int             c_ospeed;       /* output speed */
  200 };
  201 
  202 /*
  203  * Commands passed to tcsetattr() for setting the termios structure.
  204  */
  205 #define TCSANOW         0               /* make change immediate */
  206 #define TCSADRAIN       1               /* drain output, then change */
  207 #define TCSAFLUSH       2               /* drain output, flush input */
  208 #if defined(_NETBSD_SOURCE)
  209 #define TCSASOFT        0x10            /* flag - don't alter h.w. state */
  210 #endif
  211 
  212 /*
  213  * Standard speeds
  214  */
  215 #define B0      0
  216 #define B50     50
  217 #define B75     75
  218 #define B110    110
  219 #define B134    134
  220 #define B150    150
  221 #define B200    200
  222 #define B300    300
  223 #define B600    600
  224 #define B1200   1200
  225 #define B1800   1800
  226 #define B2400   2400
  227 #define B4800   4800
  228 #define B9600   9600
  229 #define B19200  19200
  230 #define B38400  38400
  231 #if defined(_NETBSD_SOURCE)
  232 #define B7200   7200
  233 #define B14400  14400
  234 #define B28800  28800
  235 #define B57600  57600
  236 #define B76800  76800
  237 #define B115200 115200
  238 #define B230400 230400
  239 #define EXTA    19200
  240 #define EXTB    38400
  241 #endif  /* defined(_NETBSD_SOURCE) */
  242 
  243 #ifndef _KERNEL
  244 
  245 #define TCIFLUSH        1
  246 #define TCOFLUSH        2
  247 #define TCIOFLUSH       3
  248 #define TCOOFF          1
  249 #define TCOON           2
  250 #define TCIOFF          3
  251 #define TCION           4
  252 
  253 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
  254 #ifndef pid_t
  255 typedef __pid_t         pid_t;
  256 #define pid_t           __pid_t
  257 #endif
  258 #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
  259 #include <sys/cdefs.h>
  260 
  261 __BEGIN_DECLS
  262 speed_t cfgetispeed __P((const struct termios *));
  263 speed_t cfgetospeed __P((const struct termios *));
  264 int     cfsetispeed __P((struct termios *, speed_t));
  265 int     cfsetospeed __P((struct termios *, speed_t));
  266 int     tcgetattr __P((int, struct termios *));
  267 int     tcsetattr __P((int, int, const struct termios *));
  268 int     tcdrain __P((int));
  269 int     tcflow __P((int, int));
  270 int     tcflush __P((int, int));
  271 int     tcsendbreak __P((int, int));
  272 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
  273 pid_t   tcgetsid __P((int));
  274 #endif /* defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) */
  275 
  276 
  277 #if defined(_NETBSD_SOURCE)
  278 void    cfmakeraw __P((struct termios *));
  279 int     cfsetspeed __P((struct termios *, speed_t));
  280 #endif /* defined(_NETBSD_SOURCE) */
  281 __END_DECLS
  282 
  283 #endif /* !_KERNEL */
  284 
  285 #if defined(_NETBSD_SOURCE)
  286 
  287 /*
  288  * Include tty ioctl's that aren't just for backwards compatibility
  289  * with the old tty driver.  These ioctl definitions were previously
  290  * in <sys/ioctl.h>.
  291  */
  292 #include <sys/ttycom.h>
  293 #endif
  294 
  295 /*
  296  * END OF PROTECTED INCLUDE.
  297  */
  298 #endif /* !_SYS_TERMIOS_H_ */
  299 
  300 #if defined(_NETBSD_SOURCE)
  301 #include <sys/ttydefaults.h>
  302 #endif

Cache object: 49d9d4cc8358a9f467fe4883c594adc7


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.