1 |
#ifndef INIT_H_ |
2 |
#define INIT_H_ |
3 |
|
4 |
#undef CERASE /* TODO */ |
5 |
#define CERASE '\010' /* ^H */ |
6 |
|
7 |
#ifdef HAVE_XSETLOCALE |
8 |
# define X_LOCALE |
9 |
# include <X11/Xlocale.h> |
10 |
#else |
11 |
# ifdef HAVE_SETLOCALE |
12 |
# include <clocale> |
13 |
# endif |
14 |
#endif /* HAVE_XLOCALE */ |
15 |
|
16 |
#ifdef TTY_GID_SUPPORT |
17 |
# include <grp.h> |
18 |
#endif |
19 |
|
20 |
/* ways to deal with getting/setting termios structure */ |
21 |
|
22 |
/* termios interface */ |
23 |
#define GET_TERMIOS(fd,tios) tcgetattr (fd, tios) |
24 |
#define SET_TERMIOS(fd,tios) \ |
25 |
cfsetospeed (tios, BAUDRATE), \ |
26 |
cfsetispeed (tios, BAUDRATE), \ |
27 |
tcsetattr (fd, TCSANOW, tios) |
28 |
|
29 |
/* use the fastest baud-rate */ |
30 |
#ifdef B38400 |
31 |
# define BAUDRATE B38400 |
32 |
#else |
33 |
# ifdef B19200 |
34 |
# define BAUDRATE B19200 |
35 |
# else |
36 |
# define BAUDRATE B9600 |
37 |
# endif |
38 |
#endif |
39 |
|
40 |
/* Disable special character functions */ |
41 |
#ifdef _POSIX_VDISABLE |
42 |
# define VDISABLE _POSIX_VDISABLE |
43 |
#else |
44 |
# define VDISABLE 255 |
45 |
#endif |
46 |
|
47 |
/*----------------------------------------------------------------------* |
48 |
* system default characters if defined and reasonable |
49 |
*/ |
50 |
#ifndef CINTR |
51 |
# define CINTR '\003' /* ^C */ |
52 |
#endif |
53 |
#ifndef CQUIT |
54 |
# define CQUIT '\034' /* ^\ */ |
55 |
#endif |
56 |
#ifndef CERASE |
57 |
# ifdef linux |
58 |
# define CERASE '\177' /* ^? */ |
59 |
# else |
60 |
# define CERASE '\010' /* ^H */ |
61 |
# endif |
62 |
#endif |
63 |
#ifndef CKILL |
64 |
# define CKILL '\025' /* ^U */ |
65 |
#endif |
66 |
#ifndef CEOF |
67 |
# define CEOF '\004' /* ^D */ |
68 |
#endif |
69 |
#ifndef CSTART |
70 |
# define CSTART '\021' /* ^Q */ |
71 |
#endif |
72 |
#ifndef CSTOP |
73 |
# define CSTOP '\023' /* ^S */ |
74 |
#endif |
75 |
#ifndef CSUSP |
76 |
# define CSUSP '\032' /* ^Z */ |
77 |
#endif |
78 |
#ifndef CDSUSP |
79 |
# define CDSUSP '\031' /* ^Y */ |
80 |
#endif |
81 |
#ifndef CRPRNT |
82 |
# define CRPRNT '\022' /* ^R */ |
83 |
#endif |
84 |
#ifndef CFLUSH |
85 |
# define CFLUSH '\017' /* ^O */ |
86 |
#endif |
87 |
#ifndef CWERASE |
88 |
# define CWERASE '\027' /* ^W */ |
89 |
#endif |
90 |
#ifndef CLNEXT |
91 |
# define CLNEXT '\026' /* ^V */ |
92 |
#endif |
93 |
|
94 |
#ifndef VDISCRD |
95 |
# ifdef VDISCARD |
96 |
# define VDISCRD VDISCARD |
97 |
# endif |
98 |
#endif |
99 |
|
100 |
#ifndef VWERSE |
101 |
# ifdef VWERASE |
102 |
# define VWERSE VWERASE |
103 |
# endif |
104 |
#endif |
105 |
|
106 |
#ifndef O_NOCTTY |
107 |
# define O_NOCTTY 0 |
108 |
#endif |
109 |
#ifndef ONLCR |
110 |
# define ONLCR 0 |
111 |
#endif |
112 |
|
113 |
#define CONSOLE "/dev/console" /* console device */ |
114 |
|
115 |
#endif /* _INIT_H_ */ |