157416Smarkm/* 257416Smarkm * Copyright (c) 1988, 1993 357416Smarkm * The Regents of the University of California. All rights reserved. 457416Smarkm * 557416Smarkm * Redistribution and use in source and binary forms, with or without 657416Smarkm * modification, are permitted provided that the following conditions 757416Smarkm * are met: 857416Smarkm * 1. Redistributions of source code must retain the above copyright 957416Smarkm * notice, this list of conditions and the following disclaimer. 1057416Smarkm * 2. Redistributions in binary form must reproduce the above copyright 1157416Smarkm * notice, this list of conditions and the following disclaimer in the 1257416Smarkm * documentation and/or other materials provided with the distribution. 1357416Smarkm * 3. All advertising materials mentioning features or use of this software 1457416Smarkm * must display the following acknowledgement: 1557416Smarkm * This product includes software developed by the University of 1657416Smarkm * California, Berkeley and its contributors. 1757416Smarkm * 4. Neither the name of the University nor the names of its contributors 1857416Smarkm * may be used to endorse or promote products derived from this software 1957416Smarkm * without specific prior written permission. 2057416Smarkm * 2157416Smarkm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2257416Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2357416Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2457416Smarkm * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2557416Smarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2657416Smarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2757416Smarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2857416Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2957416Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3057416Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3157416Smarkm * SUCH DAMAGE. 3257416Smarkm * 3357416Smarkm * @(#)defines.h 8.1 (Berkeley) 6/6/93 3457416Smarkm */ 3557416Smarkm 3657416Smarkm#define settimer(x) clocks.x = clocks.system++ 3757416Smarkm 3857416Smarkm#define NETADD(c) { *netoring.supply = c; ring_supplied(&netoring, 1); } 3957416Smarkm#define NET2ADD(c1,c2) { NETADD(c1); NETADD(c2); } 4057416Smarkm#define NETBYTES() (ring_full_count(&netoring)) 4157416Smarkm#define NETROOM() (ring_empty_count(&netoring)) 4257416Smarkm 4357416Smarkm#define TTYADD(c) if (!(SYNCHing||flushout)) { \ 4457416Smarkm *ttyoring.supply = c; \ 4557416Smarkm ring_supplied(&ttyoring, 1); \ 4657416Smarkm } 4757416Smarkm#define TTYBYTES() (ring_full_count(&ttyoring)) 4857416Smarkm#define TTYROOM() (ring_empty_count(&ttyoring)) 4957416Smarkm 5057416Smarkm/* Various modes */ 5157416Smarkm#define MODE_LOCAL_CHARS(m) ((m)&(MODE_EDIT|MODE_TRAPSIG)) 5257416Smarkm#define MODE_LOCAL_ECHO(m) ((m)&MODE_ECHO) 5357416Smarkm#define MODE_COMMAND_LINE(m) ((m)==-1) 5457416Smarkm 5557416Smarkm#define CONTROL(x) ((x)&0x1f) /* CTRL(x) is not portable */ 5657416Smarkm 5757416Smarkm 5857416Smarkm/* XXX extra mode bits, these should be synced with <arpa/telnet.h> */ 5957416Smarkm 6057416Smarkm#define MODE_OUT8 0x8000 /* binary mode sans -opost */ 61