From 931e3064081dadcc5beeaa4319f85dcbb7d764b3 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sun, 25 Jun 1995 10:24:58 +0000 Subject: [PATCH] Working on triggerResourceControl. Description of compile/install procedure moved to ir-tcl.sgml. --- CHANGELOG | 23 +++++++++++++++++++ Makefile.in | 20 ++++++---------- README | 73 ++++------------------------------------------------------- ir-tcl.c | 54 ++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 88 insertions(+), 82 deletions(-) create mode 100644 CHANGELOG diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..fa3be03 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,23 @@ +$Id: CHANGELOG,v 1.1 1995-06-25 10:24:58 adam Exp $ + +06/19/95 Release of ir-tcl-1.0b +------------------------------------------------------ +06/20/95 Cancel mechanism changed in client.tcl. After a cancel, the + interface becomes 'ready' immediately. + +06/20/95 New setting: failInfo. It returns failback diagnostics. + +06/21/95 Bitmaps (book[1-9]) moved to subdirectory bitmaps. + +06/21/95 Install procedure change. GNU autoconf used to create the + Makefile. The user may type 'make install' to copy system files + to /usr/local/... + +06/22/95 SUTRS. New setting, 'getSutrs', to retrieve a SUTRS record + as a Tcl string. + +06/22/95 Display format routines (line.tcl,medium.tcl,raw.tcl) changed + to handle display of SUTRS records. + +06/22/95 Preferred record syntax can be specified by the user in client.tcl. + diff --git a/Makefile.in b/Makefile.in index 8f81cb7..5aacd02 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.5 1995-06-23 10:58:10 adam Exp $ +# $Id: Makefile.in,v 1.6 1995-06-25 10:24:59 adam Exp $ SHELL=/bin/sh # IrTcl Version @@ -17,6 +17,7 @@ exec_prefix = @exec_prefix@ BINDIR=$(exec_prefix)/bin LIBDIR=$(exec_prefix)/lib MANDIR=$(prefix)/man +INCDIR=$(prefix)/include IRTCLDIR=$(prefix)/lib/irtcl YAZDIR=@YAZDIR@ @@ -65,7 +66,7 @@ libirtcl.a: $(O) ar qc libirtcl.a $(O) $(RANLIB) libirtcl.a -install-tcl: ir-tcl +install: ir-tcl for d in $(IRTCLDIR) $(IRTCLDIR)/formats $(IRTCLDIR)/bitmaps; do \ if [ ! -d $$d ]; then \ echo Making $$d; \ @@ -74,19 +75,12 @@ install-tcl: ir-tcl fi; \ done; $(INSTALL_PROGRAM) ir-tcl $(BINDIR) - -install-tk: ir-tk - for d in $(IRTCLDIR) $(IRTCLDIR)/formats $(IRTCLDIR)/bitmaps; do \ - if [ ! -d $$d ]; then \ - echo Making $$d; \ - mkdir $$d; \ - chmod 755 $$d; \ - fi; \ - done; + $(INSTALL_DATA) libirtcl.a $(LIBDIR) + $(INSTALL_DATA) ir-tcl.h $(INCDIR) + $(INSTALL_DATA) LICENSE clientrc.tcl $(IRTCLDIR) sed "s,^set libdir LIBDIR,set libdir $(IRTCLDIR)," client.bak - $(INSTALL_PROGRAM) ir-tk $(BINDIR) + if [ -f ir-tk ]; then $(INSTALL_PROGRAM) ir-tk $(BINDIR) $(INSTALL_DATA) client.bak $(IRTCLDIR)/client.tcl - $(INSTALL_DATA) LICENSE clientrc.tcl $(IRTCLDIR) $(INSTALL_DATA) formats/*.tcl $(IRTCLDIR)/formats $(INSTALL_DATA) bitmaps/book? $(IRTCLDIR)/bitmaps diff --git a/README b/README index e3cd9cf..b94a795 100644 --- a/README +++ b/README @@ -3,76 +3,13 @@ * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss -$Revision: 1.5 $ +$Revision: 1.6 $ -Notes about IrTcl 1.0beta. +Documentation can be found in the doc directory. -Prerequisites -------------- - -In order to compile you need: - - o An ANSI-C compiler such as GNU C - o Tcl version 7.3 - o YAZ version 1.0 or higher - -You may also need: - - o Tk version 3.6 - o The XTI/mosi package - -Compilation ------------ - - o Compile/install yaz/tcl, etc. - - o Edit Makefile (in current directory). - Set MOSI to 1/0. - Define include directory paths and libraries. - - o Type 'make ir-tcl' to make the Tcl version or IrTcl. - o Type 'make ir-tk' to make the Tk version of IrTcl. - -Install/run ------------ - -The resulting files are: - ir-tcl Tcl version of IrTcl - ir-tk Tk version of IrTcl. - Options: - -file - Tcl startup script. Default is client.tcl. - -geometry - X11 geometry of main window. - -display - X11 display. - -name - Name of top window. - -logLevel - log level. (fatal, debug, warn, log, all). - -logFile - log file. If omitted stderr is used. - formats/*.tcl Small IrTcl scripts to display records in - different formats. - client.tcl Tk graphical client - normally executed by ir-tk. - clientrc.tcl Startup script - read by client.tcl - holds - user/target definitions. - clientg.tcl User preferrences - read by client.tcl. - Holds geometry of windows, current display - format, and hot targets. - book[1-9] book logo. - LICENSE License info - read by client.tcl. - -Type 'ir-tk' to run the Tk graphical client - client.tcl, -clientrc.tcl, book[1-9] and formats/*.tcl should exist! - -Type 'ir-tcl' to run the Tcl client. Very similar to tclsh. - -Information ------------ - -Documentation about the IrTcl API can be found in the doc directory - -ascii/postscript/HTML. + ir-tcl.txt - ascii version + ir-tcl.ps - postscript + ir-tcl.html - HTML. To get more information or assistance, send mail to yaz-help@index.ping.dk. diff --git a/ir-tcl.c b/ir-tcl.c index 30a3b5b..5b0e50e 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -5,7 +5,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.46 1995-06-22 13:15:06 adam + * Revision 1.47 1995-06-25 10:25:04 adam + * Working on triggerResourceControl. Description of compile/install + * procedure moved to ir-tcl.sgml. + * + * Revision 1.46 1995/06/22 13:15:06 adam * Feature: SUTRS. Setting getSutrs implemented. * Work on display formats. * Preferred record syntax can be set by the user. @@ -1151,6 +1155,53 @@ static int do_protocol (void *o, Tcl_Interp *interp, int argc, char **argv) } /* + * do_triggerResourceControl: + */ +static int do_triggerResourceControl (void *obj, Tcl_Interp *interp, + int argc, char **argv) +{ + IrTcl_Obj *p = obj; + Z_APDU *apdu; + Z_TriggerResourceControlRequest *req; + int r; + + if (argc <= 0) + return TCL_OK; + if (!p->cs_link) + { + interp->result = "not connected"; + return TCL_ERROR; + } + apdu = zget_APDU (p->odr_out, Z_APDU_triggerResourceControlRequest); + req = apdu->u.triggerResourceControlRequest; + + if (!z_APDU (p->odr_out, &apdu, 0)) + { + Tcl_AppendResult (interp, odr_errlist [odr_geterror (p->odr_out)], + NULL); + odr_reset (p->odr_out); + return TCL_ERROR; + } + p->sbuf = odr_getbuf (p->odr_out, &p->slen, NULL); + if ((r=cs_put (p->cs_link, p->sbuf, p->slen)) < 0) + { + interp->result = "cs_put failed in triggerResourceControl"; + do_disconnect (p, NULL, 2, NULL); + return TCL_ERROR; + } + else if (r == 1) + { + ir_select_add_write (cs_fileno(p->cs_link), p); + logf (LOG_DEBUG, "Sent part of triggerResourceControl (%d bytes)", + p->slen); + } + else + logf (LOG_DEBUG, "Sent whole of triggerResourceControl (%d bytes)", + p->slen); + return TCL_OK; +} + +/* * do_databaseNames: specify database names */ static int do_databaseNames (void *obj, Tcl_Interp *interp, @@ -1379,6 +1430,7 @@ static IrTcl_Method ir_method_tab[] = { { 0, "initResult", do_initResult }, { 0, "disconnect", do_disconnect }, { 0, "callback", do_callback }, +{ 0, "triggerResourceControl", do_triggerResourceControl }, { 0, NULL, NULL} }; -- 1.7.10.4