New function egw_prog that returns name of shell.
[egate.git] / www / wtcl.c
index 542c67d..c75f8a4 100644 (file)
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * $Log: wtcl.c,v $
- * Revision 1.12  1996/03/07 12:45:34  adam
+ * Revision 1.13  1996/03/14 11:48:40  adam
+ * New function egw_prog that returns name of shell.
+ *
+ * Revision 1.12  1996/03/07  12:45:34  adam
  * New Tcl calls egw_enc/egw_dec to encode/decode binary URL info.
  *
  * Revision 1.11  1996/01/24  08:26:56  adam
@@ -291,6 +294,14 @@ static int proc_dec (ClientData clientData, Tcl_Interp *interp,
     return TCL_OK;
 }
 
+static int proc_prog (ClientData clientData, Tcl_Interp *interp,
+                      int argc, char **argv)
+{
+    struct tcl_info *p = (struct tcl_info*) clientData;
+
+    Tcl_AppendResult (p->interp, p->wcl->prog, NULL);
+    return TCL_OK;
+}
 
 int Tcl_AppInit (Tcl_Interp *interp)
 {
@@ -329,6 +340,7 @@ static void *do_create (WCLIENT wcl, void *args)
     Tcl_CreateCommand (p->interp, "egw_log", proc_wlog_invoke, p, NULL);
     Tcl_CreateCommand (p->interp, "egw_enc", proc_enc, p, NULL);
     Tcl_CreateCommand (p->interp, "egw_dec", proc_dec, p, NULL);
+    Tcl_CreateCommand (p->interp, "egw_prog", proc_prog, p, NULL);
     sprintf (tmp_str, "%d", wcl->id);
     Tcl_SetVar (p->interp, "sessionId", tmp_str, TCL_GLOBAL_ONLY);
     return p;