Path: blob/main/contrib/llvm-project/libc/include/llvm-libc-macros/linux/termios-macros.h
213799 views
//===-- Definition of macros from termios.h -------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIBC_MACROS_LINUX_TERMIOS_MACROS_H9#define LLVM_LIBC_MACROS_LINUX_TERMIOS_MACROS_H1011// Below are generic definitions of symbolic bit-masks, modes etc. They serve12// most architectures including x86_64, aarch64 but have to be adjusted for few13// architectures MIPS.1415#define NCCS 321617// Bit-masks for the c_iflag field of struct termios.18#define IGNBRK 0000001 // Ignore break condition19#define BRKINT 0000002 // Signal interrupt on break20#define IGNPAR 0000004 // Ignore characters with parity errors21#define PARMRK 0000010 // Mark parity and framing errors22#define INPCK 0000020 // Enable input parity check23#define ISTRIP 0000040 // Strip 8th bit off characters24#define INLCR 0000100 // Map NL to CR on input25#define IGNCR 0000200 // Ignore CR26#define ICRNL 0000400 // Map CR to NL on input27#define IUCLC 0001000 // Map uppercase characters to lowercase on input28#define IXON 0002000 // Enable start/stop output control29#define IXANY 0004000 // Enable any character to restart output30#define IXOFF 0010000 // Enable start/stop input control31#define IMAXBEL 0020000 // Ring bell when input queue is full32#define IUTF8 0040000 // Input is UTF8 (not in POSIX)3334// Bit-masks for the c_oflag field of struct termios.35#define OPOST 0000001 // Post-process output36#define OLCUC 0000002 // Map lowercase characters to uppercase on output37#define ONLCR 0000004 // Map NL to CR-NL on output38#define OCRNL 0000010 // Map CR to NL on output39#define ONOCR 0000020 // No CR output at column 040#define ONLRET 0000040 // NL performs CR function41#define OFILL 0000100 // Use fill characters for delay42#define OFDEL 0000200 // Fill is DEL43#define NLDLY 0000400 // Select newline delays44#define NL0 0000000 // Newline type 045#define NL1 0000400 // Newline type 146#define CRDLY 0003000 // Select carriage-return delays47#define CR0 0000000 // Carriage-return delay type 048#define CR1 0001000 // Carriage-return delay type 149#define CR2 0002000 // Carriage-return delay type 250#define CR3 0003000 // Carriage-return delay type 351#define TABDLY 0014000 // Select horizontal-tab delays52#define TAB0 0000000 // Horizontal-tab delay type 053#define TAB1 0004000 // Horizontal-tab delay type 154#define TAB2 0010000 // Horizontal-tab delay type 255#define TAB3 0014000 // Expand tabs to spaces56#define BSDLY 0020000 // Select backspace delays57#define BS0 0000000 // Backspace-delay type 058#define BS1 0020000 // Backspace-delay type 159#define FFDLY 0100000 // Select form-feed delays60#define FF0 0000000 // Form-feed delay type 061#define FF1 0100000 // Form-feed delay type 162#define VTDLY 0040000 // Select vertical-tab delays63#define VT0 0000000 // Vertical-tab delay type 064#define VT1 0040000 // Vertical-tab delay type 165#define XTABS 00140006667// Symbolic subscripts for the c_cc array.68#define VINTR 069#define VQUIT 170#define VERASE 271#define VKILL 372#define VEOF 473#define VTIME 574#define VMIN 675#define VSWTC 776#define VSTART 877#define VSTOP 978#define VSUSP 1079#define VEOL 1180#define VREPRINT 1281#define VDISCARD 1382#define VWERASE 1483#define VLNEXT 1584#define VEOL2 168586// Baud rate related definitions87#define CBAUD 000000010017 // Baud speed mask88#define CBAUDX 000000010000 // Extra baud speed mask89#define CIBAUD 00200360000090#define CMSPAR 01000000000091#define CRTSCTS 02000000000092// Baud rates with values representable by the speed_t type.93#define B0 0000000 // Implies hang-up94// A symbol B<NN+> below indicates a baud rate of <NN+>.95#define B50 000000196#define B75 000000297#define B110 000000398#define B134 000000499#define B150 0000005100#define B200 0000006101#define B300 0000007102#define B600 0000010103#define B1200 0000011104#define B1800 0000012105#define B2400 0000013106#define B4800 0000014107#define B9600 0000015108#define B19200 0000016109#define B38400 0000017110// Extra baud rates111#define B57600 0010001112#define B115200 0010002113#define B230400 0010003114#define B460800 0010004115#define B500000 0010005116#define B576000 0010006117#define B921600 0010007118#define B1000000 0010010119#define B1152000 0010011120#define B1500000 0010012121#define B2000000 0010013122#define B2500000 0010014123#define B3000000 0010015124#define B3500000 0010016125#define B4000000 0010017126127// Control mode bits for use in the c_cflag field of struct termios.128#define CSIZE 0000060 // Mask for character size bits129#define CS5 0000000130#define CS6 0000020131#define CS7 0000040132#define CS8 0000060133#define CSTOPB 0000100 // Send two bits, else one134#define CREAD 0000200 // Enable receiver135#define PARENB 0000400 // Parity enable136#define PARODD 0001000 // Odd parity, else even137#define HUPCL 0002000 // Hang up on last close138#define CLOCAL 0004000 // Ignore modem status lines139140// Local mode bits for use in the c_lflag field of struct termios.141#define ISIG 0000001 // Enable signals142#define ICANON 0000002 // Canonical input (erase and kill processing)143#define ECHO 0000010 // Enable echo144#define ECHOE 0000020 // Echo erase character as error-correcting backspace145#define ECHOK 0000040 // Echo KILL146#define ECHONL 0000100 // Echo NL147#define NOFLSH 0000200 // Disable flush after interrupt or quit148#define TOSTOP 0000400 // Send SIGTTOU for background output149150// Attribute selection151#define TCSANOW 0 // Change attributes immediately152#define TCSADRAIN 1 // Change attributes when output has drained153#define TCSAFLUSH 2 // Same as TCSADRAIN and flush pending Output154155// Symbolic constants for use with tcflush function.156#define TCIFLUSH 0 // Flush pending input157#define TCIOFLUSH 1 // Flush pending input and unstransmitted output158#define TCOFLUSH 2 // Flush unstransmitted output159160// Symbolic constantf for use with tcflow function.161#define TCOOFF 0 // Transmit a STOP character, intended to suspend input data162#define TCOON 1 // Transmit a START character, intended to restart input data163#define TCIOFF 2 // Suspend output164#define TCION 3 // Restart output165166#endif // LLVM_LIBC_MACROS_LINUX_TERMIOS_MACROS_H167168169