summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2013-02-27 21:09:24 (GMT)
committerjenglish <jenglish@flightlab.com>2013-02-27 21:09:24 (GMT)
commit2d72995bd43fdc603ea4164122e285c0e546d62d (patch)
tree0ea4ef5dc5b3ceab374efb306e583697d54d4e40
parent9c402c70fa3e0ee295ef6000c974e28d34cda6c3 (diff)
downloadtcl-2d72995bd43fdc603ea4164122e285c0e546d62d.zip
tcl-2d72995bd43fdc603ea4164122e285c0e546d62d.tar.gz
tcl-2d72995bd43fdc603ea4164122e285c0e546d62d.tar.bz2
ifdef reduction: SUPPORTS_TTY defined if and only if USE_TERMIOS defined.
-rw-r--r--unix/tclUnixChan.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 05948a3..a0d9b3f 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -14,9 +14,8 @@
#include "tclInt.h" /* Internal definitions for Tcl. */
#include "tclIO.h" /* To get Channel type declaration. */
-#define SUPPORTS_TTY
-
#ifdef USE_TERMIOS
+# define SUPPORTS_TTY
# include <termios.h>
# ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
@@ -59,10 +58,7 @@
# define PAREXT CMSPAR
# endif /* !PAREXT&&CMSPAR */
#else /* !USE_TERMIOS */
-
-
# undef SUPPORTS_TTY
-
#endif /* !USE_TERMIOS */
/*
@@ -550,7 +546,6 @@ FileGetHandleProc(
}
#ifdef SUPPORTS_TTY
-#ifdef USE_TERMIOS
/*
*----------------------------------------------------------------------
*
@@ -583,7 +578,6 @@ TtyModemStatusStr(
Tcl_DStringAppendElement(dsPtr, (status & TIOCM_CD) ? "1" : "0");
#endif /* TIOCM_CD */
}
-#endif /* USE_TERMIOS */
/*
*----------------------------------------------------------------------
@@ -613,11 +607,9 @@ TtySetOptionProc(
FileState *fsPtr = instanceData;
unsigned int len, vlen;
TtyAttrs tty;
-#ifdef USE_TERMIOS
int flag, control, argc;
const char **argv;
IOSTATE iostate;
-#endif /* USE_TERMIOS */
len = strlen(optionName);
vlen = strlen(value);
@@ -640,7 +632,6 @@ TtySetOptionProc(
return TCL_OK;
}
-#ifdef USE_TERMIOS
/*
* Option -handshake none|xonxoff|rtscts|dtrdsr
@@ -820,9 +811,6 @@ TtySetOptionProc(
return Tcl_BadChannelOption(interp, optionName,
"mode handshake timeout ttycontrol xchar");
-#else /* !USE_TERMIOS */
- return Tcl_BadChannelOption(interp, optionName, "mode");
-#endif /* USE_TERMIOS */
}
/*
@@ -876,7 +864,6 @@ TtyGetOptionProc(
Tcl_DStringAppendElement(dsPtr, buf);
}
-#ifdef USE_TERMIOS
/*
* Get option -xchar
*/
@@ -943,15 +930,12 @@ TtyGetOptionProc(
GETCONTROL(fsPtr->fd, &status);
TtyModemStatusStr(status, dsPtr);
}
-#endif /* USE_TERMIOS */
if (valid) {
return TCL_OK;
}
return Tcl_BadChannelOption(interp, optionName, "mode"
-#ifdef USE_TERMIOS
" queue ttystatus xchar"
-#endif /* USE_TERMIOS */
);
}
@@ -1152,7 +1136,6 @@ TtyGetAttributes(
GETIOSTATE(fd, &iostate);
-#ifdef USE_TERMIOS
baud = TtyGetBaud(cfgetospeed(&iostate));
parity = 'n';
@@ -1174,7 +1157,6 @@ TtyGetAttributes(
data = (data == CS5) ? 5 : (data == CS6) ? 6 : (data == CS7) ? 7 : 8;
stop = (iostate.c_cflag & CSTOPB) ? 2 : 1;
-#endif /* USE_TERMIOS */
@@ -1209,7 +1191,6 @@ TtySetAttributes(
{
IOSTATE iostate;
-#ifdef USE_TERMIOS
int parity, data, flag;
GETIOSTATE(fd, &iostate);
@@ -1242,7 +1223,6 @@ TtySetAttributes(
CLEAR_BITS(iostate.c_cflag, PARENB | PARODD | CSIZE | CSTOPB);
SET_BITS(iostate.c_cflag, flag);
-#endif /* USE_TERMIOS */