First kick of NWI extension to the Europgate WWW-Z39.50 gateway.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 29 Feb 1996 15:32:21 +0000 (15:32 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 29 Feb 1996 15:32:21 +0000 (15:32 +0000)
www/waissh.c [new file with mode: 0644]
www/wwaistcl.c [new file with mode: 0644]
www/wwaistcl.h [new file with mode: 0644]

diff --git a/www/waissh.c b/www/waissh.c
new file mode 100644 (file)
index 0000000..af6ef69
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * NWI - Nordic Web Index 
+ * Technical Knowledge Centre & Library of Denmark (DTV)
+ *
+ * Shell program for the Wais extension to Europagate/IrTcl
+ *
+ * $Log: waissh.c,v $
+ * Revision 1.1  1996/02/29 15:32:21  adam
+ * First kick of NWI extension to the Europgate WWW-Z39.50 gateway.
+ *
+ */
+
+#include <stdio.h>
+
+#include "wwaistcl.h"
+
+int main (int argc, char **argv)
+{
+    wshmain (argc, argv, w_interp_waistcl);
+    exit (0);
+}
+
+
diff --git a/www/wwaistcl.c b/www/wwaistcl.c
new file mode 100644 (file)
index 0000000..9ab4490
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * NWI - Nordic Web Index 
+ * Technical Knowledge Centre & Library of Denmark (DTV)
+ *
+ * Wais extension to Europagate/IrTcl
+ *
+ * $Log: wwaistcl.c,v $
+ * Revision 1.1  1996/02/29 15:32:21  adam
+ * First kick of NWI extension to the Europgate WWW-Z39.50 gateway.
+ *
+ */
+
+#include <log.h>
+#include "wirtcl.h"
+#include "wwaistcl.h"
+
+static void *do_create (WCLIENT wcl, void *args);
+static int do_exec (const char *fname, char *parms, void *mydata);
+static int do_load (char *parms, void *mydata);
+static int do_save (char *parms, void *mydata);
+
+static struct w_interp_type w_interp_t = {
+    "waistcl",
+    do_create,
+    do_exec,
+    do_load,
+    do_save
+};
+
+W_Interp_Type w_interp_waistcl = &w_interp_t;
+
+static char *mod = "wwaistcl";
+
+struct waistcl_info {
+    W_Interp w_interp;
+    Tcl_Interp *interp;
+    WCLIENT wcl;
+};
+
+static void *do_create (WCLIENT wcl, void *args)
+{
+    struct waistcl_info *p;
+
+    if (!(p = malloc (sizeof(*p))))
+    {
+        gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, mod, "malloc: waistcl_info");
+        exit (1);
+    }
+    if (!(p->w_interp = w_interp_create (w_interp_irtcl, wcl, NULL)))
+    {
+        gw_log (GW_LOG_FATAL, mod, "Cannot make IrTcl_Interp");
+        exit (1);
+    }
+    p->wcl = wcl;
+    p->interp = w_interp_irtcl_get (p->w_interp);
+    if (Waistcl_Init(p->interp) == TCL_ERROR)
+    {
+        gw_log (GW_LOG_FATAL, mod, "Cannot make Waistcl_Interp");
+        exit (1);
+    }
+    return p;
+}
+
+static int do_exec (const char *fname, char *parms, void *mydata)
+{
+    struct waistcl_info *p = mydata;
+    int r;
+    if ((r = w_interp_exec (p->w_interp, fname, parms)))
+        return r;
+    return 0;
+}
+
+static int do_load (char *parms, void *mydata)
+{
+    struct waistcl_info *p = mydata;
+
+    return w_interp_load_state (p->w_interp, parms);
+}
+
+static int do_save (char *parms, void *mydata)
+{
+    struct waistcl_info *p = mydata;
+
+    return w_interp_save_state (p->w_interp, parms);
+}
+
+
+
+
diff --git a/www/wwaistcl.h b/www/wwaistcl.h
new file mode 100644 (file)
index 0000000..45b232a
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * NWI - Nordic Web Index 
+ * Technical Knowledge Centre & Library of Denmark (DTV)
+ *
+ * Wais extension to Europagate/IrTcl
+ *
+ * $Log: wwaistcl.h,v $
+ * Revision 1.1  1996/02/29 15:32:21  adam
+ * First kick of NWI extension to the Europgate WWW-Z39.50 gateway.
+ *
+ */
+
+#ifndef WWAISTCL_H
+#define WWAISTCL_H
+
+#include "winterp.h"
+#include <tcl.h>
+#include <ir-tcl.h>
+
+extern W_Interp_Type w_interp_waistcl;
+
+#endif