Cut down on number of extern's.
authorGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Sat, 26 Sep 1987 07:06:51 +0000 (23:06 -0800)
committerGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Sat, 26 Sep 1987 07:06:51 +0000 (23:06 -0800)
SCCS-vsn: usr.bin/telnet/externs.h 1.2
SCCS-vsn: usr.bin/telnet/network.c 1.2
SCCS-vsn: usr.bin/telnet/terminal.c 1.3
SCCS-vsn: usr.bin/telnet/tn3270.c 1.2

usr/src/usr.bin/telnet/externs.h
usr/src/usr.bin/telnet/network.c
usr/src/usr.bin/telnet/terminal.c
usr/src/usr.bin/telnet/tn3270.c

index fd4e228..712f9f4 100644 (file)
@@ -6,7 +6,6 @@
 extern int errno;              /* outside this world */
 
 extern int
-       SYNCHing,               /* we are in TELNET SYNCH mode */
        flushout,               /* flush output */
        connected,              /* Are we connected to the other side? */
        globalmode,             /* Mode tty should be in */
@@ -15,7 +14,6 @@ extern int
        localchars,             /* we recognize interrupt/quit */
        donelclchars,           /* the user has set "localchars" */
        showoptions,
-       flushline,
        net,
        tin,
        tout,
index 27f5611..95658a3 100644 (file)
@@ -54,6 +54,19 @@ int  s;              /* socket number */
 }
 
 
+/*
+ *  setneturg()
+ *
+ *     Sets "neturg" to the current location.
+ */
+
+void
+setneturg()
+{
+    neturg = NETLOC()-1;       /* Some systems are off by one XXX */
+}
+
+
 /*
  *  netflush
  *             Send as much data as possible to the network,
@@ -170,7 +183,7 @@ char        *current;
  * us in any case.
  */
 
-static void
+void
 netclear()
 {
     register char *thisitem, *next;
@@ -209,82 +222,3 @@ netclear()
     nfrontp = good;            /* next byte to be sent */
     neturg = 0;
 }
-\f
-/*
- * These routines add various telnet commands to the data stream.
- */
-
-void
-xmitAO()
-{
-    NET2ADD(IAC, AO);
-    if (autoflush) {
-       doflush();
-    }
-}
-
-
-void
-xmitEL()
-{
-    NET2ADD(IAC, EL);
-}
-
-void
-xmitEC()
-{
-    NET2ADD(IAC, EC);
-}
-
-
-#if    defined(NOT43)
-int
-#else  /* defined(NOT43) */
-void
-#endif /* defined(NOT43) */
-dosynch()
-{
-    netclear();                        /* clear the path to the network */
-    NET2ADD(IAC, DM);
-    neturg = NETLOC()-1;       /* Some systems are off by one XXX */
-
-#if    defined(NOT43)
-    return 0;
-#endif /* defined(NOT43) */
-}
-
-void
-doflush()
-{
-    NET2ADD(IAC, DO);
-    NETADD(TELOPT_TM);
-    flushline = 1;
-    flushout = 1;
-    ttyflush();
-    /* do printoption AFTER flush, otherwise the output gets tossed... */
-    printoption("<SENT", doopt, TELOPT_TM, 0);
-}
-
-void
-intp()
-{
-    NET2ADD(IAC, IP);
-    if (autoflush) {
-       doflush();
-    }
-    if (autosynch) {
-       dosynch();
-    }
-}
-
-void
-sendbrk()
-{
-    NET2ADD(IAC, BREAK);
-    if (autoflush) {
-       doflush();
-    }
-    if (autosynch) {
-       dosynch();
-    }
-}
index 57354fc..51ef504 100644 (file)
@@ -34,16 +34,17 @@ init_terminal()
 
 
 int
-ttyflush()
+ttyflush(drop)
+int drop;
 {
     int n;
 
     if ((n = tfrontp - tbackp) > 0) {
-       if (!(SYNCHing||flushout)) {
-           n = TerminalWrite(tout, tbackp, n);
-       } else {
+       if (drop) {
            TerminalFlushOutput();
            /* we leave 'n' alone! */
+       } else {
+           n = TerminalWrite(tout, tbackp, n);
        }
     }
     if (n >= 0) {
index ab63062..5f10199 100644 (file)
@@ -75,13 +75,7 @@ inputAvailable()
 void
 outputPurge()
 {
-    int tmp = flushout;
-
-    flushout = 1;
-
-    ttyflush();
-
-    flushout = tmp;
+    ttyflush(1);
 }
 
 
@@ -113,14 +107,14 @@ register int      count;                  /* how much to send */
 
     while (count) {
        if (tfrontp >= ttyobuf+sizeof ttyobuf) {
-           ttyflush();
+           ttyflush(0);
            while (tfrontp >= ttyobuf+sizeof ttyobuf) {
 #if    defined(unix)
                FD_SET(tout, &o);
                (void) select(tout+1, (fd_set *) 0, &o, (fd_set *) 0,
                                                (struct timeval *) 0);
 #endif /* defined(unix) */
-               ttyflush();
+               ttyflush(0);
            }
        }
        *tfrontp++ = *buffer++;
@@ -151,7 +145,7 @@ EmptyTerminal()
 #endif /* defined(unix) */
     } else {
        while (tfrontp != tbackp) {
-           ttyflush();
+           ttyflush(0);
 #if    defined(unix)
            FD_SET(tout, &o);
            (void) select(tout+1, (int *) 0, &o, (int *) 0,