* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wproto.c,v $
- * Revision 1.20 1996/05/21 14:53:04 adam
+ * Revision 1.21 1996/05/23 15:53:11 adam
+ * Bug fix: egw_enc failed on 8-bit chars.
+ * New command: egw_parms.
+ *
+ * Revision 1.20 1996/05/21 14:53:04 adam
* Tcl command wform extented; options -raw and -exists added.
*
* Revision 1.19 1996/03/14 11:48:39 adam
p++;
for (t = wc->wf_serverf; (*t = *p); t++, p++);
p++;
+ for (t = wc->wf_script; *p && *p != '/'; t++, p++)
+ *t = *p;
+ *t = '\0';
+ if (*p)
+ p++;
+ decode_form (wc->wf_parms_var, p);
for (t = wc->wf_parms; (*t = *p); t++, p++);
p++;
p++; /* we don't deal with envvars yet */
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wtcl.c,v $
- * Revision 1.15 1996/05/22 16:50:27 adam
+ * Revision 1.16 1996/05/23 15:53:12 adam
+ * Bug fix: egw_enc failed on 8-bit chars.
+ * New command: egw_parms.
+ *
+ * Revision 1.15 1996/05/22 16:50:27 adam
* Bug fix.
*
* Revision 1.14 1996/05/21 14:53:04 adam
return TCL_OK;
}
-static int proc_wform_invoke (ClientData clientData, Tcl_Interp *interp,
- int argc, char **argv)
+static int proc_form_invoke (struct tcl_info *p, wform_data *wfdata,
+ Tcl_Interp *interp,
+ int argc, char **argv)
{
- struct tcl_info *p = (struct tcl_info*) clientData;
const char *arg = NULL;
int failFlag = 0;
int i;
arg = argv[1];
if (arg)
{
- for (i = 0; *p->wcl->wf_data[i].name; i++)
- if (!strcmp (arg, p->wcl->wf_data[i].name))
+ for (i = 0; *wfdata[i].name; i++)
+ if (!strcmp (arg, wfdata[i].name))
{
failFlag = 0;
- if (*p->wcl->wf_data[i].value)
- Tcl_AppendElement (p->interp, p->wcl->wf_data[i].value);
+ if (*wfdata[i].value)
+ Tcl_AppendElement (p->interp, wfdata[i].value);
}
if (failFlag)
{
}
return TCL_OK;
}
- for (i = 0; *p->wcl->wf_data[i].name; i++)
+ for (i = 0; *wfdata[i].name; i++)
{
Tcl_AppendResult (p->interp, "{ ", NULL);
- Tcl_AppendElement (p->interp, p->wcl->wf_data[i].name);
- Tcl_AppendElement (p->interp, p->wcl->wf_data[i].value);
+ Tcl_AppendElement (p->interp, wfdata[i].name);
+ Tcl_AppendElement (p->interp, wfdata[i].value);
Tcl_AppendResult (p->interp, " }\n", NULL);
}
return TCL_OK;
}
+static int proc_wform_invoke (ClientData clientData, Tcl_Interp *interp,
+ int argc, char **argv)
+{
+ struct tcl_info *p = (struct tcl_info*) clientData;
+ wform_data *wfdata = p->wcl->wf_data;
+ return proc_form_invoke (p, wfdata, interp, argc, argv);
+}
+
+static int proc_parms_invoke (ClientData clientData, Tcl_Interp *interp,
+ int argc, char **argv)
+{
+ struct tcl_info *p = (struct tcl_info*) clientData;
+ wform_data *wfdata = p->wcl->wf_parms_var;
+ return proc_form_invoke (p, wfdata, interp, argc, argv);
+}
+
+
static int proc_wlog_invoke (ClientData clientData, Tcl_Interp *interp,
int argc, char **argv)
{
int argc, char **argv)
{
int i;
- char buf1[4];
+ char buf1[6];
char buf2[2];
buf1[0] = '%';
if (*cp <= ' ' || *cp >= 127 || *cp == '/' || *cp == ' ' ||
*cp == '&' || *cp == ':' || *cp == '%')
{
- sprintf (buf1+1, "%02X", *cp);
+ sprintf (buf1+1, "%02X", *cp & 0xff);
Tcl_AppendResult (interp, buf1, NULL);
}
else
Tcl_AppInit (p->interp);
Tcl_CreateCommand (p->interp, "html", proc_html_invoke, p, NULL);
Tcl_CreateCommand (p->interp, "egw_form", proc_wform_invoke, p, NULL);
+ Tcl_CreateCommand (p->interp, "egw_parms", proc_parms_invoke, p, NULL);
Tcl_CreateCommand (p->interp, "egw_abort", proc_wabort_invoke, p, NULL);
Tcl_CreateCommand (p->interp, "egw_flush", proc_wflush_invoke, p, NULL);
Tcl_CreateCommand (p->interp, "egw_log", proc_wlog_invoke, p, NULL);