File:tty.h - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki

Source

7945

7946

7947 char partab[]; /* ASCII table: parity, character class */

  • LIONS源代码中并没有partab的定义,在此给出
char partab[] { 0001,0201,0201,0001,0201,0001,0001,0201, 0202,0004,0003,0205,0005,0206,0201,0001, 0201,0001,0001,0201,0001,0201,0201,0001, 0001,0201,0201,0001,0201,0001,0001,0201, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0201 };

7948

7949

7950

7951 #define TTIPRI 10

7952 #define TTOPRI 20

7953

7954 #define CERASE ’#’ /* default special characters */

7955 #define CEOT 004

7956 #define CKILL ’@’

7957 #define CQUIT 034 /* FS, cntl shift L */

7958 #define CINTR 0177 /* DEL */

7959

7960 /* limits */

7961 #define TTHIWAT 50

7962 #define TTLOWAT 30

7963 #define TTYHOG 256

7964

7965 /* modes */

7966 #define HUPCL 01

7967 #define XTABS 02

  • tty 不(能)对 制表符 做处理
7968 #define LCASE 04
  • tty 只支持 64字符 ASCII 子集(引自 LIONS 源代码分析)
7969 #define ECHO 010
  • 全双工模式,输入字符回显
7970 #define CRMOD 020
  • 换行符模式
  • 在输入中,将 \r 代换成
\n
  • 在输出中,将
\n 代换成 \r \n
7971 #define RAW 040
  • 原始模式
  • 将输入字符按原样送给程序,不进行“擦除”和“擦除行”处理,或对于反斜线字符的调整(引自LIONS源代码分析)
7972 #define ODDP 0100

7973 #define EVENP 0200

7974 #define NLDELAY 001400

7975 #define TBDELAY 006000

7976 #define CRDELAY 030000

7977 #define VTDELAY 040000

7978

7979 /* Hardware bits */

7980 #define DONE 0200

7981 #define IENABLE 0100

7982

7983 /* Internal state bits */

7984 #define TIMEOUT 01 /* Delay timeout in progress */

7985 #define WOPEN 02 /* Waiting for open to

7986                     complete */

7987 #define ISOPEN 04 /* Device is open */

7988 #define SSTART 010 /* Has special start routine

7989                          at addr */

  • 标志,表明tty设备有特殊的启动函数,由tty.t_addr指向
7990 #define CARR_ON 020 /* Software copy of

7991                          carrier-present */

7992 #define BUSY 040 /* Output in progress */

7993 #define ASLEEP 0100 /* Wakeup when output done */

7994

7995

7996

7997

7998

7999

⚠️ **GitHub.com Fallback** ⚠️