From: Adam Dickmeiss Date: Thu, 29 Feb 1996 15:32:21 +0000 (+0000) Subject: First kick of NWI extension to the Europgate WWW-Z39.50 gateway. X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=76905cd622281a44b7d42158e3feb13f0271335f;p=egate.git First kick of NWI extension to the Europgate WWW-Z39.50 gateway. --- diff --git a/www/waissh.c b/www/waissh.c new file mode 100644 index 0000000..af6ef69 --- /dev/null +++ b/www/waissh.c @@ -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 + +#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 index 0000000..9ab4490 --- /dev/null +++ b/www/wwaistcl.c @@ -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 +#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 index 0000000..45b232a --- /dev/null +++ b/www/wwaistcl.h @@ -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 +#include + +extern W_Interp_Type w_interp_waistcl; + +#endif