Record presentation.
[egate.git] / www / wtcl.c
index f8273cb..7a0cb26 100644 (file)
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wtcl.c,v $
- * Revision 1.6  1995/10/31 10:03:54  adam
+ * Revision 1.7  1995/10/31 16:56:25  adam
+ * Record presentation.
+ *
+ * Revision 1.6  1995/10/31  10:03:54  adam
  * Work on queries.
  * New command implemented - aborts script.
  *
@@ -118,6 +121,15 @@ static int proc_wabort_invoke (ClientData clientData, Tcl_Interp *interp,
     return TCL_RETURN;
 }
 
+static int proc_wflush_invoke (ClientData clientData, Tcl_Interp *interp,
+                               int argc, char **argv)
+{
+    struct tcl_info *p = (struct tcl_info*) clientData;
+
+    wo_flush (p->wcl);
+    return TCL_OK;
+}
+
 static int proc_html_invoke (ClientData clientData, Tcl_Interp *interp,
                              int argc, char **argv)
 {
@@ -140,14 +152,17 @@ static int proc_htmlr_invoke (ClientData clientData, Tcl_Interp *interp,
     return r;
 }
 
-static int proc_form_invoke (ClientData clientData, Tcl_Interp *interp,
-                             int argc, char **argv)
+static int proc_wform_invoke (ClientData clientData, Tcl_Interp *interp,
+                              int argc, char **argv)
 {
     struct tcl_info *p = (struct tcl_info*) clientData;
     int i;
     if (argc == 2)
     {
-        Tcl_AppendResult (p->interp, wgetval (p->wcl, argv[1]), NULL);
+        for (i = 0; *p->wcl->wf_data[i].name; i++)
+            if (!strcmp (argv[1], p->wcl->wf_data[i].name) && 
+                *p->wcl->wf_data[i].value)
+                Tcl_AppendElement (p->interp, p->wcl->wf_data[i].value);
         return TCL_OK;
     }    
     for (i = 0; *p->wcl->wf_data[i].name; i++)
@@ -192,8 +207,9 @@ static void *do_create (WCLIENT wcl, void *args)
     Tcl_AppInit (p->interp);
     Tcl_CreateCommand (p->interp, "html", proc_html_invoke, p, NULL);
     Tcl_CreateCommand (p->interp, "htmlr", proc_htmlr_invoke, p, NULL);
-    Tcl_CreateCommand (p->interp, "form", proc_form_invoke, p, NULL);
+    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);
     sprintf (tmp_str, "%d", wcl->id);
     Tcl_SetVar (p->interp, "sessionId", tmp_str, TCL_GLOBAL_ONLY);
     return p;