Improve isystem includes and magic numbers

This commit is contained in:
Justine Tunney 2021-08-14 17:16:33 -07:00
parent 1e5bd4d23e
commit 228fb7428b
143 changed files with 1183 additions and 266 deletions

33
libc/calls/ttydefaults.h Normal file
View file

@ -0,0 +1,33 @@
#ifndef COSMOPOLITAN_LIBC_CALLS_TTYDEFAULTS_H_
#define COSMOPOLITAN_LIBC_CALLS_TTYDEFAULTS_H_
#include "libc/sysv/consts/baud.h"
#include "libc/sysv/consts/termios.h"
#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE | ECHOKE | ECHOCTL)
#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
#define TTYDEF_SPEED (B9600)
#define CTRL(x) ((x) ^ 0100)
#define CEOF CTRL('D')
#define CERASE CTRL('?')
#define CINTR CTRL('C')
#define CKILL CTRL('U')
#define CQUIT CTRL('\\')
#define CSUSP CTRL('Z')
#define CDSUSP CTRL('Y')
#define CSTART CTRL('Q')
#define CSTOP CTRL('S')
#define CLNEXT CTRL('V')
#define CDISCARD CTRL('O')
#define CWERASE CTRL('W')
#define CREPRINT CTRL('R')
#define CEOT CEOF
#define CBRK CEOL
#define CRPRNT CREPRINT
#define CFLUSH CDISCARD
#define CMIN 1
#define CTIME 0
#endif /* COSMOPOLITAN_LIBC_CALLS_TTYDEFAULTS_H_ */