X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=www%2Fwtcl.c;h=fc641f90afb886a3edf0f80122ce1ce0f179a22c;hb=b443634fbd412cea15ea527188c3e241bb1edf21;hp=9ed644cb1ccedc080c231df6b21a753927040489;hpb=94e0e8ff10cdb5142f983cd76156310461f9eb89;p=egate.git
diff --git a/www/wtcl.c b/www/wtcl.c
index 9ed644c..fc641f9 100644
--- a/www/wtcl.c
+++ b/www/wtcl.c
@@ -41,7 +41,16 @@
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wtcl.c,v $
- * Revision 1.8 1995/11/06 17:44:23 adam
+ * Revision 1.10 1995/11/08 16:14:35 adam
+ * Many improvements and bug fixes.
+ * First version that ran on dtbsun.
+ *
+ * Revision 1.9 1995/11/07 14:57:00 adam
+ * Work on search in multiple targets.
+ * New wtcl command: wlog.
+ * Optional timeout parameter to zwait.
+ *
+ * Revision 1.8 1995/11/06 17:44:23 adam
* State reestablised when shell restarts. History of previous
* result sets.
*
@@ -185,6 +194,42 @@ static int proc_wform_invoke (ClientData clientData, Tcl_Interp *interp,
return TCL_OK;
}
+static int proc_wlog_invoke (ClientData clientData, Tcl_Interp *interp,
+ int argc, char **argv)
+{
+ unsigned mask;
+
+ if (argc < 3)
+ return TCL_OK;
+ if (!strcmp (argv[1], "debug"))
+ mask = GW_LOG_DEBUG;
+ else if (!strcmp (argv[1], "fatal"))
+ mask = GW_LOG_FATAL;
+ else if (!strcmp (argv[1], "warn"))
+ mask = GW_LOG_WARN;
+ else if (!strcmp (argv[1], "acct"))
+ mask = GW_LOG_ACCT;
+ else
+ mask = GW_LOG_DEBUG;
+ switch (argc)
+ {
+ case 3:
+ gw_log (mask, mod, "%s", argv[2]);
+ break;
+ case 4:
+ gw_log (mask, mod, "%s %s", argv[2], argv[3]);
+ break;
+ case 5:
+ gw_log (mask, mod, "%s %s %s", argv[2], argv[3], argv[4]);
+ break;
+ case 6:
+ gw_log (mask, mod, "%s %s %s %s", argv[2], argv[3], argv[4], argv[5]);
+ break;
+ }
+ return TCL_OK;
+}
+
+
int Tcl_AppInit (Tcl_Interp *interp)
{
if (Tcl_Init (interp) == TCL_ERROR)
@@ -220,6 +265,7 @@ static void *do_create (WCLIENT wcl, void *args)
Tcl_CreateCommand (p->interp, "wform", proc_wform_invoke, p, NULL);
Tcl_CreateCommand (p->interp, "wabort", proc_wabort_invoke, p, NULL);
Tcl_CreateCommand (p->interp, "wflush", proc_wflush_invoke, p, NULL);
+ Tcl_CreateCommand (p->interp, "wlog", proc_wlog_invoke, p, NULL);
sprintf (tmp_str, "%d", wcl->id);
Tcl_SetVar (p->interp, "sessionId", tmp_str, TCL_GLOBAL_ONLY);
return p;
@@ -228,6 +274,8 @@ static void *do_create (WCLIENT wcl, void *args)
static void report_error (struct tcl_info *p, int errorLine,
const char *pre, const char *msg)
{
+ if (!msg)
+ msg = "";
gw_log (GW_LOG_WARN, mod, "%s %d %s", pre, errorLine, msg);
wo_printf (p->wcl, "\n