2 |
7u83 |
1 |
# Crown Copyright (c) 1997
|
|
|
2 |
#
|
|
|
3 |
# This TenDRA(r) Computer Program is subject to Copyright
|
|
|
4 |
# owned by the United Kingdom Secretary of State for Defence
|
|
|
5 |
# acting through the Defence Evaluation and Research Agency
|
|
|
6 |
# (DERA). It is made available to Recipients with a
|
|
|
7 |
# royalty-free licence for its use, reproduction, transfer
|
|
|
8 |
# to other parties and amendment for any purpose not excluding
|
|
|
9 |
# product development provided that any such use et cetera
|
|
|
10 |
# shall be deemed to be acceptance of the following conditions:-
|
|
|
11 |
#
|
|
|
12 |
# (1) Its Recipients shall ensure that this Notice is
|
|
|
13 |
# reproduced upon any copies or amended versions of it;
|
|
|
14 |
#
|
|
|
15 |
# (2) Any amended version of it shall be clearly marked to
|
|
|
16 |
# show both the nature of and the organisation responsible
|
|
|
17 |
# for the relevant amendment or amendments;
|
|
|
18 |
#
|
|
|
19 |
# (3) Its onward transfer from a recipient to another
|
|
|
20 |
# party shall be deemed to be that party's acceptance of
|
|
|
21 |
# these conditions;
|
|
|
22 |
#
|
|
|
23 |
# (4) DERA gives no warranty or assurance as to its
|
|
|
24 |
# quality or suitability for any purpose and DERA accepts
|
|
|
25 |
# no liability whatsoever in relation to any use to which
|
|
|
26 |
# it may be put.
|
|
|
27 |
#
|
|
|
28 |
+USE "posix", "sys/types.h", "pid_t" ;
|
|
|
29 |
|
|
|
30 |
+TYPE ( unsigned ) cc_t, ( unsigned ) speed_t, ( unsigned ) tcflag_t ;
|
|
|
31 |
|
|
|
32 |
+TYPE struct termios ;
|
|
|
33 |
+CONST int NCCS | NCCS_EXP ;
|
|
|
34 |
+NAT ~NCCS | NCCS ;
|
|
|
35 |
+FIELD struct termios {
|
|
|
36 |
tcflag_t c_iflag ;
|
|
|
37 |
tcflag_t c_oflag ;
|
|
|
38 |
tcflag_t c_cflag ;
|
|
|
39 |
tcflag_t c_lflag ;
|
|
|
40 |
cc_t c_cc [ ~NCCS ] ;
|
|
|
41 |
} ;
|
|
|
42 |
|
|
|
43 |
+CONST int VEOF, VEOL, VERASE, VINTR, VKILL, VMIN, VQUIT ;
|
|
|
44 |
+CONST int VSTART, VSTOP, VSUSP, VTIME ;
|
|
|
45 |
|
|
|
46 |
+CONST tcflag_t BRKINT, ICRNL, IGNBRK, IGNCR, IGNPAR, INLCR ;
|
|
|
47 |
+CONST tcflag_t INPCK, ISTRIP, IUCLC, IXANY, IXOFF, IXON, PARMRK ;
|
|
|
48 |
|
|
|
49 |
+CONST tcflag_t OPOST, OLCUC, ONLCR, OCRNL, ONOCR, ONLRET ;
|
|
|
50 |
+CONST tcflag_t OFILL, NLDLY, CRDLY, TABDLY, BSDLY, VTDLY, FFDLY ;
|
|
|
51 |
|
|
|
52 |
+CONST int NL0, NL1, CR0, CR1, CR2, CR3, TAB0, TAB1, TAB2, TAB3 ;
|
|
|
53 |
+CONST int BS0, BS1, VT0, VT1, FF0, FF1 ;
|
|
|
54 |
|
|
|
55 |
+CONST speed_t B0, B50, B75, B110, B134, B150, B200, B300, B600 ;
|
|
|
56 |
+CONST speed_t B1200, B1800, B2400, B4800, B9600, B19200, B38400 ;
|
|
|
57 |
|
|
|
58 |
+CONST tcflag_t CSIZE, CSTOPB, CREAD, PARENB ;
|
|
|
59 |
+CONST tcflag_t PARODD, HUPCL, CLOCAL ;
|
|
|
60 |
|
|
|
61 |
+CONST int CS5, CS6, CS7, CS8 ;
|
|
|
62 |
|
|
|
63 |
+CONST tcflag_t ECHO, ECHOE, ECHOK, ECHONL, ICANON ;
|
|
|
64 |
+CONST tcflag_t IEXTEN, ISIG, NOFLSH, TOSTOP, XCASE ;
|
|
|
65 |
|
|
|
66 |
+CONST int TCSANOW, TCSADRAIN, TCSAFLUSH ;
|
|
|
67 |
+CONST int TCIFLUSH, TCOFLUSH, TCIOFLUSH ;
|
|
|
68 |
+CONST int TCIOFF, TCION, TCOOFF, TCOON ;
|
|
|
69 |
|
|
|
70 |
+FUNC speed_t cfgetispeed ( const struct termios * ) ;
|
|
|
71 |
+FUNC speed_t cfgetospeed ( const struct termios * ) ;
|
|
|
72 |
+FUNC int cfsetispeed ( struct termios *, speed_t ) ;
|
|
|
73 |
+FUNC int cfsetospeed ( struct termios *, speed_t ) ;
|
|
|
74 |
+FUNC int tcdrain ( int ) ;
|
|
|
75 |
+FUNC int tcflow ( int, int ) ;
|
|
|
76 |
+FUNC int tcflush ( int, int ) ;
|
|
|
77 |
+FUNC int tcgetattr ( int, struct termios * ) ;
|
|
|
78 |
+FUNC pid_t tcgetsid ( int ) ;
|
|
|
79 |
+FUNC int tcsendbreak ( int, int ) ;
|
|
|
80 |
|
|
|
81 |
# tcsetattr() and <termios.h> pages disagree on 'const', we align with POSIX
|
|
|
82 |
+FUNC int tcsetattr ( int, int, const struct termios * ) ;
|