[BACK]Return to tip.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tip

Diff for /src/usr.bin/tip/Attic/tip.c between version 1.18 and 1.19

version 1.18, 2002/05/07 06:56:50 version 1.19, 2002/05/29 22:58:56
Line 56 
Line 56 
 #include "tip.h"  #include "tip.h"
 #include "pathnames.h"  #include "pathnames.h"
   
 /*  
  * Baud rate mapping table  
  */  
 int rates[] = {  
         0, 50, 75, 110, 134, 150, 200, 300, 600,  
         1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, -1  
 };  
   
 int     disc = TTYDISC;         /* tip normally runs this way */  int     disc = TTYDISC;         /* tip normally runs this way */
 void    intprompt();  void    intprompt();
 void    timeout();  void    timeout();
Line 180 
Line 172 
                 PH = _PATH_PHONES;                  PH = _PATH_PHONES;
         vinit();                                /* init variables */          vinit();                                /* init variables */
         setparity("none");                      /* set the parity table */          setparity("none");                      /* set the parity table */
         if ((i = speed(number(value(BAUDRATE)))) == 0) {  
                 printf("%s: bad baud rate %ld\n", __progname,  
                     number(value(BAUDRATE)));  
                 daemon_uid();  
                 (void)uu_unlock(uucplock);  
                 exit(3);  
         }  
   
         /*          /*
          * Hardwired connections require the           * Hardwired connections require the
          *  line speed set before they make any transmissions           *  line speed set before they make any transmissions
          *  (this is particularly true of things like a DF03-AC)           *  (this is particularly true of things like a DF03-AC)
          */           */
         if (HW)          if (HW && ttysetup(number(value(BAUDRATE)))) {
                 ttysetup(i);                  fprintf(stderr, "%s: bad baud rate %ld\n", __progname,
                       number(value(BAUDRATE)));
                   daemon_uid();
                   (void)uu_unlock(uucplock);
                   exit(3);
           }
         if ((p = connect())) {          if ((p = connect())) {
                 printf("\07%s\n[EOT]\n", p);                  printf("\07%s\n[EOT]\n", p);
                 daemon_uid();                  daemon_uid();
                 (void)uu_unlock(uucplock);                  (void)uu_unlock(uucplock);
                 exit(1);                  exit(1);
         }          }
         if (!HW)          if (!HW && ttysetup(number(value(BAUDRATE)))) {
                 ttysetup(i);                  fprintf(stderr, "%s: bad baud rate %ld\n", __progname,
                       number(value(BAUDRATE)));
                   daemon_uid();
                   (void)uu_unlock(uucplock);
                   exit(3);
           }
 cucommon:  cucommon:
         /*          /*
          * From here down the code is shared with           * From here down the code is shared with
Line 446 
Line 441 
 }  }
   
 int  int
 speed(n)  
         int n;  
 {  
         int *p;  
   
         for (p = rates; *p != -1;  p++)  
                 if (*p == n)  
                         return n;  
         return 0;  
 }  
   
 int  
 any(cc, p)  any(cc, p)
         int cc;          int cc;
         char *p;          char *p;
Line 545 
Line 528 
 /*  /*
  * Set up the "remote" tty's state   * Set up the "remote" tty's state
  */   */
 void  int
 ttysetup(speed)  ttysetup(speed)
         int speed;          int speed;
 {  {
         struct termios  cntrl;          struct termios  cntrl;
   
         tcgetattr(FD, &cntrl);          if (tcgetattr(FD, &cntrl))
         cfsetospeed(&cntrl, speed);                  return (-1);
         cfsetispeed(&cntrl, speed);          cfsetspeed(&cntrl, speed);
         cntrl.c_cflag &= ~(CSIZE|PARENB);          cntrl.c_cflag &= ~(CSIZE|PARENB);
         cntrl.c_cflag |= CS8;          cntrl.c_cflag |= CS8;
         if (boolean(value(DC)))          if (boolean(value(DC)))
Line 565 
Line 548 
         cntrl.c_cc[VTIME] = 0;          cntrl.c_cc[VTIME] = 0;
         if (boolean(value(TAND)))          if (boolean(value(TAND)))
                 cntrl.c_iflag |= IXOFF;                  cntrl.c_iflag |= IXOFF;
         tcsetattr(FD, TCSAFLUSH, &cntrl);          return (tcsetattr(FD, TCSAFLUSH, &cntrl));
 }  }
   
 static char partab[0200];  static char partab[0200];

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19