summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-24 19:18:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-24 19:18:21 (GMT)
commit53c90dd2dd157a577d263f199af9af9c2fb896d4 (patch)
treebc6aef1f55064ed51245d79010b8eddf91ce01e6 /generic
parent6f812b4ccb74d0aebe4bbf520bd6710fa82cf549 (diff)
downloadtcl-53c90dd2dd157a577d263f199af9af9c2fb896d4.zip
tcl-53c90dd2dd157a577d263f199af9af9c2fb896d4.tar.gz
tcl-53c90dd2dd157a577d263f199af9af9c2fb896d4.tar.bz2
Take cygwin handling of X11 into account
Implement TclpIsAtty, Cygwin only doc/dde.n: doc fix
Diffstat (limited to 'generic')
-rw-r--r--generic/tclInt.decls4
-rw-r--r--generic/tclIntPlatDecls.h10
-rw-r--r--generic/tclStubInit.c10
3 files changed, 20 insertions, 4 deletions
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 67f3db6..d714e85 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -894,6 +894,10 @@ declare 15 win {
const char **argv, TclFile inputFile, TclFile outputFile,
TclFile errorFile, Tcl_Pid *pidPtr)
}
+# new for 8.4.20+/8.5.12+ Cygwin only
+declare 16 win {
+ int TclpIsAtty(int fd)
+}
# Signature changed in 8.1:
# declare 16 win {
# TclFile TclpCreateTempFile(char *contents, Tcl_DString *namePtr)
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h
index 201c597..350df03 100644
--- a/generic/tclIntPlatDecls.h
+++ b/generic/tclIntPlatDecls.h
@@ -134,7 +134,8 @@ EXTERN int TclpCreateProcess _ANSI_ARGS_((Tcl_Interp *interp,
int argc, CONST char **argv,
TclFile inputFile, TclFile outputFile,
TclFile errorFile, Tcl_Pid *pidPtr));
-/* Slot 16 is reserved */
+/* 16 */
+EXTERN int TclpIsAtty _ANSI_ARGS_((int fd));
/* Slot 17 is reserved */
/* 18 */
EXTERN TclFile TclpMakeFile _ANSI_ARGS_((Tcl_Channel channel,
@@ -289,7 +290,7 @@ typedef struct TclIntPlatStubs {
Tcl_Channel (*tclpCreateCommandChannel) _ANSI_ARGS_((TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr)); /* 13 */
int (*tclpCreatePipe) _ANSI_ARGS_((TclFile *readPipe, TclFile *writePipe)); /* 14 */
int (*tclpCreateProcess) _ANSI_ARGS_((Tcl_Interp *interp, int argc, CONST char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr)); /* 15 */
- VOID *reserved16;
+ int (*tclpIsAtty) _ANSI_ARGS_((int fd)); /* 16 */
VOID *reserved17;
TclFile (*tclpMakeFile) _ANSI_ARGS_((Tcl_Channel channel, int direction)); /* 18 */
TclFile (*tclpOpenFile) _ANSI_ARGS_((CONST char *fname, int mode)); /* 19 */
@@ -488,7 +489,10 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclpCreateProcess \
(tclIntPlatStubsPtr->tclpCreateProcess) /* 15 */
#endif
-/* Slot 16 is reserved */
+#ifndef TclpIsAtty
+#define TclpIsAtty \
+ (tclIntPlatStubsPtr->tclpIsAtty) /* 16 */
+#endif
/* Slot 17 is reserved */
#ifndef TclpMakeFile
#define TclpMakeFile \
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index e623fa6..b548b1d 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -72,7 +72,9 @@ int TclSockMinimumBuffersOld(sock, size)
#ifdef __WIN32__
# define TclUnixWaitForFile 0
# define TclpReaddir 0
+# define TclpIsAtty 0
#elif defined(__CYGWIN__)
+# define TclpIsAtty TclPlatIsAtty
# define TclWinSetInterfaces (void (*) (int)) doNothing
# define TclWinAddProcess (void (*) (void *, unsigned int)) doNothing
# define TclWinFlushDirtyChannels doNothing
@@ -81,6 +83,12 @@ int TclSockMinimumBuffersOld(sock, size)
static Tcl_Encoding winTCharEncoding;
+static int
+TclpIsAtty(int fd)
+{
+ return isatty(fd);
+}
+
int
TclWinGetPlatformId()
{
@@ -461,7 +469,7 @@ TclIntPlatStubs tclIntPlatStubs = {
TclpCreateCommandChannel, /* 13 */
TclpCreatePipe, /* 14 */
TclpCreateProcess, /* 15 */
- NULL, /* 16 */
+ TclpIsAtty, /* 16 */
NULL, /* 17 */
TclpMakeFile, /* 18 */
TclpOpenFile, /* 19 */