1 | #ifndef INIT_H_ |
1 | #ifndef INIT_H_ |
2 | #define INIT_H_ |
2 | #define INIT_H_ |
3 | |
3 | |
4 | #undef CERASE /* TODO */ |
|
|
5 | #define CERASE '\010' /* ^H */ |
|
|
6 | |
|
|
7 | /* ways to deal with getting/setting termios structure */ |
|
|
8 | |
|
|
9 | /* termios interface */ |
|
|
10 | #define GET_TERMIOS(fd,tios) tcgetattr (fd, tios) |
|
|
11 | #define SET_TERMIOS(fd,tios) \ |
|
|
12 | cfsetospeed (tios, BAUDRATE), \ |
|
|
13 | cfsetispeed (tios, BAUDRATE), \ |
|
|
14 | tcsetattr (fd, TCSANOW, tios) |
|
|
15 | |
|
|
16 | /* use the fastest baud-rate */ |
4 | /* use the fastest baud-rate */ |
|
|
5 | //#if defined(B4000000) |
|
|
6 | //# define BAUDRATE B4000000 |
|
|
7 | //#elif defined(B921600) |
|
|
8 | //# define BAUDRATE B921600 |
|
|
9 | //#elif defined(B115200) |
|
|
10 | //# define BAUDRATE B115200 |
|
|
11 | //#elif defined(B38400) |
17 | #ifdef B38400 |
12 | #if defined(B38400) |
18 | # define BAUDRATE B38400 |
13 | # define BAUDRATE B38400 |
|
|
14 | #elif defined(B19200) |
|
|
15 | # define BAUDRATE B19200 |
19 | #else |
16 | #else |
20 | # ifdef B19200 |
|
|
21 | # define BAUDRATE B19200 |
|
|
22 | # else |
|
|
23 | # define BAUDRATE B9600 |
17 | # define BAUDRATE B9600 |
24 | # endif |
|
|
25 | #endif |
18 | #endif |
26 | |
19 | |
27 | /* Disable special character functions */ |
20 | /* Disable special character functions */ |
28 | #ifdef _POSIX_VDISABLE |
21 | #ifdef _POSIX_VDISABLE |
29 | # define VDISABLE _POSIX_VDISABLE |
22 | # define VDISABLE _POSIX_VDISABLE |
… | |
… | |
39 | #endif |
32 | #endif |
40 | #ifndef CQUIT |
33 | #ifndef CQUIT |
41 | # define CQUIT '\034' /* ^\ */ |
34 | # define CQUIT '\034' /* ^\ */ |
42 | #endif |
35 | #endif |
43 | #ifndef CERASE |
36 | #ifndef CERASE |
44 | # ifdef linux |
37 | # ifdef __linux__ |
45 | # define CERASE '\177' /* ^? */ |
38 | # define CERASE '\177' /* ^? */ |
46 | # else |
39 | # else |
47 | # define CERASE '\010' /* ^H */ |
40 | # define CERASE '\010' /* ^H */ |
48 | # endif |
41 | # endif |
49 | #endif |
42 | #endif |
… | |
… | |
88 | # ifdef VWERASE |
81 | # ifdef VWERASE |
89 | # define VWERSE VWERASE |
82 | # define VWERSE VWERASE |
90 | # endif |
83 | # endif |
91 | #endif |
84 | #endif |
92 | |
85 | |
93 | #ifndef O_NOCTTY |
|
|
94 | # define O_NOCTTY 0 |
|
|
95 | #endif |
|
|
96 | #ifndef ONLCR |
86 | #ifndef ONLCR |
97 | # define ONLCR 0 |
87 | # define ONLCR 0 |
98 | #endif |
88 | #endif |
99 | |
89 | |
100 | #define CONSOLE "/dev/console" /* console device */ |
90 | #define CONSOLE "/dev/console" /* console device */ |
101 | |
91 | |
102 | #endif /* _INIT_H_ */ |
92 | #endif /* _INIT_H_ */ |