Attachment "xt-notifier-patch" to
ticket [817249ffff]
added by
fjhsf
2003-10-03 22:29:33.
--- tcl8.4.4-orig/unix/tclXtNotify.c Thu Jul 1 23:05:34 1999
+++ tcl8.4.4/unix/tclXtNotify.c Fri Oct 3 07:33:27 2003
@@ -77,12 +77,12 @@
static int FileHandlerEventProc _ANSI_ARGS_((Tcl_Event *evPtr,
int flags));
-static void FileProc _ANSI_ARGS_((caddr_t clientData,
+static void FileProc _ANSI_ARGS_((XtPointer clientData,
int *source, XtInputId *id));
void InitNotifier _ANSI_ARGS_((void));
static void NotifierExitHandler _ANSI_ARGS_((
ClientData clientData));
-static void TimerProc _ANSI_ARGS_((caddr_t clientData,
+static void TimerProc _ANSI_ARGS_((XtPointer clientData,
XtIntervalId *id));
static void CreateFileHandler _ANSI_ARGS_((int fd, int mask,
Tcl_FileProc * proc, ClientData clientData));
@@ -188,7 +188,7 @@
void
InitNotifier()
{
- Tcl_NotifierProcs notifier;
+ Tcl_NotifierProcs np;
/*
* Only reinitialize if we are not in exit handling. The notifier
* can get reinitialized after its own exit handler has run, because
@@ -199,11 +199,15 @@
return;
}
- notifier.createFileHandlerProc = CreateFileHandler;
- notifier.deleteFileHandlerProc = DeleteFileHandler;
- notifier.setTimerProc = SetTimer;
- notifier.waitForEventProc = WaitForEvent;
- Tcl_SetNotifier(¬ifier);
+ np.createFileHandlerProc = CreateFileHandler;
+ np.deleteFileHandlerProc = DeleteFileHandler;
+ np.setTimerProc = SetTimer;
+ np.waitForEventProc = WaitForEvent;
+ np.initNotifierProc = Tcl_InitNotifier;
+ np.finalizeNotifierProc = Tcl_FinalizeNotifier;
+ np.alertNotifierProc = Tcl_AlertNotifier;
+ np.serviceModeHookProc = Tcl_ServiceModeHook;
+ Tcl_SetNotifier(&np);
/*
* DO NOT create the application context yet; doing so would prevent
@@ -309,7 +313,7 @@
static void
TimerProc(data, id)
- caddr_t data; /* Not used. */
+ XtPointer data; /* Not used. */
XtIntervalId *id;
{
if (*id != notifier.currentTimeout) {
@@ -383,8 +387,8 @@
if (mask & TCL_READABLE) {
if (!(filePtr->mask & TCL_READABLE)) {
filePtr->read =
- XtAppAddInput(notifier.appContext, fd, XtInputReadMask,
- FileProc, filePtr);
+ XtAppAddInput(notifier.appContext, fd,
+ (XtPointer) XtInputReadMask, FileProc, filePtr);
}
} else {
if (filePtr->mask & TCL_READABLE) {
@@ -394,8 +398,8 @@
if (mask & TCL_WRITABLE) {
if (!(filePtr->mask & TCL_WRITABLE)) {
filePtr->write =
- XtAppAddInput(notifier.appContext, fd, XtInputWriteMask,
- FileProc, filePtr);
+ XtAppAddInput(notifier.appContext, fd,
+ (XtPointer) XtInputWriteMask, FileProc, filePtr);
}
} else {
if (filePtr->mask & TCL_WRITABLE) {
@@ -405,8 +409,8 @@
if (mask & TCL_EXCEPTION) {
if (!(filePtr->mask & TCL_EXCEPTION)) {
filePtr->except =
- XtAppAddInput(notifier.appContext, fd, XtInputExceptMask,
- FileProc, filePtr);
+ XtAppAddInput(notifier.appContext, fd,
+ (XtPointer) XtInputExceptMask, FileProc, filePtr);
}
} else {
if (filePtr->mask & TCL_EXCEPTION) {
@@ -502,7 +506,7 @@
static void
FileProc(clientData, fd, id)
- caddr_t clientData;
+ XtPointer clientData;
int *fd;
XtInputId *id;
{