133685Sbostic /* 233685Sbostic * Copyright (c) 1988 Regents of the University of California. 333685Sbostic * All rights reserved. 433685Sbostic * 533685Sbostic * Redistribution and use in source and binary forms are permitted 6*34898Sbostic * provided that the above copyright notice and this paragraph are 7*34898Sbostic * duplicated in all such forms and that any documentation, 8*34898Sbostic * advertising materials, and other materials related to such 9*34898Sbostic * distribution and use acknowledge that the software was developed 10*34898Sbostic * by the University of California, Berkeley. The name of the 11*34898Sbostic * University may not be used to endorse or promote products derived 12*34898Sbostic * from this software without specific prior written permission. 13*34898Sbostic * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14*34898Sbostic * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15*34898Sbostic * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 1633685Sbostic * 17*34898Sbostic * @(#)defines.h 1.6 (Berkeley) 06/29/88 1833685Sbostic */ 1933685Sbostic 2032140Sminshall #define settimer(x) clocks.x = clocks.system++ 2132140Sminshall 2232140Sminshall #if !defined(TN3270) 2332140Sminshall 2432381Sminshall #define ExitString(s,r) { fprintf(stderr, s); exit(r); } 2532140Sminshall #define Exit(x) exit(x) 2632140Sminshall #define SetIn3270() 2732140Sminshall 2832140Sminshall #endif /* !defined(TN3270) */ 2932140Sminshall 3032528Sminshall #define NETADD(c) { *netoring.supply = c; ring_supplied(&netoring, 1); } 3132140Sminshall #define NET2ADD(c1,c2) { NETADD(c1); NETADD(c2); } 3232528Sminshall #define NETBYTES() (ring_full_count(&netoring)) 3332381Sminshall #define NETROOM() (ring_empty_count(&netoring)) 3432140Sminshall 3532381Sminshall #define TTYADD(c) if (!(SYNCHing||flushout)) { \ 3632528Sminshall *ttyoring.supply = c; \ 3732528Sminshall ring_supplied(&ttyoring, 1); \ 3832381Sminshall } 3932528Sminshall #define TTYBYTES() (ring_full_count(&ttyoring)) 4032381Sminshall #define TTYROOM() (ring_empty_count(&ttyoring)) 4132140Sminshall 4232140Sminshall /* Various modes */ 4332140Sminshall #define MODE_LINE(m) (modelist[m].modetype & LINE) 4432140Sminshall #define MODE_LOCAL_CHARS(m) (modelist[m].modetype & LOCAL_CHARS) 4532140Sminshall #define MODE_LOCAL_ECHO(m) (modelist[m].modetype & LOCAL_ECHO) 4632140Sminshall #define MODE_COMMAND_LINE(m) (modelist[m].modetype & COMMAND_LINE) 4732140Sminshall 4832140Sminshall #define LOCAL_CHARS 0x01 /* Characters processed locally */ 4932140Sminshall #define LINE 0x02 /* Line-by-line mode of operation */ 5032140Sminshall #define LOCAL_ECHO 0x04 /* Echoing locally */ 5132140Sminshall #define COMMAND_LINE 0x08 /* Command line mode */ 52