* 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.
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<br><hr>\n<strong>"
"%s %d</strong><br>\n", pre, errorLine);
wo_printf (p->wcl, "<xmp>\n%s</xmp>\n<hr>\n", msg);
{
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;
"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)
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;