📄 termios.h
字号:
#ifndef _TERMIOS_H#define _TERMIOS_H#include "types.h"#define NCCS 17#define TTY_BUF_SIZE 1024/* c_cc characters */#define VINTR 0#define VQUIT 1#define VERASE 2#define VKILL 3#define VEOF 4#define VTIME 5#define VMIN 6#define VSWTC 7#define VSTART 8#define VSTOP 9#define VSUSP 10#define VEOL 11#define VREPRINT 12#define VDISCARD 13#define VWERASE 14#define VLNEXT 15#define VEOL2 16/* c_iflag bits */#define IGNBRK 0x00001 /* 1b*/#define BRKINT 0x00002 /* 10b*/#define IGNPAR 0x00004 /* 100b*/#define PARMRK 0x00008 /* 1000b*/#define INPCK 0x00010 /* 10000b*/#define ISTRIP 0x00020 /* 100000b*/#define INLCR 0x00040 /* 1000000b*/#define IGNCR 0x00080 /* 10000000b*/#define ICRNL 0x00100 /* 100000000b*/#define IUCLC 0x00200 /* 1000000000b*/#define IXON 0x00400 /* 10000000000b*/#define IXANY 0x00800 /* 100000000000b*/#define IXOFF 0x01000 /* 1000000000000b*/#define IMAXBEL 0x02000 /* 10000000000000b*//* c_oflag bits */#define OPOST 0x0001 /* 1b*/#define OLCUC 0x0002 /* 10b*/#define ONLCR 0x0004 /* 100b*/#define OCRNL 0x0008 /* 1000b*/#define ONOCR 0x0010 /* 10000b*/#define ONLRET 0x0020 /* 100000b*/#define OFILL 0x0040 /* 1000000b*/#define OFDEL 0x0080 /* 10000000b*/#define NLDLY 0x0100 /* 100000000b*/#define NL0 0x0000 /* 0b*/#define NL1 0x0100 /* 100000000b*/#define CRDLY 0x0600 /* 11000000000b*/#define CR0 0x0000 /* 0b*/#define CR1 0x0200 /* 1000000000b*/#define CR2 0x0400 /* 10000000000b*/#define CR3 0x0600 /* 11000000000b*/#define TABDLY 0x1800 /* 1100000000000b*/#define TAB0 0x0000 /* 0b*/#define TAB1 0x0800 /* 100000000000b*/#define TAB2 0x1000 /* 1000000000000b*/#define TAB3 0x1800 /* 1100000000000b*/#define XTABS 0x1800 /* 1100000000000b*/#define BSDLY 0x2000 /* 10000000000000b*/#define BS0 0x0000 /* 0b*/ #define BS1 0x2000 /* 10000000000000b*/#define VTDLY 0x4000 /*100000000000000b*/#define VT0 0x0000 /* 0b*/ #define VT1 0x4000 /*100000000000000b*/#define FFDLY 0x4000 /*100000000000000b*/#define FF0 0x0000 /* 0b*/#define FF1 0x4000 /*100000000000000b*//* c_cflag bit meaning */#define CBAUD 0x000f #define B0 0x0000 /* hang up */#define B50 0x0001 #define B75 0x0002 #define B110 0x0003 #define B134 0x0004 #define B150 0x0005 #define B200 0x0006 #define B300 0x0007 #define B600 0x0008 #define B1200 0x0009 #define B1800 0x000a #define B2400 0x000b #define B4800 0x000c #define B9600 0x000d #define B19200 0x000e #define B38400 0x000f #define EXTA B19200#define EXTB B38400#define CSIZE 0x0030 #define CS5 0x0000 #define CS6 0x0010 #define CS7 0x0020 #define CS8 0x0030 #define CSTOPB 0x0040 #define CREAD 0x0080 #define CPARENB 0x0100 #define CPARODD 0x0200 #define HUPCL 0x0400 #define CLOCAL 0x0800 #define CIBAUD 0xF0000 /* input baud rate (not used) */#define CRTSCTS 0x80000000 /* flow control *//* c_lflag bits */#define ISIG 0x0001#define ICANON 0x0002#define XCASE 0x0004#define ECHO 0x0008#define ECHOE 0x0010#define ECHOK 0x0020#define ECHONL 0x0040#define NOFLSH 0x0080#define TOSTOP 0x0100#define ECHOCTL 0x0200#define ECHOPRT 0x0400#define ECHOKE 0x0800#define FLUSHO 0x1000#define PENDIN 0x4000#define IEXTEN 0x8000typedef unsigned long tcflag;struct termios{ tcflag c_iflag; /* input mode flags */ tcflag c_oflag; /* output mode flags */ tcflag c_cflag; /* control mode flags */ tcflag c_lflag; /* local mode flags */ tcflag c_line; /* line discipline */ cc_t c_cc[NCCS]; /* control characters */};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -