xref: /original-bsd/usr.bin/telnet/defines.h (revision c3e32dec)
1 /*
2  * Copyright (c) 1988, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)defines.h	8.1 (Berkeley) 06/06/93
8  */
9 
10 #define	settimer(x)	clocks.x = clocks.system++
11 
12 #if	!defined(TN3270)
13 
14 #define	SetIn3270()
15 
16 #endif	/* !defined(TN3270) */
17 
18 #define	NETADD(c)	{ *netoring.supply = c; ring_supplied(&netoring, 1); }
19 #define	NET2ADD(c1,c2)	{ NETADD(c1); NETADD(c2); }
20 #define	NETBYTES()	(ring_full_count(&netoring))
21 #define	NETROOM()	(ring_empty_count(&netoring))
22 
23 #define	TTYADD(c)	if (!(SYNCHing||flushout)) { \
24 				*ttyoring.supply = c; \
25 				ring_supplied(&ttyoring, 1); \
26 			}
27 #define	TTYBYTES()	(ring_full_count(&ttyoring))
28 #define	TTYROOM()	(ring_empty_count(&ttyoring))
29 
30 /*	Various modes */
31 #define	MODE_LOCAL_CHARS(m)	((m)&(MODE_EDIT|MODE_TRAPSIG))
32 #define	MODE_LOCAL_ECHO(m)	((m)&MODE_ECHO)
33 #define	MODE_COMMAND_LINE(m)	((m)==-1)
34 
35 #define	CONTROL(x)	((x)&0x1f)		/* CTRL(x) is not portable */
36