Annotation of embedaddon/ntp/ports/winnt/include/win32_io.h, revision 1.1.1.1
1.1 misho 1: #ifndef WIN32_IO_H
2: #define WIN32_IO_H
3:
4: /* Flag definitions for compatibility
5: * ==================================
6: */
7:
8: #include <fcntl.h>
9:
10: #define NCCS 18 /* refclock_arc.c uses VTIME (17) */
11: #define VEOL 3
12: typedef unsigned char cc_t;
13: typedef unsigned int speed_t;
14: typedef unsigned int tcflag_t;
15:
16: struct termios
17: {
18: tcflag_t c_iflag; /* input mode flags */
19: tcflag_t c_oflag; /* output mode flags */
20: tcflag_t c_cflag; /* control mode flags */
21: tcflag_t c_lflag; /* local mode flags */
22: cc_t c_line; /* line discipline */
23: cc_t c_cc[NCCS]; /* control characters */
24: speed_t c_ispeed; /* input speed */
25: speed_t c_ospeed; /* output speed */
26: };
27:
28: /* c_cc characters
29: #define VINTR 0
30: #define VQUIT 1
31: #define VERASE 2
32: #define VKILL 3
33: #define VEOF 4
34: #define VTIME 5
35: #define VMIN 6
36: #define VSWTC 7
37: #define VSTART 8
38: #define VSTOP 9
39: #define VSUSP 10
40: #define VEOL 11
41: #define VREPRINT 12
42: #define VDISCARD 13
43: #define VWERASE 14
44: #define VLNEXT 15
45: #define VEOL2 16
46: */
47:
48: /* c_iflag bits */
49: #define IGNBRK 0000001
50: #define BRKINT 0000002
51: #define IGNPAR 0000004
52: #define PARMRK 0000010
53: #define INPCK 0000020
54: #define ISTRIP 0000040
55: #define INLCR 0000100
56: #define IGNCR 0000200
57: #define ICRNL 0000400
58: #define IUCLC 0001000
59: #define IXON 0002000
60: #define IXANY 0004000
61: #define IXOFF 0010000
62: #define IMAXBEL 0020000
63:
64: /* c_oflag bits */
65: #define OPOST 0000001
66: #define OLCUC 0000002
67: #define ONLCR 0000004
68: #define OCRNL 0000010
69: #define ONOCR 0000020
70: #define ONLRET 0000040
71: #define OFILL 0000100
72: #define OFDEL 0000200
73:
74: #define NLDLY 0000400
75: #define NL0 0000000
76: #define NL1 0000400
77:
78: #define CRDLY 0003000
79: #define CR0 0000000
80: #define CR1 0001000
81: #define CR2 0002000
82: #define CR3 0003000
83:
84: #define TABDLY 0014000
85: #define TAB0 0000000
86: #define TAB1 0004000
87: #define TAB2 0010000
88: #define TAB3 0014000
89: #define XTABS 0014000
90:
91: #define BSDLY 0020000
92: #define BS0 0000000
93: #define BS1 0020000
94:
95: #define VTDLY 0040000
96: #define VT0 0000000
97: #define VT1 0040000
98:
99: #define FFDLY 0100000
100: #define FF0 0000000
101: #define FF1 0100000
102:
103: /* c_cflag bit meaning */
104: #define CBAUD 0010017
105: #define B0 0000000 /* hang up */
106: #define B50 0000001
107: #define B75 0000002
108: #define B110 0000003
109: #define B134 0000004
110: #define B150 0000005
111: #define B200 0000006
112: #define B300 0000007
113: #define B600 0000010
114: #define B1200 0000011
115: #define B1800 0000012
116: #define B2400 0000013
117: #define B4800 0000014
118: #define B9600 0000015
119: #define B19200 0000016
120: #define B38400 0000017
121:
122: #define EXTA B19200
123: #define EXTB B38400
124:
125: #define CSIZE 0000060
126: #define CS5 0000000
127: #define CS6 0000020
128: #define CS7 0000040
129: #define CS8 0000060
130:
131: #define CSTOPB 0000100
132: #define CREAD 0000200
133: #define PARENB 0000400
134: #define PARODD 0001000
135: #define HUPCL 0002000
136: #define CLOCAL 0004000
137:
138: #define CBAUDEX 0010000
139: #define B57600 0010001
140: #define B115200 0010002
141: #define B230400 0010003
142: #define B460800 0010004
143:
144: #define CIBAUD 002003600000 /* input baud rate (not used) */
145: #define CRTSCTS 020000000000 /* flow control */
146:
147: /* c_lflag bits */
148: #define ISIG 0000001
149: #define ICANON 0000002
150: #define XCASE 0000004
151: #define ECHO 0000010
152: #define ECHOE 0000020
153: #define ECHOK 0000040
154: #define ECHONL 0000100
155: #define NOFLSH 0000200
156: #define TOSTOP 0000400
157: #define ECHOCTL 0001000
158: #define ECHOPRT 0002000
159: #define ECHOKE 0004000
160: #define FLUSHO 0010000
161: #define PENDIN 0040000
162: #define IEXTEN 0100000
163:
164: /* tcflow() and TCXONC use these */
165: #define TCOOFF 0
166: #define TCOON 1
167: #define TCIOFF 2
168: #define TCION 3
169:
170: /* tcflush() and TCFLSH use these */
171: #define TCIFLUSH 0
172: #define TCOFLUSH 1
173: #define TCIOFLUSH 2
174:
175: /* tcsetattr uses these */
176: #define TCSANOW 0
177: #define TCSADRAIN 1
178: #define TCSAFLUSH 2
179: #define VMIN 16
180: #define VTIME 17
181:
182: /* modem lines */
183: #define TIOCM_LE 0x001
184: #define TIOCM_DTR 0x002
185: #define TIOCM_RTS 0x004
186: #define TIOCM_ST 0x008
187: #define TIOCM_SR 0x010
188: #define TIOCM_CTS 0x020
189: #define TIOCM_CAR 0x040
190: #define TIOCM_RNG 0x080
191: #define TIOCM_DSR 0x100
192: #define TIOCM_CD TIOCM_CAR
193: #define TIOCM_RI TIOCM_RNG
194: #define TIOCM_OUT1 0x2000
195: #define TIOCM_OUT2 0x4000
196:
197: /* ioctl */
198: #define TIOCMGET 0x5415
199: #define TIOCMSET 0x5418
200:
201: /* NOP cfsetospeed() and cfsetispeed() for now */
202: #define cfsetospeed(dcb, spd) (0)
203: #define cfsetispeed(dcb, spd) (0)
204:
205:
206:
207: #if 0
208: extern BOOL TTY_GETATTR (int fd, DCB *tio);
209: extern BOOL TTY_SETATTR (int fd, const DCB *tio);
210: #endif
211:
212: extern int ioctl (int, int, int *);
213: extern int tcsetattr (int, int, const struct termios *);
214: extern int tcgetattr (int, struct termios *);
215:
216: #endif /* defined WIN32_IO_H */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>