first cut at new makefile; file reorg, new depend
[unix-history] / usr / src / usr.bin / telnet / defines.h
index 6d09474..4957c73 100644 (file)
@@ -1,26 +1,41 @@
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)defines.h   1.7 (Berkeley) %G%
+ */
+
 #define        settimer(x)     clocks.x = clocks.system++
 
 #if    !defined(TN3270)
 
 #define        settimer(x)     clocks.x = clocks.system++
 
 #if    !defined(TN3270)
 
-#define        ExitString(f,s,r)       { fprintf(f, s); exit(r); }
-#define        Exit(x)                 exit(x)
 #define        SetIn3270()
 
 #endif /* !defined(TN3270) */
 
 #define        SetIn3270()
 
 #endif /* !defined(TN3270) */
 
-#define        NETADD(c)       { *nfrontp++ = c; }
+#define        NETADD(c)       { *netoring.supply = c; ring_supplied(&netoring, 1); }
 #define        NET2ADD(c1,c2)  { NETADD(c1); NETADD(c2); }
 #define        NET2ADD(c1,c2)  { NETADD(c1); NETADD(c2); }
-#define NETLOC()       (nfrontp)
-#define        NETMAX()        (netobuf+sizeof netobuf-1)
-#define        NETBYTES()      (nfrontp-nbackp)
-#define        NETROOM()       (NETMAX()-NETLOC()+1)
-
-#define        TTYADD(c)       { if (!(SYNCHing||flushout)) { *tfrontp++ = c; } }
-#define        TTYLOC()        (tfrontp)
-#define        TTYMAX()        (ttyobuf+sizeof ttyobuf-1)
-#define        TTYMIN()        (netobuf)
-#define        TTYBYTES()      (tfrontp-tbackp)
-#define        TTYROOM()       (TTYMAX()-TTYLOC()+1)
+#define        NETBYTES()      (ring_full_count(&netoring))
+#define        NETROOM()       (ring_empty_count(&netoring))
+
+#define        TTYADD(c)       if (!(SYNCHing||flushout)) { \
+                               *ttyoring.supply = c; \
+                               ring_supplied(&ttyoring, 1); \
+                       }
+#define        TTYBYTES()      (ring_full_count(&ttyoring))
+#define        TTYROOM()       (ring_empty_count(&ttyoring))
 
 /*     Various modes */
 #define        MODE_LINE(m)    (modelist[m].modetype & LINE)
 
 /*     Various modes */
 #define        MODE_LINE(m)    (modelist[m].modetype & LINE)