Minor changes.
[egate.git] / www / wirtcl.c
index 942abdc..76e1690 100644 (file)
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wirtcl.c,v $
- * Revision 1.15  1996/02/21 14:58:01  adam
+ * Revision 1.17  1996/03/15 14:43:26  adam
+ * Function egw_wait returns 'cancel' if new request is pending (user
+ * has cancelled); or egw_wait returns 'timeout' on timeout.
+ *
+ * Revision 1.16  1996/02/29  15:40:23  adam
+ * New function w_interp_irtcl_get that returns Tcl interpreter of
+ * IrTcl interpreter.
+ *
+ * Revision 1.15  1996/02/21  14:58:01  adam
  * Modified to use ir_tcl_select_set.
  *
  * Revision 1.14  1996/02/12  10:10:31  adam
@@ -286,12 +294,14 @@ static int events (struct tcl_info *p, char *waitVar, int tout)
         if (!r)
         {
             gw_log (GW_LOG_DEBUG, mod, "timeout");
+            p->interp->result = "timeout";
             free (waitVarVal);
             return TCL_ERROR;
         }
         if (FD_ISSET (fifo_in, &fdset_tcl_r))
         {
             gw_log (GW_LOG_DEBUG, mod, "FIFO closed");
+            p->interp->result = "cancel";
             free (waitVarVal);
             return TCL_ERROR;
         }
@@ -344,3 +354,16 @@ static int do_save (char *parms, void *mydata)
     return w_interp_save_state (p->w_interp, parms);
 }
 
+Tcl_Interp *w_interp_irtcl_get (W_Interp w_interp)
+{
+    struct tcl_info *p;
+
+    if (strcmp (w_interp->ctrl->name, "irtcl"))
+    {
+        gw_log (GW_LOG_FATAL, mod, "Internal failure");
+        assert (0);
+    }
+    p = (struct tcl_info*) w_interp->mydata;
+    return p->interp;
+}
+