Diff for /Amaya/amaya/AHTBridge.c between versions 1.17 and 1.18

version 1.17, 1997/02/06 06:04:19 version 1.18, 1997/02/14 18:46:25
Line 36  extern  HTEventCallback *HTEvent_Retriev Line 36  extern  HTEventCallback *HTEvent_Retriev
  * Private functions   * Private functions
  */   */
 #ifdef __STDC__  #ifdef __STDC__
   static void         RequestRegisterReadXtevent (AHTReqContext *, SOCKET);
 static void         RequestKillReadXtevent (AHTReqContext *);  static void         RequestKillReadXtevent (AHTReqContext *);
   static void         RequestRegisterWriteXtevent (AHTReqContext *, SOCKET);
 static void         RequestKillWriteXtevent (AHTReqContext *);  static void         RequestKillWriteXtevent (AHTReqContext *);
   static void         RequestRegisterExceptXtevent (AHTReqContext *, SOCKET);
 static void         RequestKillExceptXtevent (AHTReqContext *);  static void         RequestKillExceptXtevent (AHTReqContext *);
   
 #else  #else
   static void         RequesAddReadXtevent ();
 static void         RequestKillReadXtevent ();  static void         RequestKillReadXtevent ();
   static void         RequesAddWriteXtevent ();
 static void         RequestKillWriteXtevent ();  static void         RequestKillWriteXtevent ();
   static void         RequestRegisterExceptXtevent ();
 static void         RequestKillExceptXtevent ();  static void         RequestKillExceptXtevent ();
   
 #endif  #endif
Line 120  XtInputId          *id; Line 126  XtInputId          *id;
      {       {
         if (THD_TRACE)          if (THD_TRACE)
            HTTrace ("Callback.... No callback found\n");             HTTrace ("Callback.... No callback found\n");
           /* experimental */
           /* remove the Xt input which caused this callback */
           XtRemoveInput (*id);
         /* put some more code to correctly destroy this request ?*/          /* put some more code to correctly destroy this request ?*/
         return (0);          return (0);
      }       }
Line 354  HTPriority          p; Line 363  HTPriority          p;
         if (ops & ReadBits)          if (ops & ReadBits)
           {            {
              me->read_ops = ops;               me->read_ops = ops;
   
 #ifdef WWW_XWINDOWS  #ifdef WWW_XWINDOWS
              if (me->read_xtinput_id)               RequestRegisterReadXtevent (me, sock);
                 XtRemoveInput (me->read_xtinput_id);  
              me->read_xtinput_id =  
                 XtAppAddInput (app_cont,  
                                sock,  
                                (XtPointer) XtInputReadMask,  
                                (XtInputCallbackProc) AHTCallback_bridge,  
                                (XtPointer) XtInputReadMask);  
              if (THD_TRACE)  
                 fprintf (stderr, "(BT) adding Xtinput %lu Socket %d R\n",  
                          me->read_xtinput_id, sock);  
 #endif /* WWW_XWINDOWS */  #endif /* WWW_XWINDOWS */
           }            }
   
Line 374  HTPriority          p; Line 372  HTPriority          p;
           {            {
              me->write_ops = ops;               me->write_ops = ops;
 #ifdef WWW_XWINDOWS  #ifdef WWW_XWINDOWS
              if (me->write_xtinput_id)               RequestRegisterWriteXtevent (me, sock);
                 XtRemoveInput (me->write_xtinput_id);  
              me->write_xtinput_id = XtAppAddInput (app_cont, sock,  
                                                (XtPointer) XtInputWriteMask,  
                                    (XtInputCallbackProc) AHTCallback_bridge,  
                                               (XtPointer) XtInputWriteMask);  
              if (THD_TRACE)  
                 fprintf (stderr, "(BT) adding Xtinput %lu Socket %d W\n",  
                          me->write_xtinput_id, sock);  
 #endif /* WWW_XWINDOWS */  #endif /* WWW_XWINDOWS */
           }            }
   
Line 390  HTPriority          p; Line 380  HTPriority          p;
           {            {
              me->except_ops = ops;               me->except_ops = ops;
 #ifdef WWW_XWINDOWS  #ifdef WWW_XWINDOWS
              if (me->except_xtinput_id)               RequestRegisterExceptXtevent (me, sock);
                 XtRemoveInput (me->except_xtinput_id);  
   
              me->except_xtinput_id = XtAppAddInput (app_cont, sock,  
                                               (XtPointer) XtInputExceptMask,  
                                    (XtInputCallbackProc) AHTCallback_bridge,  
                                              (XtPointer) XtInputExceptMask);  
              if (THD_TRACE)  
                 fprintf (stderr, "(BT) adding Xtinput %lu Socket %d E\n", me->except_xtinput_id, sock);  
 #endif /* WWW_XWINDOWS */  #endif /* WWW_XWINDOWS */
           }            }
      }       }
Line 448  SockOps             ops; Line 430  SockOps             ops;
   
              if (ops & ExceptBits)               if (ops & ExceptBits)
                 RequestKillExceptXtevent (me);                  RequestKillExceptXtevent (me);
   
   
           }            }
      }       }
   
Line 483  AHTReqContext      *me; Line 463  AHTReqContext      *me;
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
     RequestRegisterReadXtevent
     Registers with Xt the read events associated with socket sock
     ----------------------------------------------------------------------*/
   #ifdef __STDC__
   static void         RequestRegisterReadXtevent (AHTReqContext * me, SOCKET sock)
   #else
   static void         RequestRegisterReadXtevent (me, sock)
   AHTReqContext      *me;
   SOCKET sock;
   
   #endif /* __STDC__ */
   {
   #ifdef WWW_XWINDOWS
     if (me->read_xtinput_id)
       {
         if (THD_TRACE)
           fprintf (stderr, "Request_kill: Clearing Xtinput %lu Socket %d R\n", me->read_xtinput_id, sock);
         XtRemoveInput (me->read_xtinput_id);
       }
   
     me->read_xtinput_id =
       XtAppAddInput (app_cont,
                      sock,
                      (XtPointer) XtInputReadMask,
                      (XtInputCallbackProc) AHTCallback_bridge,
                      (XtPointer) XtInputReadMask);
   
     if (THD_TRACE)
       fprintf (stderr, "(BT) adding Xtinput %lu Socket %d R\n",
                me->read_xtinput_id, sock);
   #endif /* WWW_XWINDOWS */
   
   #ifdef AMAYA_JAVA
     JavaFdSetState (sock, 1);
   #endif
   }
   
   /*----------------------------------------------------------------------
   RequestKillReadXtevent    RequestKillReadXtevent
   kills any read Xt event associated with the request pointed to by "me".    kills any read Xt event associated with the request pointed to by "me".
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
Line 498  AHTReqContext      *me; Line 516  AHTReqContext      *me;
    if (me->read_xtinput_id)     if (me->read_xtinput_id)
      {       {
         if (THD_TRACE)          if (THD_TRACE)
            fprintf (stderr, "Request_kill: Clearing Read Xtinputs%lu\n", me->read_xtinput_id);             fprintf (stderr, "Request_kill: Clearing Xtinput %lu R\n", me->read_xtinput_id);
         XtRemoveInput (me->read_xtinput_id);          XtRemoveInput (me->read_xtinput_id);
         me->read_xtinput_id = (XtInputId) NULL;          me->read_xtinput_id = (XtInputId) NULL;
      }       }
 #endif /* WWW_XWINDOWS */  #endif /* WWW_XWINDOWS */
   
   #ifdef AMAYA_JAVA
     JavaFdResetState (sock, 1);
   #endif
   }
   
   /*----------------------------------------------------------------------
     RequestRegisterWriteXtevent
     Registers with Xt the write events associated with socket sock
     ----------------------------------------------------------------------*/
   #ifdef __STDC__
   static void         RequestRegisterWriteXtevent (AHTReqContext * me, SOCKET sock)
   #else
   static void         RequestRegisterWriteXtevent (me, sock)
   AHTReqContext      *me;
   SOCKET              sock;
   
   #endif /* __STDC__ */
   {
   #ifdef WWW_XWINDOWS
      if (me->write_xtinput_id)
       {
         if (THD_TRACE)
           fprintf (stderr, "Request_kill: Clearing Xtinput %lu Socket %d W\n", me->write_xtinput_id, sock);
         XtRemoveInput (me->write_xtinput_id);
       }
   
     me->write_xtinput_id =
       XtAppAddInput (app_cont,
                      sock,
                      (XtPointer) XtInputWriteMask,
                      (XtInputCallbackProc) AHTCallback_bridge,
                      (XtPointer) XtInputWriteMask);
   
     if (THD_TRACE)
       fprintf (stderr, "(BT) adding Xtinput %lu Socket %d W\n",
                me->write_xtinput_id, sock);
   #endif /* WWW_XWINDOWS */
   
   #ifdef AMAYA_JAVA
     JavaFdSetState (sock, 2);
   #endif
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
Line 527  AHTReqContext      *me; Line 587  AHTReqContext      *me;
         me->write_xtinput_id = (XtInputId) NULL;          me->write_xtinput_id = (XtInputId) NULL;
      }       }
 #endif /* WWW_XWINDOWS */  #endif /* WWW_XWINDOWS */
   
   #ifdef AMAYA_JAVA
     JavaFdResetState (sock, 2);
   #endif
   }
   
   /*----------------------------------------------------------------------
     RequestRegisterExceptXtevent
     Registers with Xt the except events associated with socket sock
     ----------------------------------------------------------------------*/
   #ifdef __STDC__
   static void         RequestRegisterExceptXtevent (AHTReqContext * me, SOCKET sock)
   #else
   static void         RequestRegisterExceptXtevent (me, sock)
   AHTReqContext      *me;
   SOCKET              sock;
   
   #endif /* __STDC__ */
   {
   #ifdef WWW_XWINDOWS
      if (me->except_xtinput_id)
        {
          if (THD_TRACE)
              fprintf (stderr, "Request_kill: Clearing Xtinput %lu Socket %d E\n", me->except_xtinput_id, sock);
           XtRemoveInput (me->except_xtinput_id);
        }
   
     me->except_xtinput_id =
       XtAppAddInput (app_cont,
                      sock,
                      (XtPointer) XtInputExceptMask,
                      (XtInputCallbackProc) AHTCallback_bridge,
                      (XtPointer) XtInputExceptMask);
   
     if (THD_TRACE)
       fprintf (stderr, "(BT) adding Xtinput %lu Socket %d E\n",
                me->write_xtinput_id, sock);
   
   #endif /* WWW_XWINDOWS */
   
   #ifdef AMAYA_JAVA
     JavaFdSetState (sock, 4);
   #endif
   
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
Line 551  AHTReqContext      *me; Line 655  AHTReqContext      *me;
         me->except_xtinput_id = (XtInputId) NULL;          me->except_xtinput_id = (XtInputId) NULL;
      }       }
 #endif /* WWW_XWINDOWS */  #endif /* WWW_XWINDOWS */
   
   #ifdef AMAYA_JAVA
     JavaFdResetState (sock, 4);
   #endif
 }  }
   
 /*  /*
Line 559  AHTReqContext      *me; Line 667  AHTReqContext      *me;
   
   
   
   
   
   

Removed from v.1.17  
changed lines
  Added in v.1.18


Webmaster