xref: /csrg-svn/usr.bin/telnet/defines.h (revision 33685)
1*33685Sbostic /*
2*33685Sbostic  * Copyright (c) 1988 Regents of the University of California.
3*33685Sbostic  * All rights reserved.
4*33685Sbostic  *
5*33685Sbostic  * Redistribution and use in source and binary forms are permitted
6*33685Sbostic  * provided that this notice is preserved and that due credit is given
7*33685Sbostic  * to the University of California at Berkeley. The name of the University
8*33685Sbostic  * may not be used to endorse or promote products derived from this
9*33685Sbostic  * software without specific prior written permission. This software
10*33685Sbostic  * is provided ``as is'' without express or implied warranty.
11*33685Sbostic  *
12*33685Sbostic  *	@(#)defines.h	1.5 (Berkeley) 03/08/88
13*33685Sbostic  */
14*33685Sbostic 
1532140Sminshall #define	settimer(x)	clocks.x = clocks.system++
1632140Sminshall 
1732140Sminshall #if	!defined(TN3270)
1832140Sminshall 
1932381Sminshall #define	ExitString(s,r)	{ fprintf(stderr, s); exit(r); }
2032140Sminshall #define	Exit(x)			exit(x)
2132140Sminshall #define	SetIn3270()
2232140Sminshall 
2332140Sminshall #endif	/* !defined(TN3270) */
2432140Sminshall 
2532528Sminshall #define	NETADD(c)	{ *netoring.supply = c; ring_supplied(&netoring, 1); }
2632140Sminshall #define	NET2ADD(c1,c2)	{ NETADD(c1); NETADD(c2); }
2732528Sminshall #define	NETBYTES()	(ring_full_count(&netoring))
2832381Sminshall #define	NETROOM()	(ring_empty_count(&netoring))
2932140Sminshall 
3032381Sminshall #define	TTYADD(c)	if (!(SYNCHing||flushout)) { \
3132528Sminshall 				*ttyoring.supply = c; \
3232528Sminshall 				ring_supplied(&ttyoring, 1); \
3332381Sminshall 			}
3432528Sminshall #define	TTYBYTES()	(ring_full_count(&ttyoring))
3532381Sminshall #define	TTYROOM()	(ring_empty_count(&ttyoring))
3632140Sminshall 
3732140Sminshall /*	Various modes */
3832140Sminshall #define	MODE_LINE(m)	(modelist[m].modetype & LINE)
3932140Sminshall #define	MODE_LOCAL_CHARS(m)	(modelist[m].modetype &  LOCAL_CHARS)
4032140Sminshall #define	MODE_LOCAL_ECHO(m)	(modelist[m].modetype & LOCAL_ECHO)
4132140Sminshall #define	MODE_COMMAND_LINE(m)	(modelist[m].modetype & COMMAND_LINE)
4232140Sminshall 
4332140Sminshall #define	LOCAL_CHARS	0x01		/* Characters processed locally */
4432140Sminshall #define	LINE		0x02		/* Line-by-line mode of operation */
4532140Sminshall #define	LOCAL_ECHO	0x04		/* Echoing locally */
4632140Sminshall #define	COMMAND_LINE	0x08		/* Command line mode */
47