From 510fc2e05a3233005879413ae401865d91efe73e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 10 Jun 1998 13:00:44 +0000 Subject: [PATCH] Added ir-version command. --- CHANGELOG | 4 ++- client.tcl | 114 +++++++++++++++++++++++++++++++++++------------------------- ir-tcl.c | 26 +++++++++++--- irtdb.tcl | 82 +++++++++++++++++++++++++++++-------------- 4 files changed, 146 insertions(+), 80 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 51e8f81..7f9770e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -$Id: CHANGELOG,v 1.37 1998-05-20 12:27:41 adam Exp $ +$Id: CHANGELOG,v 1.38 1998-06-10 13:00:44 adam Exp $ 06/19/95 Release of ir-tcl-1.0b ------------------------------------------------------ @@ -121,3 +121,5 @@ $Id: CHANGELOG,v 1.37 1998-05-20 12:27:41 adam Exp $ 08/28/97 Added support for Tk8.0/Tcl8.0. 05/20/98 Updated Explain record support. + +06/10/98 Added ir-version command. diff --git a/client.tcl b/client.tcl index 9d8ff83..7e2ef83 100644 --- a/client.tcl +++ b/client.tcl @@ -4,7 +4,10 @@ # Sebastian Hammer, Adam Dickmeiss # # $Log: client.tcl,v $ -# Revision 1.104 1998-02-12 13:32:41 adam +# Revision 1.105 1998-06-10 13:00:45 adam +# Added ir-version command. +# +# Revision 1.104 1998/02/12 13:32:41 adam # Updated configuration system. # # Revision 1.103 1998/01/30 13:30:50 adam @@ -356,6 +359,7 @@ # # + # Procedure tk4 is defined - returns 0 if tk 3.6 - returns 1 otherwise if {$tk_version == "3.6"} { proc tk4 {} { @@ -743,6 +747,21 @@ proc post-menu {wbutton wmenu} { } +# Procedure place-force {window parent} +# window new top level widget +# parent parent widget used as base +# Sets geometry of $window relative to $parent window. +proc place-force {window parent} { + set g [wm geometry $parent] + + set p1 [string first + $g] + set p2 [string last + $g] + + set x [expr 40+[string range $g [expr $p1 +1] [expr $p2 -1]]] + set y [expr 60+[string range $g [expr $p2 +1] end]] + wm geometry $window +${x}+${y} +} + # Procedure destroyGW {w} # w top level widget # Saves geometry of widget w in windowGeometry array. This @@ -783,6 +802,25 @@ proc top-down-window {w} { pack $w.bot -fill both } +# Init: The geometry information for the main window is set - either +# to a default value or to the value in windowGeometry(.) +if {[catch {set g $windowGeometry(.)}]} { + wm geometry . 420x340+20+20 +} else { + wm geometry . $g +} + +# Init: The geometry information for the main window is set - either +# to a default value or to the value in windowGeometry(.) +toplevelG .init +place-force .init . +message .init.top -text "IrTcl" -relief raised -border 1 -font $font(bb,normal) +text .init.msg -width 30 -height 4 +pack .init.top -side top -fill x -expand yes +pack .init.msg -side bottom -fill both -expand yes +wm iconify . +update + # Procedure top-down-ok-cancel {w ok-action g} # w top level widget with $w.bot-frame # ok-action ok script @@ -1087,17 +1125,12 @@ proc about-origin {} { label $w.top.a.logo -bitmap @${libdir}/bitmaps/book1 pack $w.top.a.irtcl $w.top.a.logo -side left -expand yes - set i unknown - catch {set i [z39 implementationName]} - label $w.top.p.in -text "Implementation name: $i" - catch {set i [z39 implementationId]} - label $w.top.p.ii -text "Implementation id: $i" - catch {set i [z39 implementationVersion]} - label $w.top.p.iv -text "Implementation version: $i" - set i $tk_version - label $w.top.p.tk -text "Tk version: $i" + label $w.top.p.irtcl -text "IrTcl version: [lindex [ir-version] 0]" + label $w.top.p.yaz -text "Yaz version: [lindex [ir-version] 1]" - pack $w.top.p.in $w.top.p.ii $w.top.p.iv $w.top.p.tk -side top -anchor nw + label $w.top.p.tk -text "Tk version: $tk_version" + + pack $w.top.p.irtcl $w.top.p.yaz $w.top.p.tk -side top -anchor nw about-origin-logo 1 bottom-buttons $w [list {Close} [list destroy $w] \ @@ -2341,21 +2374,6 @@ proc protocol-setup-action {target w} { destroy $w } -# Procedure place-force {window parent} -# window new top level widget -# parent parent widget used as base -# Sets geometry of $window relative to $parent window. -proc place-force {window parent} { - set g [wm geometry $parent] - - set p1 [string first + $g] - set p2 [string last + $g] - - set x [expr 40+[string range $g [expr $p1 +1] [expr $p2 -1]]] - set y [expr 60+[string range $g [expr $p2 +1] end]] - wm geometry $window +${x}+${y} -} - # Procedure add-database-action {target w} # target target to be defined # w top level widget for the target definition @@ -3908,14 +3926,6 @@ proc search-fields {w buttondefs} { $w.0 configure -background red } -# Init: The geometry information for the main window is set - either -# to a default value or to the value in windowGeometry(.) -if {[catch {set g $windowGeometry(.)}]} { - wm geometry . 420x340 -} else { - wm geometry . $g -} - # Init: Presentation formats are read. read-formats @@ -4143,14 +4153,23 @@ pack .bot.a.status .bot.a.set .bot.a.message \ # Init: Determine if the IrTcl extension is already there. If # not, then dynamically load the IrTcl extension. -if {[catch {ir z39}]} { +set logLevel all +if {[catch {ir-version}]} { set e [info sharedlibextension] - puts -nonewline "Loading irtcl$e ..." + .init.msg insert end "Loading irtcl$e.\n" load ${libdir}/irtcl$e irtcl - ir z39 - puts "ok" + if {[catch {ir-version}]} { + load irtcl$e irtcl + } } +.init.msg insert end "IrTcl version [lindex [ir-version] 0]\n" +.init.msg insert end "YAZ version [lindex [ir-version] 1]\n" +ir-log-init all irtcl.log + +# Create Z Assocation +ir z39 + if {[file exists ${libdir}/explain.tcl]} { source ${libdir}/explain.tcl } @@ -4159,15 +4178,14 @@ if {[file exists ${libdir}/setup.tcl]} { source ${libdir}/setup.tcl } -# Init: Uncomment this line if you wan't to enable logging. -ir-log-init all irtcl irtcl.log +after 900 activateMainWindow -# Init: If hostid is a valid target, a new connection will be established -# immediately. -if {[string compare $hostid Default]} { - catch {open-target $hostid $hostbase} +proc activateMainWindow {} { + global hostid hostbase + destroy .init + wm deiconify . + if {[string compare $hostid Default]} { + catch {open-target $hostid $hostbase} + } + show-logo 1 } - -# Init: Enable the logo. -show-logo 1 - diff --git a/ir-tcl.c b/ir-tcl.c index 591914d..fc95e30 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -5,7 +5,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.106 1998-05-20 12:25:35 adam + * Revision 1.107 1998-06-10 13:00:46 adam + * Added ir-version command. + * + * Revision 1.106 1998/05/20 12:25:35 adam * Fixed bug that occurred in rare cases when encoding of incoming * records failed. * @@ -657,13 +660,14 @@ int ir_tcl_named_bits (struct ir_named_entry *tab, Odr_bitmask *ob, ODR_MASK_ZERO (ob); for (no = 0; no < argc; no++) { + int ok = 0; for (ti = tab; ti->name; ti++) - if (!strcmp (argv[no], ti->name)) + if (!strcmp(argv[no], "@all") || !strcmp (argv[no], ti->name)) { ODR_MASK_SET (ob, ti->pos); - break; + ok = 1; } - if (!ti->name) + if (!ok) { Tcl_AppendResult (interp, "bad bit mask ", argv[no], NULL); return ir_tcl_error_exec (interp, argc, argv); @@ -3489,6 +3493,18 @@ static int ir_log_proc (ClientData clientData, Tcl_Interp *interp, } +/* + * ir_version: log ir version + */ +static int ir_version (ClientData clientData, Tcl_Interp *interp, + int argc, char **argv) +{ + Tcl_AppendElement (interp, IR_TCL_VERSION); + Tcl_AppendElement (interp, YAZ_VERSION); + return TCL_OK; +} + + /* ------------------------------------------------------- */ static void ir_initResponse (void *obj, Z_InitResponse *initrs) { @@ -4203,6 +4219,8 @@ EXPORT (int,Irtcl_Init) (Tcl_Interp *interp) (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateCommand (interp, "ir-log", ir_log_proc, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateCommand (interp, "ir-version", ir_version, (ClientData) NULL, + (Tcl_CmdDeleteProc *) NULL); nmem_init (); return TCL_OK; } diff --git a/irtdb.tcl b/irtdb.tcl index 932684c..1aa771b 100644 --- a/irtdb.tcl +++ b/irtdb.tcl @@ -52,7 +52,7 @@ set {profile(Bell Laboratories Library Network,timeDefine)} 878567355 set {profile(Bell Laboratories Library Network,timeLastExplain)} 891519770 set {profile(Bell Laboratories Library Network,timeLastInit)} 891519770 set {profile(Bell Laboratories Library Network,welcomeMessage)} {Salutations - this is Lucent Technologies experimental Z39.50 server. No guarentees, but free and unlimited access!} -set {profile(Bell Laboratories Library Network,windowNumber)} 16 +set {profile(Bell Laboratories Library Network,windowNumber)} 17 set {profile(Bibliothèque Nationale du Québec,authentication)} {} set {profile(Bibliothèque Nationale du Québec,comstack)} tcpip set {profile(Bibliothèque Nationale du Québec,databases)} IRIS @@ -79,7 +79,7 @@ set {profile(Biblioth set {profile(Bibliothèque Nationale du Québec,timeLastExplain)} {} set {profile(Bibliothèque Nationale du Québec,timeLastInit)} 887288466 set {profile(Bibliothèque Nationale du Québec,welcomeMessage)} {} -set {profile(Bibliothèque Nationale du Québec,windowNumber)} 7 +set {profile(Bibliothèque Nationale du Québec,windowNumber)} 8 set {profile(British Library,authentication)} {} set {profile(British Library,comstack)} tcpip set {profile(British Library,databases)} {EXPLAIN MAR SRI} @@ -137,7 +137,7 @@ set profile(DanBib,timeDefine) 878567355 set profile(DanBib,timeLastExplain) 893854494 set profile(DanBib,timeLastInit) 893854061 set profile(DanBib,welcomeMessage) {} -set profile(DanBib,windowNumber) 4 +set profile(DanBib,windowNumber) 5 set profile(Default,authentication) {} set profile(Default,comstack) tcpip set profile(Default,description) {} @@ -163,7 +163,7 @@ set profile(Default,timeDefine) {} set profile(Default,timeLastExplain) {} set profile(Default,timeLastInit) {} set profile(Default,welcomeMessage) {} -set profile(Default,windowNumber) 20 +set profile(Default,windowNumber) 21 set profile(LOC,authentication) {} set profile(LOC,comstack) tcpip set profile(LOC,databases) {BOOKS NAMES AUTH MAPS MUSIC BIB SERIALS SUBJECTS} @@ -194,7 +194,7 @@ set profile(LOC,timeDefine) 878567355 set profile(LOC,timeLastExplain) {} set profile(LOC,timeLastInit) 891519824 set profile(LOC,welcomeMessage) {} -set profile(LOC,windowNumber) 11 +set profile(LOC,windowNumber) 12 set {profile(OCLC FirstSearch,authentication)} {} set {profile(OCLC FirstSearch,comstack)} tcpip set {profile(OCLC FirstSearch,databases)} {AGRICOLA MEDLINE} @@ -225,7 +225,7 @@ set {profile(OCLC FirstSearch,timeDefine)} {} set {profile(OCLC FirstSearch,timeLastExplain)} {} set {profile(OCLC FirstSearch,timeLastInit)} 886167890 set {profile(OCLC FirstSearch,welcomeMessage)} {} -set {profile(OCLC FirstSearch,windowNumber)} 15 +set {profile(OCLC FirstSearch,windowNumber)} 16 set profile(Penn,authentication) {} set profile(Penn,comstack) tcpip set profile(Penn,databases) CATALOG @@ -256,7 +256,7 @@ set profile(Penn,timeDefine) 878567355 set profile(Penn,timeLastExplain) {} set profile(Penn,timeLastInit) 887289434 set profile(Penn,welcomeMessage) {} -set profile(Penn,windowNumber) 19 +set profile(Penn,windowNumber) 20 set profile(Stein,authentication) {} set profile(Stein,comstack) tcpip set profile(Stein,databases) {lbopac miopac} @@ -283,9 +283,9 @@ set profile(Stein,smallSetUpperBound) 0 set profile(Stein,targetInfoName) {LB Z39.50-server} set profile(Stein,timeDefine) {} set profile(Stein,timeLastExplain) 893857722 -set profile(Stein,timeLastInit) 893857722 +set profile(Stein,timeLastInit) 897482265 set profile(Stein,welcomeMessage) {Welcome to the Z39.50 target of Steiermaerkische Landesbibliothek, Graz, Austria.} -set profile(Stein,windowNumber) 12 +set profile(Stein,windowNumber) 13 set profile(arcatarget,authentication) {} set profile(arcatarget,comstack) tcpip set profile(arcatarget,databases) {IEI-books IR-Explain-1} @@ -316,7 +316,7 @@ set profile(arcatarget,timeDefine) 878567355 set profile(arcatarget,timeLastExplain) 887289477 set profile(arcatarget,timeLastInit) 887289477 set profile(arcatarget,welcomeMessage) {buon lavoro} -set profile(arcatarget,windowNumber) 8 +set profile(arcatarget,windowNumber) 9 set profile(author,authentication) {} set profile(author,comstack) tcpip set profile(author,databases) {spain portugal france england belgium} @@ -344,7 +344,35 @@ set profile(author,timeDefine) 878567355 set profile(author,timeLastExplain) {} set profile(author,timeLastInit) 891519833 set profile(author,welcomeMessage) {} -set profile(author,windowNumber) 18 +set profile(author,windowNumber) 19 +set profile(bagel.indexdata.dk,authentication) {} +set profile(bagel.indexdata.dk,comstack) tcpip +set profile(bagel.indexdata.dk,databases) {dranet.dra.com IR-Explain-1 gils marc} +set profile(bagel.indexdata.dk,description) {} +set profile(bagel.indexdata.dk,host) bagel.indexdata.dk +set profile(bagel.indexdata.dk,idAuthentication) {} +set profile(bagel.indexdata.dk,largeSetLowerBound) 2 +set profile(bagel.indexdata.dk,maxResultSets) {} +set profile(bagel.indexdata.dk,maxResultSize) {} +set profile(bagel.indexdata.dk,maxTerms) {} +set profile(bagel.indexdata.dk,maximumRecordSize) 50000 +set profile(bagel.indexdata.dk,mediumSetPresentNumber) 0 +set profile(bagel.indexdata.dk,multipleDatabases) 1 +set profile(bagel.indexdata.dk,namedResultSets) 1 +set profile(bagel.indexdata.dk,port) 210 +set profile(bagel.indexdata.dk,preferredMessageSize) 30000 +set profile(bagel.indexdata.dk,presentChunk) 4 +set profile(bagel.indexdata.dk,protocol) Z39 +set profile(bagel.indexdata.dk,queryCCL) 0 +set profile(bagel.indexdata.dk,queryRPN) 1 +set profile(bagel.indexdata.dk,recentNews) {} +set profile(bagel.indexdata.dk,smallSetUpperBound) 0 +set profile(bagel.indexdata.dk,targetInfoName) Zebra +set profile(bagel.indexdata.dk,timeDefine) {} +set profile(bagel.indexdata.dk,timeLastExplain) 897483464 +set profile(bagel.indexdata.dk,timeLastInit) 897483464 +set profile(bagel.indexdata.dk,welcomeMessage) {} +set profile(bagel.indexdata.dk,windowNumber) 4 set profile(bagel9999,authentication) {} set profile(bagel9999,comstack) tcpip set profile(bagel9999,databases) Default @@ -372,7 +400,7 @@ set profile(bagel9999,timeDefine) {} set profile(bagel9999,timeLastExplain) {} set profile(bagel9999,timeLastInit) 891524781 set profile(bagel9999,welcomeMessage) {} -set profile(bagel9999,windowNumber) 9 +set profile(bagel9999,windowNumber) 10 set profile(dranet,authentication) {} set profile(dranet,comstack) tcpip set profile(dranet,databases) drewdb @@ -403,7 +431,7 @@ set profile(dranet,timeDefine) 878567355 set profile(dranet,timeLastExplain) {} set profile(dranet,timeLastInit) 887289573 set profile(dranet,welcomeMessage) {} -set profile(dranet,windowNumber) 6 +set profile(dranet,windowNumber) 7 set profile(libris,authentication) {} set profile(libris,comstack) tcpip set profile(libris,databases) libr @@ -430,7 +458,7 @@ set profile(libris,timeDefine) 878567355 set profile(libris,timeLastExplain) {} set profile(libris,timeLastInit) 887285394 set profile(libris,welcomeMessage) {} -set profile(libris,windowNumber) 5 +set profile(libris,windowNumber) 6 set profile(madison,authentication) {} set profile(madison,comstack) tcpip set profile(madison,databases) madison @@ -457,7 +485,7 @@ set profile(madison,timeDefine) 878567355 set profile(madison,timeLastExplain) {} set profile(madison,timeLastInit) 887289602 set profile(madison,welcomeMessage) {} -set profile(madison,windowNumber) 10 +set profile(madison,windowNumber) 11 set profile(pica,authentication) {} set profile(pica,comstack) tcpip set profile(pica,databases) {IR-Explain-1 NCC-IBL OLC} @@ -513,21 +541,21 @@ set profile(zno,timeDefine) {} set profile(zno,timeLastExplain) {} set profile(zno,timeLastInit) 891593773 set profile(zno,welcomeMessage) {} -set profile(zno,windowNumber) 13 +set profile(zno,windowNumber) 14 set profile(ztest9999,authentication) {} set profile(ztest9999,comstack) tcpip -set profile(ztest9999,databases) {books gils} +set profile(ztest9999,databases) {Default IR-Explain-1} set profile(ztest9999,description) {YAZ server on localhost} set profile(ztest9999,descripton) {This target is not a target with real bibliographic record - it just illustrates how Explain data might look like.} set profile(ztest9999,host) localhost set profile(ztest9999,idAuthentication) {} set profile(ztest9999,largeSetLowerBound) 2 -set profile(ztest9999,maxResultSets) 100 -set profile(ztest9999,maxResultSize) 100000 -set profile(ztest9999,maxTerms) 50 +set profile(ztest9999,maxResultSets) {} +set profile(ztest9999,maxResultSize) {} +set profile(ztest9999,maxTerms) {} set profile(ztest9999,maximumRecordSize) 50000 set profile(ztest9999,mediumSetPresentNumber) 0 -set profile(ztest9999,multipleDatabases) 0 +set profile(ztest9999,multipleDatabases) 1 set profile(ztest9999,namedResultSets) 1 set profile(ztest9999,port) 9999 set profile(ztest9999,preferredMessageSize) 30000 @@ -535,14 +563,14 @@ set profile(ztest9999,presentChunk) 4 set profile(ztest9999,protocol) Z39 set profile(ztest9999,queryCCL) 0 set profile(ztest9999,queryRPN) 1 -set profile(ztest9999,recentNews) {strings { language {text {We've just added targetInfo, databaseInfo and attributeDetails}} } } +set profile(ztest9999,recentNews) {} set profile(ztest9999,smallSetUpperBound) 0 -set profile(ztest9999,targetInfoName) {Zebra server Explain test} +set profile(ztest9999,targetInfoName) Zebra set profile(ztest9999,timeDefine) 878567355 -set profile(ztest9999,timeLastExplain) 891651588 -set profile(ztest9999,timeLastInit) 891651588 -set profile(ztest9999,welcomeMessage) Welcome! -set profile(ztest9999,windowNumber) 14 +set profile(ztest9999,timeLastExplain) 897392133 +set profile(ztest9999,timeLastInit) 897392253 +set profile(ztest9999,welcomeMessage) {} +set profile(ztest9999,windowNumber) 15 set queryTypes {Simple phrase} set queryButtons {{{I 3} {I 0} {I 0}} {{I 0} {I 1} {I 0}}} set queryInfo {{{Title {1=4}} {Author {1=1}} {Subject {1=21}} {Any {1=1016}} {Query 1=1016 2=102} {Title-rank 1=4 2=102} {Date/time 1=1012} {Title-regular 1=4 2=3 4=2 5=102} {Ranked 1=1016 2=102 3=3 4=1 6=1}} {{Title 1=4 4=1 6=2} {Author 1=1003 4=1 6=2} {ISBN 1=7} {ISSN 1=8} {Year 1=30 4=4 6=2} {Any {}}}} -- 1.7.10.4