diff options
| author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-14 10:57:13 +0200 |
|---|---|---|
| committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-10 18:38:25 +1000 |
| commit | b1a3cb0d6d3eb3bcd8ef07a7c5f8ef39bd1dbb7f (patch) | |
| tree | f5db270d09c556fd96a677fbad3982c989aaed16 | |
| parent | d029ae797bff2ecb95c39b80f6a4eb4419e2e827 (diff) | |
| download | busybox-w32-b1a3cb0d6d3eb3bcd8ef07a7c5f8ef39bd1dbb7f.tar.gz busybox-w32-b1a3cb0d6d3eb3bcd8ef07a7c5f8ef39bd1dbb7f.tar.bz2 busybox-w32-b1a3cb0d6d3eb3bcd8ef07a7c5f8ef39bd1dbb7f.zip | |
win32: add termios.h
Just some declaration enough to build. Proper TTY support may come
later, targeting Cygwin-based terminals.
| -rw-r--r-- | win32/termios.h | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/win32/termios.h b/win32/termios.h new file mode 100644 index 000000000..011a37eb9 --- /dev/null +++ b/win32/termios.h | |||
| @@ -0,0 +1,129 @@ | |||
| 1 | /* iflag bits */ | ||
| 2 | #define IGNBRK 0x00001 | ||
| 3 | #define BRKINT 0x00002 | ||
| 4 | #define IGNPAR 0x00004 | ||
| 5 | #define IMAXBEL 0x00008 | ||
| 6 | #define INPCK 0x00010 | ||
| 7 | #define ISTRIP 0x00020 | ||
| 8 | #define INLCR 0x00040 | ||
| 9 | #define IGNCR 0x00080 | ||
| 10 | #define ICRNL 0x00100 | ||
| 11 | #define IXON 0x00400 | ||
| 12 | #define IXOFF 0x01000 | ||
| 13 | #define IUCLC 0x04000 | ||
| 14 | #define IXANY 0x08000 | ||
| 15 | #define PARMRK 0x10000 | ||
| 16 | |||
| 17 | /* oflag bits */ | ||
| 18 | |||
| 19 | #define OPOST 0x00001 | ||
| 20 | #define OLCUC 0x00002 | ||
| 21 | #define OCRNL 0x00004 | ||
| 22 | #define ONLCR 0x00008 | ||
| 23 | #define ONOCR 0x00010 | ||
| 24 | #define ONLRET 0x00020 | ||
| 25 | #define OFILL 0x00040 | ||
| 26 | #define CRDLY 0x00180 | ||
| 27 | #define CR0 0x00000 | ||
| 28 | #define CR1 0x00080 | ||
| 29 | #define CR2 0x00100 | ||
| 30 | #define CR3 0x00180 | ||
| 31 | #define NLDLY 0x00200 | ||
| 32 | #define NL0 0x00000 | ||
| 33 | #define NL1 0x00200 | ||
| 34 | #define BSDLY 0x00400 | ||
| 35 | #define BS0 0x00000 | ||
| 36 | #define BS1 0x00400 | ||
| 37 | #define TABDLY 0x01800 | ||
| 38 | #define TAB0 0x00000 | ||
| 39 | #define TAB1 0x00800 | ||
| 40 | #define TAB2 0x01000 | ||
| 41 | #define TAB3 0x01800 | ||
| 42 | #define XTABS 0x01800 | ||
| 43 | #define VTDLY 0x02000 | ||
| 44 | #define VT0 0x00000 | ||
| 45 | #define VT1 0x02000 | ||
| 46 | #define FFDLY 0x04000 | ||
| 47 | #define FF0 0x00000 | ||
| 48 | #define FF1 0x04000 | ||
| 49 | #define OFDEL 0x08000 | ||
| 50 | |||
| 51 | /* lflag bits */ | ||
| 52 | #define ISIG 0x0001 | ||
| 53 | #define ICANON 0x0002 | ||
| 54 | #define ECHO 0x0004 | ||
| 55 | #define ECHOE 0x0008 | ||
| 56 | #define ECHOK 0x0010 | ||
| 57 | #define ECHONL 0x0020 | ||
| 58 | #define NOFLSH 0x0040 | ||
| 59 | #define TOSTOP 0x0080 | ||
| 60 | #define IEXTEN 0x0100 | ||
| 61 | #define FLUSHO 0x0200 | ||
| 62 | #define ECHOKE 0x0400 | ||
| 63 | #define ECHOCTL 0x0800 | ||
| 64 | |||
| 65 | #define VDISCARD 1 | ||
| 66 | #define VEOL 2 | ||
| 67 | #define VEOL2 3 | ||
| 68 | #define VEOF 4 | ||
| 69 | #define VERASE 5 | ||
| 70 | #define VINTR 6 | ||
| 71 | #define VKILL 7 | ||
| 72 | #define VLNEXT 8 | ||
| 73 | #define VMIN 9 | ||
| 74 | #define VQUIT 10 | ||
| 75 | #define VREPRINT 11 | ||
| 76 | #define VSTART 12 | ||
| 77 | #define VSTOP 13 | ||
| 78 | #define VSUSP 14 | ||
| 79 | #define VSWTC 15 | ||
| 80 | #define VTIME 16 | ||
| 81 | #define VWERASE 17 | ||
| 82 | |||
| 83 | #define TCIFLUSH 0 | ||
| 84 | #define TCSAFLUSH 1 | ||
| 85 | #define TCSANOW 2 | ||
| 86 | #define TCSADRAIN 3 | ||
| 87 | #define TCSADFLUSH 4 | ||
| 88 | |||
| 89 | #define B0 0000000 /* hang up */ | ||
| 90 | #define B50 0000001 | ||
| 91 | #define B75 0000002 | ||
| 92 | #define B110 0000003 | ||
| 93 | #define B134 0000004 | ||
| 94 | #define B150 0000005 | ||
| 95 | #define B200 0000006 | ||
| 96 | #define B300 0000007 | ||
| 97 | #define B600 0000010 | ||
| 98 | #define B1200 0000011 | ||
| 99 | #define B1800 0000012 | ||
| 100 | #define B2400 0000013 | ||
| 101 | #define B4800 0000014 | ||
| 102 | #define B9600 0000015 | ||
| 103 | |||
| 104 | typedef unsigned char cc_t; | ||
| 105 | typedef unsigned int tcflag_t; | ||
| 106 | typedef unsigned int speed_t; | ||
| 107 | typedef unsigned short otcflag_t; | ||
| 108 | typedef unsigned char ospeed_t; | ||
| 109 | |||
| 110 | #define NCCS 18 | ||
| 111 | struct termios { | ||
| 112 | tcflag_t c_iflag; | ||
| 113 | tcflag_t c_oflag; | ||
| 114 | tcflag_t c_cflag; | ||
| 115 | tcflag_t c_lflag; | ||
| 116 | char c_line; | ||
| 117 | cc_t c_cc[NCCS]; | ||
| 118 | speed_t c_ispeed; | ||
| 119 | speed_t c_ospeed; | ||
| 120 | }; | ||
| 121 | |||
| 122 | struct winsize { | ||
| 123 | unsigned short ws_row, ws_col; | ||
| 124 | unsigned short ws_xpixel, ws_ypixel; | ||
| 125 | }; | ||
| 126 | |||
| 127 | int tcflush(int fd, int queue_selector); | ||
| 128 | int tcgetattr(int fd, struct termios *t); | ||
| 129 | int tcsetattr(int fd, int mode, const struct termios *t); | ||
