[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.24 and 1.25

version 1.24, 2004/11/07 09:48:08 version 1.25, 2006/03/16 19:32:46
Line 59 
Line 59 
 char    PNbuf[256];                     /* This limits the size of a number */  char    PNbuf[256];                     /* This limits the size of a number */
   
 int  int
 main(argc, argv)  main(int argc, char *argv[])
         int argc;  
         char *argv[];  
 {  {
         char *system = NOSTR;          char *system = NOSTR, sbuf[12], *p;
         int i;          int i;
         char *p;  
         char sbuf[12];  
   
         gid = getgid();          gid = getgid();
         egid = getegid();          egid = getegid();
Line 182 
Line 178 
                 (void)uu_unlock(uucplock);                  (void)uu_unlock(uucplock);
                 exit(3);                  exit(3);
         }          }
         if ((p = connect())) {          if ((p = con())) {
                 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);
Line 222 
Line 218 
         term.c_cc[VTIME] = 0;          term.c_cc[VTIME] = 0;
         defchars = term;          defchars = term;
         term.c_cc[VINTR] = term.c_cc[VQUIT] = term.c_cc[VSUSP] =          term.c_cc[VINTR] = term.c_cc[VQUIT] = term.c_cc[VSUSP] =
                 term.c_cc[VDSUSP] = term.c_cc[VDISCARD] =              term.c_cc[VDSUSP] = term.c_cc[VDISCARD] =
                 term.c_cc[VLNEXT] = _POSIX_VDISABLE;              term.c_cc[VLNEXT] = _POSIX_VDISABLE;
         raw();          raw();
   
         pipe(fildes); pipe(repdes);          pipe(fildes); pipe(repdes);
Line 273 
Line 269 
 static int uidswapped;  static int uidswapped;
   
 void  void
 user_uid()  user_uid(void)
 {  {
         if (uidswapped == 0) {          if (uidswapped == 0) {
                 seteuid(uid);                  seteuid(uid);
Line 282 
Line 278 
 }  }
   
 void  void
 daemon_uid()  daemon_uid(void)
 {  {
   
         if (uidswapped) {          if (uidswapped) {
Line 292 
Line 288 
 }  }
   
 void  void
 shell_uid()  shell_uid(void)
 {  {
         setegid(gid);          setegid(gid);
         seteuid(uid);          seteuid(uid);
Line 302 
Line 298 
  * put the controlling keyboard into raw mode   * put the controlling keyboard into raw mode
  */   */
 void  void
 raw()  raw(void)
 {  {
         tcsetattr(0, TCSADRAIN, &term);          tcsetattr(0, TCSADRAIN, &term);
 }  }
Line 312 
Line 308 
  * return keyboard to normal mode   * return keyboard to normal mode
  */   */
 void  void
 unraw()  unraw(void)
 {  {
         if (gotdefterm)          if (gotdefterm)
                 tcsetattr(0, TCSADRAIN, &defterm);                  tcsetattr(0, TCSADRAIN, &defterm);
Line 326 
Line 322 
  *  normal erase and kill characters.   *  normal erase and kill characters.
  */   */
 int  int
 prompt(s, p, sz)  prompt(char *s, char *p, size_t sz)
         char *s;  
         char *p;  
         size_t sz;  
 {  {
         int c;          int c;
         char *b = p;          char *b = p;
Line 355 
Line 348 
  * Interrupt service routine during prompting   * Interrupt service routine during prompting
  */   */
 void  void
 intprompt()  intprompt(void)
 {  {
   
         (void)signal(SIGINT, SIG_IGN);          (void)signal(SIGINT, SIG_IGN);
Line 368 
Line 361 
  * ****TIPIN   TIPIN****   * ****TIPIN   TIPIN****
  */   */
 void  void
 tipin()  tipin(void)
 {  {
         char bol = 1;          char bol = 1;
         int gch;          int gch;
Line 423 
Line 416 
  *  called on recognition of ``escapec'' at the beginning of a line   *  called on recognition of ``escapec'' at the beginning of a line
  */   */
 int  int
 escape()  escape(void)
 {  {
         int gch;          int gch;
         esctable_t *p;          esctable_t *p;
Line 446 
Line 439 
 }  }
   
 int  int
 any(cc, p)  any(int cc, char *p)
         int cc;  
         char *p;  
 {  {
         char c = cc;          char c = cc;
         while (p && *p)          while (p && *p)
Line 458 
Line 449 
 }  }
   
 int  int
 size(s)  size(char *s)
         char *s;  
 {  {
         int i = 0;          int i = 0;
   
Line 469 
Line 459 
 }  }
   
 char *  char *
 interp(s)  interp(char *s)
         char *s;  
 {  {
         static char buf[256];          static char buf[256];
         char *p = buf, c, *q;          char *p = buf, c, *q;
Line 495 
Line 484 
 }  }
   
 char *  char *
 ctrl(c)  ctrl(char c)
         char c;  
 {  {
         static char s[3];          static char s[3];
   
Line 515 
Line 503 
  * Help command   * Help command
  */   */
 void  void
 help(c)  help(char c)
         char c;  
 {  {
         esctable_t *p;          esctable_t *p;
   
Line 534 
Line 521 
  * Set up the "remote" tty's state   * Set up the "remote" tty's state
  */   */
 int  int
 ttysetup(speed)  ttysetup(int speed)
         int speed;  
 {  {
         struct termios  cntrl;          struct termios  cntrl;
   
Line 547 
Line 533 
         if (boolean(value(DC)))          if (boolean(value(DC)))
                 cntrl.c_cflag |= CLOCAL;                  cntrl.c_cflag |= CLOCAL;
         if (boolean(value(HARDWAREFLOW)))          if (boolean(value(HARDWAREFLOW)))
                 cntrl.c_cflag |= CRTSCTS;                  cntrl.c_cflag |= CRTSCTS;
         cntrl.c_iflag &= ~(ISTRIP|ICRNL);          cntrl.c_iflag &= ~(ISTRIP|ICRNL);
         cntrl.c_oflag &= ~OPOST;          cntrl.c_oflag &= ~OPOST;
         cntrl.c_lflag &= ~(ICANON|ISIG|IEXTEN|ECHO);          cntrl.c_lflag &= ~(ICANON|ISIG|IEXTEN|ECHO);
Line 566 
Line 552 
  * with the right parity and output it.   * with the right parity and output it.
  */   */
 void  void
 parwrite(fd, buf, n)  parwrite(int fd, char *buf, int n)
         int fd;  
         char *buf;  
         int n;  
 {  {
         int i;          int i;
         char *bp;          char *bp;
Line 592 
Line 575 
  * Build a parity table with appropriate high-order bit.   * Build a parity table with appropriate high-order bit.
  */   */
 void  void
 setparity(defparity)  setparity(char *defparity)
         char *defparity;  
 {  {
         int i, flip, clr, set;          int i, flip, clr, set;
         char *parity;          char *parity;

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25