add Berkeley specific copyright
[unix-history] / usr / src / usr.bin / telnet / defines.h
CommitLineData
897ce52e
KB
1/*
2 * Copyright (c) 1988 Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are permitted
6 * provided that this notice is preserved and that due credit is given
7 * to the University of California at Berkeley. The name of the University
8 * may not be used to endorse or promote products derived from this
9 * software without specific prior written permission. This software
10 * is provided ``as is'' without express or implied warranty.
11 *
12 * @(#)defines.h 1.5 (Berkeley) %G%
13 */
14
46e39dfe
GM
15#define settimer(x) clocks.x = clocks.system++
16
17#if !defined(TN3270)
18
115a5494 19#define ExitString(s,r) { fprintf(stderr, s); exit(r); }
46e39dfe
GM
20#define Exit(x) exit(x)
21#define SetIn3270()
22
23#endif /* !defined(TN3270) */
24
8b6750f5 25#define NETADD(c) { *netoring.supply = c; ring_supplied(&netoring, 1); }
46e39dfe 26#define NET2ADD(c1,c2) { NETADD(c1); NETADD(c2); }
8b6750f5 27#define NETBYTES() (ring_full_count(&netoring))
115a5494 28#define NETROOM() (ring_empty_count(&netoring))
46e39dfe 29
115a5494 30#define TTYADD(c) if (!(SYNCHing||flushout)) { \
8b6750f5
GM
31 *ttyoring.supply = c; \
32 ring_supplied(&ttyoring, 1); \
115a5494 33 }
8b6750f5 34#define TTYBYTES() (ring_full_count(&ttyoring))
115a5494 35#define TTYROOM() (ring_empty_count(&ttyoring))
46e39dfe
GM
36
37/* Various modes */
38#define MODE_LINE(m) (modelist[m].modetype & LINE)
39#define MODE_LOCAL_CHARS(m) (modelist[m].modetype & LOCAL_CHARS)
40#define MODE_LOCAL_ECHO(m) (modelist[m].modetype & LOCAL_ECHO)
41#define MODE_COMMAND_LINE(m) (modelist[m].modetype & COMMAND_LINE)
42
43#define LOCAL_CHARS 0x01 /* Characters processed locally */
44#define LINE 0x02 /* Line-by-line mode of operation */
45#define LOCAL_ECHO 0x04 /* Echoing locally */
46#define COMMAND_LINE 0x08 /* Command line mode */