diff options
author | welch <welch> | 1999-07-02 06:05:34 (GMT) |
---|---|---|
committer | welch <welch> | 1999-07-02 06:05:34 (GMT) |
commit | b032007a3ee9266d2a26475ff16d57e8412cf132 (patch) | |
tree | de5ebe9540617f5e8a6f8ecf7eff5984a4ff95cf /unix/tclUnixNotfy.c | |
parent | 4e5672a0727fc2cc1fb70a4674340d1549ac9ca5 (diff) | |
download | tcl-b032007a3ee9266d2a26475ff16d57e8412cf132.zip tcl-b032007a3ee9266d2a26475ff16d57e8412cf132.tar.gz tcl-b032007a3ee9266d2a26475ff16d57e8412cf132.tar.bz2 |
Added hook points to the notifier
Updated Xt tests to use new Tcl_SetNotifier
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r-- | unix/tclUnixNotfy.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 5a0d222..4053e4a 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -11,13 +11,15 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixNotfy.c,v 1.4 1999/06/10 04:27:44 stanton Exp $ + * RCS: @(#) $Id: tclUnixNotfy.c,v 1.5 1999/07/02 06:05:34 welch Exp $ */ #include "tclInt.h" #include "tclPort.h" #include <signal.h> +extern TclStubs tclStubs; + /* * This structure is used to keep track of the notifier info for a * a registered file. @@ -336,6 +338,10 @@ Tcl_SetTimer(timePtr) * because the only event loop is via Tcl_DoOneEvent, which passes * timeout values to Tcl_WaitForEvent. */ + + if (tclStubs.tcl_SetTimer != Tcl_SetTimer) { + tclStubs.tcl_SetTimer(timePtr); + } } /* @@ -392,6 +398,11 @@ Tcl_CreateFileHandler(fd, mask, proc, clientData) FileHandler *filePtr; int index, bit; + if (tclStubs.tcl_CreateFileHandler != Tcl_CreateFileHandler) { + tclStubs.tcl_CreateFileHandler(fd, mask, proc, clientData); + return; + } + for (filePtr = tsdPtr->firstFileHandlerPtr; filePtr != NULL; filePtr = filePtr->nextPtr) { if (filePtr->fd == fd) { @@ -461,6 +472,11 @@ Tcl_DeleteFileHandler(fd) unsigned long flags; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + if (tclStubs.tcl_DeleteFileHandler != Tcl_DeleteFileHandler) { + tclStubs.tcl_DeleteFileHandler(fd); + return; + } + /* * Find the entry for the given file (and return if there isn't one). */ @@ -632,6 +648,10 @@ Tcl_WaitForEvent(timePtr) #endif ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + if (tclStubs.tcl_WaitForEvent != Tcl_WaitForEvent) { + return tclStubs.tcl_WaitForEvent(timePtr); + } + /* * Set up the timeout structure. Note that if there are no events to * check for, we return with a negative result rather than blocking |