Mercurial > hg > xemacs-beta
comparison src/sysdep.c @ 513:e159a0b4bed4
[xemacs-hg @ 2001-05-07 07:49:18 by martinb]
TTY configury portability improvements.
author | martinb |
---|---|
date | Mon, 07 May 2001 07:49:19 +0000 |
parents | 7039e6323819 |
children | c69610198c35 |
comparison
equal
deleted
inserted
replaced
512:14227e8a3f1f | 513:e159a0b4bed4 |
---|---|
454 | 454 |
455 #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) | 455 #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) |
456 assert (isatty(out)); | 456 assert (isatty(out)); |
457 s.main.c_oflag |= OPOST; /* Enable output postprocessing */ | 457 s.main.c_oflag |= OPOST; /* Enable output postprocessing */ |
458 s.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */ | 458 s.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */ |
459 | |
460 { | |
461 /* Disable all output delays. */ | |
462 tcflag_t delay_mask = 0; | |
459 #ifdef NLDLY | 463 #ifdef NLDLY |
460 s.main.c_oflag &= ~(NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY); | 464 delay_mask |= NLDLY; |
461 /* No output delays */ | 465 #endif |
462 #endif | 466 #ifdef CRDLY |
467 delay_mask |= CRDLY; | |
468 #endif | |
469 #ifdef TABDLY | |
470 delay_mask |= TABDLY; /* Also disables tab expansion (Posix). */ | |
471 #endif | |
472 #ifdef BSDLY | |
473 delay_mask |= BSDLY; | |
474 #endif | |
475 #ifdef VTDLY | |
476 delay_mask |= VTDLY; | |
477 #endif | |
478 #ifdef FFDLY | |
479 delay_mask |= FFDLY; | |
480 #endif | |
481 s.main.c_oflag &= ~delay_mask; | |
482 } | |
483 | |
484 #ifdef OXTABS | |
485 /* Posix defines the TAB3 value for TABDLY to mean: expand tabs to spaces. | |
486 On those systems tab expansion would be disabled by the above code. | |
487 BSD systems use an independent flag, OXTABS. */ | |
488 s.main.c_oflag &= ~OXTABS; /* Disable tab expansion */ | |
489 #endif | |
490 | |
463 s.main.c_lflag &= ~ECHO; /* Disable echo */ | 491 s.main.c_lflag &= ~ECHO; /* Disable echo */ |
464 s.main.c_lflag |= ISIG; /* Enable signals */ | 492 s.main.c_lflag |= ISIG; /* Enable signals */ |
465 #ifdef IUCLC | 493 #ifdef IUCLC |
466 s.main.c_iflag &= ~IUCLC; /* Disable downcasing on input. */ | 494 s.main.c_iflag &= ~IUCLC; /* Disable downcasing on input. */ |
467 #endif | 495 #endif |
468 #ifdef OLCUC | 496 #ifdef OLCUC |
469 s.main.c_oflag &= ~OLCUC; /* Disable upcasing on output. */ | 497 s.main.c_oflag &= ~OLCUC; /* Disable upcasing on output. */ |
470 #endif | 498 #endif |
471 s.main.c_oflag &= ~TAB3; /* Disable tab expansion */ | 499 |
472 #if defined (CSIZE) && defined (CS8) | 500 #if defined (CSIZE) && defined (CS8) |
473 s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */ | 501 s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */ |
474 #endif | 502 #endif |
475 #ifdef ISTRIP | 503 #ifdef ISTRIP |
476 s.main.c_iflag &= ~ISTRIP; /* Don't strip 8th bit on input */ | 504 s.main.c_iflag &= ~ISTRIP; /* Don't strip 8th bit on input */ |
1588 } | 1616 } |
1589 else | 1617 else |
1590 tty.main.c_iflag &= ~IXON; /* Disable start/stop output control */ | 1618 tty.main.c_iflag &= ~IXON; /* Disable start/stop output control */ |
1591 tty.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL | 1619 tty.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL |
1592 on output */ | 1620 on output */ |
1593 tty.main.c_oflag &= ~TAB3; /* Disable tab expansion */ | 1621 |
1622 #if 0 | |
1623 /* We used to disable tab expansion here, but this is the user's decision. */ | |
1624 #if defined (TABDLY) && defined (TAB3) | |
1625 if ((tty.main.c_oflag & TABDLY) == TAB3) | |
1626 tty.main.c_oflag &= ~TABDLY; /* Disable tab expansion (Posix). */ | |
1627 #elif defined (OXTABS) | |
1628 tty.main.c_oflag &= ~OXTABS; /* Disable tab expansion (BSD). */ | |
1629 #endif | |
1630 #endif /* 0 */ | |
1631 | |
1594 #ifdef CS8 | 1632 #ifdef CS8 |
1595 if (TTY_FLAGS (con).meta_key) | 1633 if (TTY_FLAGS (con).meta_key) |
1596 { | 1634 { |
1597 tty.main.c_cflag |= CS8; /* allow 8th bit on input */ | 1635 tty.main.c_cflag |= CS8; /* allow 8th bit on input */ |
1598 tty.main.c_cflag &= ~PARENB;/* Don't check parity */ | 1636 tty.main.c_cflag &= ~PARENB;/* Don't check parity */ |
3015 { | 3053 { |
3016 const Extbyte * const external_name = (const Extbyte *) rtnval->d_name; | 3054 const Extbyte * const external_name = (const Extbyte *) rtnval->d_name; |
3017 Extcount external_len = strlen (rtnval->d_name); | 3055 Extcount external_len = strlen (rtnval->d_name); |
3018 const Bufbyte *internal_name; | 3056 const Bufbyte *internal_name; |
3019 Bytecount internal_len; | 3057 Bytecount internal_len; |
3020 | 3058 |
3021 TO_INTERNAL_FORMAT (DATA, (external_name, external_len), | 3059 TO_INTERNAL_FORMAT (DATA, (external_name, external_len), |
3022 ALLOCA, (internal_name, internal_len), | 3060 ALLOCA, (internal_name, internal_len), |
3023 Qfile_name); | 3061 Qfile_name); |
3024 | 3062 |
3025 /* check for common case of ASCII filename */ | 3063 /* check for common case of ASCII filename */ |