From: Adam Dickmeiss Date: Tue, 27 Jun 1995 19:03:48 +0000 (+0000) Subject: Bug fix in do_present in ir-tcl.c: p->set_child member weren't set. X-Git-Tag: IRTCL.1.4~235 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=756d3de787699768bca9079be47cf0c3839e9eec;p=ir-tcl-moved-to-github.git Bug fix in do_present in ir-tcl.c: p->set_child member weren't set. nextResultSetPosition used instead of setOffset. --- diff --git a/client.tcl b/client.tcl index 8b7b984..ac98e3a 100644 --- a/client.tcl +++ b/client.tcl @@ -4,7 +4,11 @@ # Sebastian Hammer, Adam Dickmeiss # # $Log: client.tcl,v $ -# Revision 1.55 1995-06-27 17:10:37 adam +# Revision 1.56 1995-06-27 19:03:48 adam +# Bug fix in do_present in ir-tcl.c: p->set_child member weren't set. +# nextResultSetPosition used instead of setOffset. +# +# Revision 1.55 1995/06/27 17:10:37 adam # Bug fix: install procedure didn't work on some systems. # Error turned up when clientrc.tcl was't present. # @@ -215,6 +219,7 @@ set profile(Default) {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} Z39 1} set hostid Default set settingsChanged 0 set setNo 0 +set setNoLast 0 set cancelFlag 0 set scanEnable 0 set fullMarcSeq 0 @@ -276,7 +281,7 @@ proc set-wrap {m} { } proc dputs {m} { -# puts $m + puts $m } proc set-display-format {f} { @@ -293,9 +298,6 @@ proc set-display-format {f} { } update idletasks add-title-lines -1 10000 1 - if {!$busy} { - .bot.a.status configure -text "Ready" - } } proc initBindings {} { @@ -484,11 +486,13 @@ proc show-status {status b sb} { } if {$setNo == 0} { .top.service.m disable 1 - } elseif {$setOffset > 0 && $setOffset <= [z39.$setNo resultCount]} { + } elseif {[z39.$setNo nextResultSetPosition] > 0 && + [z39.$setNo nextResultSetPosition] <= [z39.$setNo resultCount]} { .top.service.m enable 1 .mid.present configure -state normal } else { .top.service.m disable 1 + .mid.present configure -state disabled } if {[winfo exists .scan-window]} { .scan-window.bot.2 configure -state normal @@ -845,9 +849,11 @@ proc close-target {} { global hostid global cancelFlag global setNo + global setNoLast set cancelFlag 0 set setNo 0 + set setNoLast 0 .bot.a.set configure -text "" set hostid Default z39 disconnect @@ -857,15 +863,16 @@ proc close-target {} { show-message {} .top.target.m disable 1 .top.target.m disable 2 - .top.rset.m delete 2 last + .top.rset.m delete 1 last + .top.rset.m add separator .top.target.m enable 0 } proc load-set-action {} { - global setNo + global setNoLast - incr setNo - ir-set z39.$setNo z39 + incr setNoLast + ir-set z39.$setNoLast z39 set fname [.load-set.top.filename.entry get] destroy .load-set @@ -874,12 +881,12 @@ proc load-set-action {} { update z39.$setNo loadFile $fname - set no [z39.$setNo numberOfRecordsReturned] - add-title-lines $setNo $no 1 + set no [z39.$setNoLast numberOfRecordsReturned] + add-title-lines $setNoLast $no 1 } - set l [format "%-4d %7d" $setNo $no] + set l [format "%-4d %7d" $setNoLast $no] .top.rset.m add command -label $l \ - -command [list add-title-lines $setNo 10000 1] + -command [list add-title-lines $setNoLast 10000 1] show-status {Ready} 0 {} } @@ -904,7 +911,6 @@ proc load-set {} { } proc init-request {} { - global setNo global cancelFlag if {$cancelFlag} { @@ -945,6 +951,7 @@ proc init-response {} { proc search-request {bflag} { global setNo + global setNoLast global profile global hostid global busy @@ -972,7 +979,8 @@ proc search-request {bflag} { if {$query==""} { return } - incr setNo + incr setNoLast + set setNo $setNoLast ir-set z39.$setNo z39 if {[lindex $profile($target) 10] == 1} { @@ -1299,15 +1307,13 @@ proc search-response {} { show-status {Ready} 0 1 set status [z39.$setNo responseStatus] if {[lindex $status 0] == "NSD"} { + z39.$setNo nextResultSetPosition 0 set code [lindex $status 1] set msg [lindex $status 2] set addinfo [lindex $status 3] tkerror "NSD$code: $msg: $addinfo" return } - if {$setMax > 20} { - set setMax 20 - } show-message "${setMax} hits" if {$setMax == 0} { return @@ -1317,6 +1323,9 @@ proc search-response {} { set l [format "%-4d %7d" $setNo $setMax] .top.rset.m add command -label $l \ -command [list add-title-lines $setNo 10000 1] + if {$setMax > 20} { + set setMax 20 + } z39 callback {present-response} z39.$setNo present $setOffset 1 show-status {Retrieving} 1 0 @@ -1342,10 +1351,14 @@ proc present-more {number} { dputs "setNo=$setNo" return } + set setOffset [z39.$setNo nextResultSetPosition] + dputs "setOffest=${setOffset}" + dputs "setNo=${setNo}" set max [z39.$setNo resultCount] - if {$max <= $setOffset} { + if {$max < $setOffset} { dputs "max=$max" dputs "setOffset=$setOffset" + show-status Ready 0 1 return } if {$number == ""} { @@ -1380,12 +1393,13 @@ proc title-press {y setno} { proc add-title-lines {setno no offset} { global displayFormats global displayFormat - global lastSetNo + global setNo + global busy - if {$setno == -1} { - set setno $lastSetNo + if {$setno != -1} { + set setNo $setno } else { - set lastSetNo $setno + set setno $setNo } if {$offset == 1} { .bot.a.set configure -text $setno @@ -1409,6 +1423,9 @@ proc add-title-lines {setno no offset} { [list popup-marc $setno $o 0 0] update idletasks } + if {!$busy} { + show-status Ready 0 1 + } } proc present-response {} { diff --git a/clientrc.tcl b/clientrc.tcl index e357000..597226d 100644 --- a/clientrc.tcl +++ b/clientrc.tcl @@ -1,9 +1,9 @@ # Setup file set {profile(Penn)} {{Penn State's Library} 128.118.88.200 210 {} 16384 8192 tcpip CATALOG 1 {} {} Z39 2} -set {profile(ztest)} {{test server} localhost 9999 {} 16384 4096 tcpip dummy 1 {} {} Z39 3} +set {profile(ztest)} {{test server} localhost 9999 {} 16384 4096 tcpip dummy 1 {} 1 Z39 3} set {profile(madison)} {{University of Wisconsin-Madison} z3950.adp.wisc.edu 210 {} 16384 8192 tcpip madison 1 {} {} Z39 22} set {profile(Default)} {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} {} 27} -set {profile(RLG)} {{Research Libraries group} rlg.stanford.edu 210 {} 4096 4096 tcpip {BKS AMC MAPS MDF REC SCO SER VIM NAF SAF AUT CATALOG ABI AVI DSA EIP FLP HAP HST NPA PAI PRA WLI} 1 {} {} Z39 5} +set {profile(RLG)} {{Research Libraries group} rlg.stanford.edu 210 {} 4096 4096 tcpip {BKS AMC MAPS MDF REC SCO SER VIM NAF SAF AUT CATALOG ABI AVI DSA EIP FLP HAP HST NPA PAI PRA WLI} 1 {} 1 Z39 5} set {profile(AT&T server)} {{AT&T Z39 Server} z3950.research.att.com 210 {} 16384 16384 tcpip Default 1 {} {} Z39 21} set {profile(LOC)} {{Library of Congress} IBM2.LOC.gov 2210 {} 16384 16384 tcpip {BOOKS NAMES} 1 {} 0 Z39 6} set {profile(DANBIB)} {{SR Target DANBIB} 0103/find2.denet.dk 4500 {} 8192 8192 mosi danbib 1 {} 1 SR 8} @@ -13,7 +13,7 @@ set {profile(CARL)} {{CARL systems} Z3950.carl.org 210 {} 16384 8192 tcpip {ACC set {profile(CLSI)} {CLSI inet-gw.clsi.us.geac.com 210 {} 16384 8192 tcpip cl_default 1 {} {} Z39 13} set {profile(Innovative)} {{Innovatives server: demo.iii.com} demo.iii.com 210 {} 16384 8192 tcpip DEFAULT 1 {} {} Z39 12} set {profile(AULS)} {{Acadia university} auls.acadiau.ca 210 {} 16384 8192 tcpip AULS 1 {} {} Z39 14} -set {profile(dranet)} {dranet dranet.dra.com 210 {} 16384 16384 tcpip drewdb 1 {} {} Z39 15} +set {profile(dranet)} {dranet dranet.dra.com 210 {} 16384 16384 tcpip drewdb 1 {} 1 Z39 15} set {profile(canberra)} {canberra canberra.cs.umass.edu 2110 {} 30000 30000 tcpip cacm_dots 1 {} {} Z39 25} set queryTypes {Simple phrase} set queryButtons {{ {I 0} {I 1} {I 2} } {{I 0} {I 1} {I 0}}} diff --git a/ir-tcl.c b/ir-tcl.c index 5b0e50e..b28028d 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -5,7 +5,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.47 1995-06-25 10:25:04 adam + * Revision 1.48 1995-06-27 19:03:50 adam + * Bug fix in do_present in ir-tcl.c: p->set_child member weren't set. + * nextResultSetPosition used instead of setOffset. + * + * Revision 1.47 1995/06/25 10:25:04 adam * Working on triggerResourceControl. Description of compile/install * procedure moved to ir-tcl.sgml. * @@ -1561,13 +1565,14 @@ static int do_search (void *o, Tcl_Interp *interp, int argc, char **argv) Z_APDU *apdu; Odr_oct ccl_query; IrTcl_SetObj *obj = o; - IrTcl_Obj *p = obj->parent; + IrTcl_Obj *p; int r; oident bib1; if (argc <= 0) return TCL_OK; + p = obj->parent; p->set_child = o; if (argc != 3) { @@ -1747,7 +1752,10 @@ static int do_nextResultSetPosition (void *o, Tcl_Interp *interp, IrTcl_SetObj *obj = o; if (argc <= 0) + { + obj->nextResultSetPosition = 0; return TCL_OK; + } return get_set_int (&obj->nextResultSetPosition, interp, argc, argv); } @@ -2044,7 +2052,7 @@ static int do_present (void *o, Tcl_Interp *interp, int argc, char **argv) { IrTcl_SetObj *obj = o; - IrTcl_Obj *p = obj->parent; + IrTcl_Obj *p; Z_APDU *apdu; Z_PresentRequest *req; int start; @@ -2072,6 +2080,9 @@ static int do_present (void *o, Tcl_Interp *interp, interp->result = "not connected"; return TCL_ERROR; } + p = obj->parent; + p->set_child = obj; + odr_reset (p->odr_out); obj->start = start; obj->number = number;