X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=www%2Fwirtcl.c;h=6425be9dc59c1ebae5251d6e3143f6429a4834e8;hb=4938d0c2e8f4e1eec397c2bfbbc7e23fd150c369;hp=9939df8b53d3808407d7b773d1f57c4158406e3e;hpb=6e37e8e91bf35cb14c930e8988085cf78f11029a;p=egate.git diff --git a/www/wirtcl.c b/www/wirtcl.c index 9939df8..6425be9 100644 --- a/www/wirtcl.c +++ b/www/wirtcl.c @@ -41,7 +41,31 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. * * $Log: wirtcl.c,v $ - * Revision 1.9 1995/11/07 14:56:59 adam + * 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 + * Resource/config system used by the gateway. + * + * Revision 1.13 1996/01/24 08:26:54 adam + * All tcl commands prefixed with egw_ (except the html command). + * + * Revision 1.12 1996/01/12 10:05:18 adam + * If script name ends with ';' HTTP/GET/Expires will be defined. + * The cgi interface only reads final handshake if response from + * server (shell) was zero-terminated [If it isn't it probably died]. + * + * Revision 1.11 1996/01/09 16:16:49 adam + * Port to OSF/1. Gif references moved from /gif/ to /egwgif/. + * + * Revision 1.10 1996/01/09 10:46:50 adam + * New defines: LOGDIR/EGWDIR/CGIDIR set in Makefile. + * + * Revision 1.9 1995/11/07 14:56:59 adam * Work on search in multiple targets. * New wtcl command: wlog. * Optional timeout parameter to zwait. @@ -117,7 +141,6 @@ struct tcl_info { WCLIENT wcl; }; - static int events (struct tcl_info *p, char *waitVar, int tout); static int proc_zwait_invoke (ClientData clientData, Tcl_Interp *interp, @@ -130,14 +153,11 @@ static int proc_zwait_invoke (ClientData clientData, Tcl_Interp *interp, return events (p, argv[1], (argc == 3) ? atoi(argv[2]) : 0); } - - -/* select(2) callbacks */ +/* select callbacks */ struct callback { - void (*r_handle)(ClientData); - void (*w_handle)(ClientData); - void (*x_handle)(ClientData); - void *obj; + void (*handle)(ClientData, int, int, int); + int r, w, e; + ClientData obj; }; #define MAX_CALLBACK 200 @@ -166,15 +186,11 @@ static void *do_create (WCLIENT wcl, void *args) gw_log (GW_LOG_FATAL, mod, "Cannot make Irtcl_Interp"); exit (1); } - log_init(LOG_ALL, "irtcl", "/usr/local/etc/httpd/logs/irtcl_log"); + log_init(LOG_ALL, "irtcl", "irtcl_log"); /* initialize irtcl */ - Tcl_CreateCommand (p->interp, "zwait", proc_zwait_invoke, p, NULL); + Tcl_CreateCommand (p->interp, "egw_wait", proc_zwait_invoke, p, NULL); for (i=0; i max_fd) max_fd = fd; } -void ir_select_add_write (int fd, void *obj) -{ - callback_table[fd].w_handle = ir_select_write; - if (fd > max_fd) - max_fd = fd; -} - -void ir_select_remove_write (int fd, void *obj) -{ - callback_table[fd].w_handle = NULL; -} - -void ir_select_remove (int fd, void *obj) -{ - callback_table[fd].r_handle = NULL; - callback_table[fd].w_handle = NULL; - callback_table[fd].x_handle = NULL; -} - static int do_load (char *parms, void *mydata) { struct tcl_info *p = mydata; @@ -349,3 +348,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; +} +