X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=www%2Fwtcl.c;h=bd63995dcd6051a11a68a8f990e58dc4d81e4eeb;hb=fb42e8909c46dfe29d2b8d8852e0ebf297eb2963;hp=c724b0281731ac0074e9fa37a6e7ede7a4daafac;hpb=a6f3beb071fe8c894ee6c846c86296c84f48e3d4;p=egate.git diff --git a/www/wtcl.c b/www/wtcl.c index c724b02..bd63995 100644 --- a/www/wtcl.c +++ b/www/wtcl.c @@ -41,7 +41,14 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. * * $Log: wtcl.c,v $ - * Revision 1.3 1995/10/27 15:12:14 adam + * Revision 1.5 1995/10/30 17:35:18 adam + * New function zwait that waits for a variable change - due to i/o events + * that invoke callback routines. + * + * Revision 1.4 1995/10/27 17:30:16 adam + * First search request/response that works. + * + * Revision 1.3 1995/10/27 15:12:14 adam * IrTcl incorporated in the gateway. * Better separation of script types. * Z39.50 gateway scripts entered. @@ -180,7 +187,7 @@ static void *do_create (WCLIENT wcl, void *args) static void report_error (struct tcl_info *p, int errorLine, const char *pre, const char *msg) { - gw_log (GW_LOG_WARN, "%s %d\%s", pre, errorLine, msg); + gw_log (GW_LOG_WARN, mod, "%s %d %s", pre, errorLine, msg); wo_printf (p->wcl, "\n

\n" "%s %d
\n", pre, errorLine); wo_printf (p->wcl, "\n%s\n
\n", msg); @@ -213,7 +220,7 @@ static int tcl_exec (const char *fname, char *parms, { report_error (p, *lineno, "Error in Tcl script starting at line", "Unexpected EOF (missing right brace)"); - return -1; + return TCL_ERROR; } if (c == '\\') escape = 1; @@ -243,7 +250,7 @@ static int tcl_exec (const char *fname, char *parms, "Error in Tcl script in line", Tcl_GetVar (p->interp, "errorInfo", 0)); (*lineno) += local_line; - return 0; + return r; } static int do_exec (const char *fname, char *parms, void *mydata) @@ -270,7 +277,13 @@ static int do_exec (const char *fname, char *parms, void *mydata) wo_putc (p->wcl, c); else { - if (tcl_exec (fname, parms, p, inf, &lineno)) + int r = tcl_exec (fname, parms, p, inf, &lineno); + if (r == TCL_RETURN) + { + fclose (inf); + return 0; + } + else if (r == TCL_ERROR) { fclose (inf); return -2;