From fdc81f8a51fab1968b43efabab47d367e33ead32 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 23 Feb 1996 17:31:38 +0000 Subject: [PATCH] More functions made available to the wais tcl extension. --- Makefile.in | 13 +++++++++++-- ir-tcl.c | 35 +++++++++++++++++++---------------- ir-tclp.h | 7 ++++++- tclmain.c | 9 ++++++++- 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9b14daf..1a23685 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,7 +2,7 @@ # (c) Index Data 1995 # See the file LICENSE for details. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.27 1996-01-11 12:36:24 adam Exp $ +# $Id: Makefile.in,v 1.28 1996-02-23 17:31:38 adam Exp $ SHELL=/bin/sh # IrTcl Version @@ -44,7 +44,7 @@ MOSIINC=@MOSIINC@ YAZLIB=$(YAZDIR)/lib/libyaz.a $(MOSILIB) # All include paths -INCLUDE=-I$(YAZDIR)/include $(XINCLUDE) $(TCLINCLUDE) $(MOSIINC) +INCLUDE=-I. -I$(YAZDIR)/include $(XINCLUDE) $(TCLINCLUDE) $(MOSIINC) # All command line options except CFLAGS DEFS=-DCCL2RPN=0 @DEFS@ -DMOSI=$(MOSI) -DIRTCLDIR=\"$(IRTCLDIR)\" \ @@ -66,6 +66,15 @@ ir-tk: libirtcl.a tkinit.o ir-tcl: libirtcl.a tclmain.o $(CC) $(CFLAGS) tclmain.o -o ir-tcl libirtcl.a $(YAZLIB) $(TCLLIB) $(LIBS) +wais-tcl: libirtcl.a wais-tcl.o waismain.o + $(CC) $(CFLAGS) wais-tcl.o waismain.o -o wais-tcl libirtcl.a $(YAZLIB) $(TCLLIB) $(LIBS) + +waismain.o: tclmain.c + $(CC) -c $(CFLAGS) -DUSE_WAIS=1 $(DEFS) tclmain.c -o waismain.o + +wais-tcl.o: wais-tcl.c + $(CC) -c $(CFLAGS) -I/home/proj/freeWAIS-sf/freeWAIS-sf-2.0.60/ir $(DEFS) wais-tcl.c + libirtcl.a: $(O) rm -f libirtcl.a ar qc libirtcl.a $(O) diff --git a/ir-tcl.c b/ir-tcl.c index a9fa47a..f397668 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -5,7 +5,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.79 1996-02-23 13:41:38 adam + * Revision 1.80 1996-02-23 17:31:39 adam + * More functions made available to the wais tcl extension. + * + * Revision 1.79 1996/02/23 13:41:38 adam * Work on public access to simple ir class system. * * Revision 1.78 1996/02/21 10:16:08 adam @@ -359,9 +362,9 @@ static IrTcl_RecordList *new_IR_record (IrTcl_SetObj *setobj, } /* - * IrTcl_eval + * ir_tcl_eval */ -int IrTcl_eval (Tcl_Interp *interp, const char *command) +int ir_tcl_eval (Tcl_Interp *interp, const char *command) { char *tmp = ir_tcl_malloc (strlen(command)+1); int r; @@ -1084,7 +1087,7 @@ static int do_connect (void *obj, Tcl_Interp *interp, { p->state = IR_TCL_R_Idle; if (p->callback) - IrTcl_eval (p->interp, p->callback); + ir_tcl_eval (p->interp, p->callback); } } else @@ -1704,13 +1707,13 @@ static int ir_obj_method (ClientData clientData, Tcl_Interp *interp, if (argc < 2) return TCL_ERROR; - + tab[0].tab = ir_method_tab; tab[0].obj = p; tab[1].tab = ir_set_c_method_tab; tab[1].obj = &p->set_inher; tab[2].tab = NULL; - + return ir_tcl_method (interp, argc, argv, tab); } @@ -3426,14 +3429,14 @@ static void ir_select_read (ClientData clientData) if (p->failback) { p->failInfo = IR_TCL_FAIL_CONNECT; - IrTcl_eval (p->interp, p->failback); + ir_tcl_eval (p->interp, p->failback); } do_disconnect (p, NULL, 2, NULL); return; } p->state = IR_TCL_R_Idle; if (p->callback) - IrTcl_eval (p->interp, p->callback); + ir_tcl_eval (p->interp, p->callback); if (p->cs_link && p->request_queue && p->state == IR_TCL_R_Idle) ir_tcl_send_q (p, p->request_queue, "x"); return; @@ -3458,7 +3461,7 @@ static void ir_select_read (ClientData clientData) if (p->failback) { p->failInfo = IR_TCL_FAIL_READ; - IrTcl_eval (p->interp, p->failback); + ir_tcl_eval (p->interp, p->failback); } /* release ir object now if callback deleted it */ ir_obj_delete (p); @@ -3483,7 +3486,7 @@ static void ir_select_read (ClientData clientData) { p->failInfo = IR_TCL_FAIL_IN_APDU; p->apduOffset = odr_offset (p->odr_in); - IrTcl_eval (p->interp, p->failback); + ir_tcl_eval (p->interp, p->failback); } /* release ir object now if failback deleted it */ ir_obj_delete (p); @@ -3537,7 +3540,7 @@ static void ir_select_read (ClientData clientData) if (p->failback) { p->failInfo = IR_TCL_FAIL_UNKNOWN_APDU; - IrTcl_eval (p->interp, p->failback); + ir_tcl_eval (p->interp, p->failback); } return; } @@ -3546,9 +3549,9 @@ static void ir_select_read (ClientData clientData) p->state = IR_TCL_R_Idle; if (apdu_call) - IrTcl_eval (p->interp, apdu_call); + ir_tcl_eval (p->interp, apdu_call); else if (rq->callback) - IrTcl_eval (p->interp, rq->callback); + ir_tcl_eval (p->interp, rq->callback); free (rq->buf_out); free (rq->callback); free (rq->object_name); @@ -3593,7 +3596,7 @@ static void ir_select_write (ClientData clientData) if (p->failback) { p->failInfo = IR_TCL_FAIL_CONNECT; - IrTcl_eval (p->interp, p->failback); + ir_tcl_eval (p->interp, p->failback); } do_disconnect (p, NULL, 2, NULL); return; @@ -3604,7 +3607,7 @@ static void ir_select_write (ClientData clientData) ir_select_remove_write (cs_fileno (p->cs_link), p); #endif if (p->callback) - IrTcl_eval (p->interp, p->callback); + ir_tcl_eval (p->interp, p->callback); return; } rq = p->request_queue; @@ -3617,7 +3620,7 @@ static void ir_select_write (ClientData clientData) if (p->failback) { p->failInfo = IR_TCL_FAIL_WRITE; - IrTcl_eval (p->interp, p->failback); + ir_tcl_eval (p->interp, p->failback); } free (rq->buf_out); rq->buf_out = NULL; diff --git a/ir-tclp.h b/ir-tclp.h index c6bc62c..5cda7ff 100644 --- a/ir-tclp.h +++ b/ir-tclp.h @@ -5,7 +5,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tclp.h,v $ - * Revision 1.27 1996-02-23 13:41:41 adam + * Revision 1.28 1996-02-23 17:31:41 adam + * More functions made available to the wais tcl extension. + * + * Revision 1.27 1996/02/23 13:41:41 adam * Work on public access to simple ir class system. * * Revision 1.26 1996/02/21 10:16:20 adam @@ -374,6 +377,8 @@ void ir_select_add_write (int fd, void *obj); void ir_select_remove (int fd, void *obj); void ir_select_remove_write (int fd, void *obj); +int ir_tcl_eval (Tcl_Interp *interp, const char *command); + #define IR_TCL_FAIL_CONNECT 1 #define IR_TCL_FAIL_READ 2 #define IR_TCL_FAIL_WRITE 3 diff --git a/tclmain.c b/tclmain.c index 72f3fd1..bf27a74 100644 --- a/tclmain.c +++ b/tclmain.c @@ -5,7 +5,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: tclmain.c,v $ - * Revision 1.17 1996-02-21 10:16:21 adam + * Revision 1.18 1996-02-23 17:31:42 adam + * More functions made available to the wais tcl extension. + * + * Revision 1.17 1996/02/21 10:16:21 adam * Simplified select handling. Only one function ir_tcl_select_set has * to be externally defined. * @@ -92,6 +95,10 @@ int Tcl_AppInit (Tcl_Interp *interp) return TCL_ERROR; if (Irtcl_Init(interp) == TCL_ERROR) return TCL_ERROR; +#if USE_WAIS + if (Waistcl_Init(interp) == TCL_ERROR) + return TCL_ERROR; +#endif return TCL_OK; } -- 1.7.10.4