2 * NWI - Nordic Web Index
3 * Technical Knowledge Centre & Library of Denmark (DTV)
5 * Wais extension to Europagate/IrTcl
8 * Revision 1.1 1996/02/29 15:32:21 adam
9 * First kick of NWI extension to the Europgate WWW-Z39.50 gateway.
17 static void *do_create (WCLIENT wcl, void *args);
18 static int do_exec (const char *fname, char *parms, void *mydata);
19 static int do_load (char *parms, void *mydata);
20 static int do_save (char *parms, void *mydata);
22 static struct w_interp_type w_interp_t = {
30 W_Interp_Type w_interp_waistcl = &w_interp_t;
32 static char *mod = "wwaistcl";
40 static void *do_create (WCLIENT wcl, void *args)
42 struct waistcl_info *p;
44 if (!(p = malloc (sizeof(*p))))
46 gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, mod, "malloc: waistcl_info");
49 if (!(p->w_interp = w_interp_create (w_interp_irtcl, wcl, NULL)))
51 gw_log (GW_LOG_FATAL, mod, "Cannot make IrTcl_Interp");
55 p->interp = w_interp_irtcl_get (p->w_interp);
56 if (Waistcl_Init(p->interp) == TCL_ERROR)
58 gw_log (GW_LOG_FATAL, mod, "Cannot make Waistcl_Interp");
64 static int do_exec (const char *fname, char *parms, void *mydata)
66 struct waistcl_info *p = mydata;
68 if ((r = w_interp_exec (p->w_interp, fname, parms)))
73 static int do_load (char *parms, void *mydata)
75 struct waistcl_info *p = mydata;
77 return w_interp_load_state (p->w_interp, parms);
80 static int do_save (char *parms, void *mydata)
82 struct waistcl_info *p = mydata;
84 return w_interp_save_state (p->w_interp, parms);