diff options
Diffstat (limited to 'unix/tclXtNotify.c')
-rw-r--r-- | unix/tclXtNotify.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c index e289e8c..6a11c0d 100644 --- a/unix/tclXtNotify.c +++ b/unix/tclXtNotify.c @@ -10,9 +10,6 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#ifndef USE_TCL_STUBS -# define USE_TCL_STUBS -#endif #include <X11/Intrinsic.h> #include "tclInt.h" @@ -77,22 +74,22 @@ static int initialized = 0; */ static int FileHandlerEventProc(Tcl_Event *evPtr, int flags); -static void FileProc(ClientData clientData, int *source, +static void FileProc(caddr_t clientData, int *source, XtInputId *id); +void InitNotifier(void); static void NotifierExitHandler(ClientData clientData); -static void TimerProc(ClientData clientData, XtIntervalId *id); +static void TimerProc(caddr_t clientData, XtIntervalId *id); static void CreateFileHandler(int fd, int mask, - Tcl_FileProc *proc, ClientData clientData); + Tcl_FileProc * proc, ClientData clientData); static void DeleteFileHandler(int fd); -static void SetTimer(const Tcl_Time * timePtr); -static int WaitForEvent(const Tcl_Time * timePtr); +static void SetTimer(Tcl_Time * timePtr); +static int WaitForEvent(Tcl_Time * timePtr); /* * Functions defined in this file for use by users of the Xt Notifier: */ -MODULE_SCOPE void InitNotifier(void); -MODULE_SCOPE XtAppContext TclSetAppContext(XtAppContext ctx); +EXTERN XtAppContext TclSetAppContext(XtAppContext ctx); /* *---------------------------------------------------------------------- @@ -262,7 +259,7 @@ NotifierExitHandler( static void SetTimer( - const Tcl_Time *timePtr) /* Timeout value, may be NULL. */ + Tcl_Time *timePtr) /* Timeout value, may be NULL. */ { long timeout; @@ -301,7 +298,7 @@ SetTimer( static void TimerProc( - ClientData clientData, /* Not used. */ + caddr_t data, /* Not used. */ XtIntervalId *id) { if (*id != notifier.currentTimeout) { @@ -355,7 +352,7 @@ CreateFileHandler( } } if (filePtr == NULL) { - filePtr = ckalloc(sizeof(FileHandler)); + filePtr = (FileHandler*) ckalloc(sizeof(FileHandler)); filePtr->fd = fd; filePtr->read = 0; filePtr->write = 0; @@ -375,7 +372,7 @@ CreateFileHandler( if (mask & TCL_READABLE) { if (!(filePtr->mask & TCL_READABLE)) { filePtr->read = XtAppAddInput(notifier.appContext, fd, - INT2PTR(XtInputReadMask), FileProc, filePtr); + XtInputReadMask, FileProc, filePtr); } } else { if (filePtr->mask & TCL_READABLE) { @@ -385,7 +382,7 @@ CreateFileHandler( if (mask & TCL_WRITABLE) { if (!(filePtr->mask & TCL_WRITABLE)) { filePtr->write = XtAppAddInput(notifier.appContext, fd, - INT2PTR(XtInputWriteMask), FileProc, filePtr); + XtInputWriteMask, FileProc, filePtr); } } else { if (filePtr->mask & TCL_WRITABLE) { @@ -395,7 +392,7 @@ CreateFileHandler( if (mask & TCL_EXCEPTION) { if (!(filePtr->mask & TCL_EXCEPTION)) { filePtr->except = XtAppAddInput(notifier.appContext, fd, - INT2PTR(XtInputExceptMask), FileProc, filePtr); + XtInputExceptMask, FileProc, filePtr); } } else { if (filePtr->mask & TCL_EXCEPTION) { @@ -466,7 +463,7 @@ DeleteFileHandler( if (filePtr->mask & TCL_EXCEPTION) { XtRemoveInput(filePtr->except); } - ckfree(filePtr); + ckfree((char *) filePtr); } /* @@ -488,7 +485,7 @@ DeleteFileHandler( static void FileProc( - ClientData clientData, + caddr_t clientData, int *fd, XtInputId *id) { @@ -521,7 +518,7 @@ FileProc( */ filePtr->readyMask |= mask; - fileEvPtr = ckalloc(sizeof(FileHandlerEvent)); + fileEvPtr = (FileHandlerEvent *) ckalloc(sizeof(FileHandlerEvent)); fileEvPtr->header.proc = FileHandlerEventProc; fileEvPtr->fd = filePtr->fd; Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL); @@ -597,7 +594,7 @@ FileHandlerEventProc( mask = filePtr->readyMask & filePtr->mask; filePtr->readyMask = 0; if (mask != 0) { - filePtr->proc(filePtr->clientData, mask); + (*filePtr->proc)(filePtr->clientData, mask); } break; } @@ -626,7 +623,7 @@ FileHandlerEventProc( static int WaitForEvent( - const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ + Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { int timeout; |