changes in define macros and switches, improved piping support
[ust.git] / config.def.h
1 /* software buffers */
2 const size_t wbuffsz = 1024;
3 const size_t rbuffsz = 1024;
4
5 /* scratch-pads for input processing */
6 const size_t scratchwsz = 256;
7 const size_t scratchrsz = 256;
8
9 /* `nanosleep()` values inside the read and write loops */
10 const long swritedelay = 0; /* seconds */
11 const long nswritedelay = 1000000; /* nanoseconds */
12
13 /* other names follow the same logic as above */
14
15 const long sreaddelay = 0;
16 const long nsreaddelay = 1000000;
17
18 /* `nanosleep()` values for the DTR pulse */
19 const long spulsedelay = 0;
20 const long nspulsedelay = 1000000;
21
22 /* lock the opened device */
23 const int exclusive = 1; /*(0|1)*/
24
25 /* escape character for interactive use */
26 const char escapechar = '~';
27
28 /* print additional info to stderr */
29 int verbose = 0; /*(0|1)*/
30
31 /* exit timeout after piped ust reaches EOF */
32 long stimeout = 0;
33 long nstimeout = 1000;
34
35 /*
36 * device name
37 *
38 * Linux:
39 * ttyS* - any standard serial port
40 * ttyUSB* - any USB serial port
41 *
42 * FreeBSD:
43 * cuau* - does not wait for DCD
44 * ttyu* - 'dial-in' device, waits for DCD
45 * cuaU* - USB variant
46 * ttyU* - USB variant
47 *
48 * OpenBSD:
49 * cua* - does not wait for DCD
50 * tty* - 'dial-in' device, waits for DCD
51 * cuaU* - USB variant
52 * ttyU* - USB variant
53 *
54 * NetBSD:
55 * dty* - opening does not block, does not wait for DCD
56 * tty* - 'dial-in' device, blocks opening until a connection is established
57 * ttyU* - USB variant
58 */
59 char line[16] = "/dev/cuau0";
60
61 /*
62 * baud is usually configurable to standard values only,
63 * custom speed requires both hardware and driver support
64 */
65 unsigned int ispeed = 9600;
66 unsigned int ospeed = 9600;
67
68 /*
69 * data bits: can be 8,7,6 or 5.
70 * 9 is not supported
71 */
72 char datab = '8';
73
74 /*
75 * stop bits: setting this to 1 enables 2 stop bits for all numbers of data bits
76 * except 5 - it's 1.5 in that case
77 */
78 int stopb = 0; /*(0|1)*/
79
80 /*
81 * local echo (half-duplex mode) and canonical mode
82 */
83 int half = 0; /*(0|1)*/
84 int canonical = 0; /*(0|1)*/
85
86
87 /*
88 * CR and LF (NL) translation options
89 */
90 CRLFOpt tropts = { 0 };
91 CRLFOpt itropts = { 0 };
92
93 /*
94 * backspace: setting to one makes `^H` the backspace character, `^?` otherwise
95 */
96 int backspace = 0; /*(0|1)*/
97
98 /*
99 * the minimum of characters input before sending them to the line
100 */
101 int minchars = 1; /*(>=1)*/
102
103 /*
104 * delay between single characters being sent if the buffer has
105 * more than 1 (redirected stdin, writing a file)
106 * in nanoseconds
107 */
108 long chardelay = 0;
109
110 /*
111 * XON/XOFF flow control
112 * can be enabled with hardware flow control simultaneously
113 */
114 int soft = 0; /*(0|1)*/
115
116 /*
117 * hardware flow control
118 * 1 - RTS/CTS
119 * 2 - DTR/DSR (not supported on some platforms)
120 * 3 - DCD
121 */
122 int hard = 0; /*(0|1|2|3)*/
123
124 /*
125 * 1 - even
126 * 2 - odd
127 */
128 int parity = 0; /*(0|1|2)*/