129088Smarkm/* 229088Smarkm * Copyright (c) 1988, 1993 329088Smarkm * The Regents of the University of California. All rights reserved. 429088Smarkm * 529088Smarkm * Redistribution and use in source and binary forms, with or without 629088Smarkm * modification, are permitted provided that the following conditions 729088Smarkm * are met: 829088Smarkm * 1. Redistributions of source code must retain the above copyright 929088Smarkm * notice, this list of conditions and the following disclaimer. 1029088Smarkm * 2. Redistributions in binary form must reproduce the above copyright 1129088Smarkm * notice, this list of conditions and the following disclaimer in the 1229088Smarkm * documentation and/or other materials provided with the distribution. 1329088Smarkm * 3. All advertising materials mentioning features or use of this software 1429088Smarkm * must display the following acknowledgement: 1529088Smarkm * This product includes software developed by the University of 1629088Smarkm * California, Berkeley and its contributors. 1729088Smarkm * 4. Neither the name of the University nor the names of its contributors 1829088Smarkm * may be used to endorse or promote products derived from this software 1929088Smarkm * without specific prior written permission. 2029088Smarkm * 2129088Smarkm * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2229088Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2329088Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2429088Smarkm * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2529088Smarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2629088Smarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2729088Smarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2829088Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2929088Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3029088Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3129088Smarkm * SUCH DAMAGE. 3229088Smarkm * 3329088Smarkm * @(#)defines.h 8.1 (Berkeley) 6/6/93 3487139Smarkm * $FreeBSD$ 3529088Smarkm */ 3629088Smarkm 3729088Smarkm#define settimer(x) clocks.x = clocks.system++ 3829088Smarkm 3929088Smarkm#define NETADD(c) { *netoring.supply = c; ring_supplied(&netoring, 1); } 4029088Smarkm#define NET2ADD(c1,c2) { NETADD(c1); NETADD(c2); } 4129088Smarkm#define NETBYTES() (ring_full_count(&netoring)) 4229088Smarkm#define NETROOM() (ring_empty_count(&netoring)) 4329088Smarkm 4429088Smarkm#define TTYADD(c) if (!(SYNCHing||flushout)) { \ 4529088Smarkm *ttyoring.supply = c; \ 4629088Smarkm ring_supplied(&ttyoring, 1); \ 4729088Smarkm } 4829088Smarkm#define TTYBYTES() (ring_full_count(&ttyoring)) 4929088Smarkm#define TTYROOM() (ring_empty_count(&ttyoring)) 5029088Smarkm 5129088Smarkm/* Various modes */ 5229088Smarkm#define MODE_LOCAL_CHARS(m) ((m)&(MODE_EDIT|MODE_TRAPSIG)) 5329088Smarkm#define MODE_LOCAL_ECHO(m) ((m)&MODE_ECHO) 5429088Smarkm#define MODE_COMMAND_LINE(m) ((m)==-1) 5529088Smarkm 5629088Smarkm#define CONTROL(x) ((x)&0x1f) /* CTRL(x) is not portable */ 57