# Europagate, 1995
#
# $Log: Makefile,v $
-# Revision 1.5 1995/10/27 15:12:02 adam
+# Revision 1.6 1995/10/27 17:30:15 adam
+# First search request/response that works.
+#
+# Revision 1.5 1995/10/27 15:12:02 adam
# IrTcl incorporated in the gateway.
# Better separation of script types.
# Z39.50 gateway scripts entered.
$(TPROG3): $(P3)
$(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB)
-install: $(TPROG1) $(TPROG2)
+install: install.prog install.script
+
+install.prog: $(TPROG1) $(TPROG2)
@for x in $(TPROG1) $(TPROG2); do \
echo Installing $$x; \
cp $$x $(CGIBIN); \
ln -f $(CGIBIN)/$(TPROG2) $(CGIBIN)/egwtcl; \
ln -f $(CGIBIN)/$(TPROG2) $(CGIBIN)/egwirtcl; \
ln -f $(CGIBIN)/$(TPROG2) $(CGIBIN)/egwhtml
+
+install.script:
@for x in $(WSCRIPTS); do \
echo Installing $$x; \
cp $$x $(CGIBIN); \
<html>
{
-# $Id: query.egw,v 1.2 1995/10/27 15:12:04 adam Exp $
+# $Id: query.egw,v 1.3 1995/10/27 17:30:15 adam Exp $
+proc fail-response {} {
+ global sessionWait
+ htmlr {Init fail<br>}
+ set sessionWait 0
+}
+
proc init-response {} {
global sessionWait
htmlr {Init ok <br>}
set t $sessionParms
set databases [lindex $targets($t) 1]
- ir z39
set sessionWait 1
+ ir z39
+ z39 failback fail-response
z39 connect $t
z39 callback init-response
z39 init
<html>
{
-# $Id: search.egw,v 1.1 1995/10/23 17:04:17 adam Exp $
+# $Id: search.egw,v 1.2 1995/10/27 17:30:16 adam Exp $
+
+proc search-response {} {
+ global sessionWait
+ set sessionWait 0
+
+ htmlr "search response <br>"
+ set r [z39.1 resultCount]
+ htmlr "<strong>$r hits</strong><br>"
+ htmlr "</body></html>"
+}
+
+proc fail-response {} {
+ global sessionWait
+ set sessionWait 0
+
+ htmlr "<strong>failed</strong><br>"
+ htmlr "</body></html>"
+}
+
+ global sessionWait
+
+ z39 callback search-response
+ z39 failback fail-response
+ set sessionWait 1
+ ir-set z39.1 z39
+ z39.1 databaseNames [form base]
+ z39.1 search [form entry1]
+ htmlr <head>
+ htmlr "<title> WWW/Z39.50 Gateway Search Result ...</title>"
}
-<head>
-<title> WWW/Z39.50 Gateway Search Result</title>
</head>
<body>
sessionId: {html $sessionId} <br>
target: {html $t} <br>
databases: {html $databases} <br>
<h2> Search in databases </h2>
-<h1> <blink> Not Functional Yet </blink> </h1>
-</body>
-</html>
+{
+ htmlr [form entry1] <br>
+}
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wirtcl.c,v $
- * Revision 1.1 1995/10/27 15:12:08 adam
+ * Revision 1.2 1995/10/27 17:30:16 adam
+ * First search request/response that works.
+ *
+ * Revision 1.1 1995/10/27 15:12:08 adam
* IrTcl incorporated in the gateway.
* Better separation of script types.
* Z39.50 gateway scripts entered.
WCLIENT wcl;
};
+
+/* select(2) callbacks */
+struct callback {
+ void (*r_handle)(ClientData);
+ void (*w_handle)(ClientData);
+ void (*x_handle)(ClientData);
+ void *obj;
+};
+#define MAX_CALLBACK 200
+
+static struct callback callback_table[MAX_CALLBACK];
+static int max_fd = 3; /* don't worry: it will grow... */
+
static void *do_create (WCLIENT wcl, void *args)
{
struct tcl_info *p;
+ int i;
if (!(p = malloc (sizeof(*p))))
{
exit (1);
}
/* initialize irtcl */
+ for (i=0; i<MAX_CALLBACK; i++)
+ {
+ callback_table[i].r_handle = NULL;
+ callback_table[i].w_handle = NULL;
+ callback_table[i].x_handle = NULL;
+ }
return p;
}
-/* select(2) callbacks */
-struct callback {
- void (*r_handle)(ClientData);
- void (*w_handle)(ClientData);
- void (*x_handle)(ClientData);
- void *obj;
-};
-#define MAX_CALLBACK 200
-
-static struct callback callback_table[MAX_CALLBACK];
-static int max_fd = 3; /* don't worry: it will grow... */
static int do_exec (const char *fname, char *parms, void *mydata)
{
static fd_set fdset_tcl_w;
static fd_set fdset_tcl_x;
- for (i=0; i<MAX_CALLBACK; i++)
- {
- callback_table[i].r_handle = NULL;
- callback_table[i].w_handle = NULL;
- callback_table[i].x_handle = NULL;
- }
if ((r = w_interp_exec (p->w_interp, fname, parms)))
return r;
while (1)
FD_ZERO (&fdset_tcl_r);
FD_ZERO (&fdset_tcl_w);
FD_ZERO (&fdset_tcl_x);
+
+ if ((cp=Tcl_GetVar (p->interp, "sessionWait", 0)) && !strcmp (cp, "0"))
+ return 0;
for (r=0, i=min_fd; i<=max_fd; i++)
{
if (callback_table[i].w_handle)
(*callback_table[i].x_handle) (callback_table[i].obj);
}
}
- if ((cp=Tcl_GetVar (p->interp, "sessionWait", 0)) && !strcmp (cp, "0"))
- return 0;
}
return 0;
}
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wtcl.c,v $
- * Revision 1.3 1995/10/27 15:12:14 adam
+ * Revision 1.4 1995/10/27 17:30:16 adam
+ * First search request/response that works.
+ *
+ * Revision 1.3 1995/10/27 15:12:14 adam
* IrTcl incorporated in the gateway.
* Better separation of script types.
* Z39.50 gateway scripts entered.
static void report_error (struct tcl_info *p, int errorLine,
const char *pre, const char *msg)
{
- gw_log (GW_LOG_WARN, "%s %d\%s", pre, errorLine, msg);
+ gw_log (GW_LOG_WARN, mod, "%s %d %s", pre, errorLine, msg);
wo_printf (p->wcl, "\n<br><hr>\n<strong>"
"%s %d</strong><br>\n", pre, errorLine);
wo_printf (p->wcl, "<xmp>\n%s</xmp>\n<hr>\n", msg);