* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wcgi.c,v $
- * Revision 1.17 1996/02/26 10:36:15 adam
+ * Revision 1.18 1996/03/14 11:48:37 adam
+ * New function egw_prog that returns name of shell.
+ *
+ * Revision 1.17 1996/02/26 10:36:15 adam
* Better error handling when (re)spawn of the shell fails.
*
* Revision 1.16 1996/02/12 10:10:29 adam
#include <sys/select.h>
#endif
-#define DEADSTRING "Your database server has terminated. To reactivate \
-the server, please reload the server's 'front page'."
-
#include <gw-db.h>
#include <gw-res.h>
#include "wproto.h"
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wproto.c,v $
- * Revision 1.18 1996/02/12 10:09:23 adam
+ * Revision 1.19 1996/03/14 11:48:39 adam
+ * New function egw_prog that returns name of shell.
+ *
+ * Revision 1.18 1996/02/12 10:09:23 adam
* New parameter to wproto_init: directory root for the FIFOs (instead
* of using preprocessor defines FIFODIR/FIFOROOT).
*
}
}
-WCLIENT wproto_init (const char *fifoDir)
+WCLIENT wproto_init (const char *fifoDir, const char *prog)
{
char *val, path2[256];
wclient_data *new;
gw_log (GW_LOG_FATAL, mod, "GWID not set");
exit (1);
}
+ if (!(new->prog = malloc (strlen(prog)+1)))
+ {
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, mod, "malloc");
+ exit (1);
+ }
+ strcpy (new->prog, prog);
new->fifoDir = fifoDir;
new->id = atoi (val);
sprintf(new->path, "%s/clt%d", new->fifoDir, new->id);
void wproto_terminate(WCLIENT wc)
{
+ free (wc->prog);
close(wc->linein);
unlink(wc->path);
wproto_uncache(wc, 0);
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wproto.h,v $
- * Revision 1.8 1996/02/12 10:09:25 adam
+ * Revision 1.9 1996/03/14 11:48:39 adam
+ * New function egw_prog that returns name of shell.
+ *
+ * Revision 1.8 1996/02/12 10:09:25 adam
* New parameter to wproto_init: directory root for the FIFOs (instead
* of using preprocessor defines FIFODIR/FIFOROOT).
*
typedef struct wclient_data
{
int id;
+ char *prog;
wform_data wf_data[100];
char wf_parms[512];
char wf_serverp[512];
char *wgetval (WCLIENT wc, char *name);
int wproto_process (WCLIENT wc, int timeout);
-WCLIENT wproto_init (const char *fifoDir);
+WCLIENT wproto_init (const char *fifoDir, const char *prog);
void wo_printf (WCLIENT wc, const char *fmt, ...);
void wo_clear (WCLIENT wc, const char *type);
int wo_finish (WCLIENT wc);
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wshmain.c,v $
- * Revision 1.2 1996/03/08 16:47:06 adam
+ * Revision 1.3 1996/03/14 11:48:39 adam
+ * New function egw_prog that returns name of shell.
+ *
+ * Revision 1.2 1996/03/08 16:47:06 adam
* Logs of changes.
*
* Revision 1.1 1996/02/29 15:36:34 adam
gw_log_level (gw_log_mask_str (
gw_res_get (shRes, "log.level", "default")));
#endif
- if (!(wcl = wproto_init (gw_res_get (shRes, "fifo.dir", "/tmp/egw"))))
+ if (!(wcl = wproto_init (gw_res_get (shRes, "fifo.dir", "/tmp/egw"),
+ *argv)))
{
gw_log (GW_LOG_FATAL, mod, "init");
exit(1);
* 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
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)
{
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;