From 1e05ad915933124916c16e164cd2065646379cd7 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 30 Jan 2001 21:34:17 +0000 Subject: [PATCH] Added step-size for Scan backend interface. --- include/Makefile.in | 9 ++++----- include/yaz/backend.h | 8 ++++++-- server/seshigh.c | 41 ++++++++++------------------------------- ztest/ztest.c | 12 ++++++++++-- 4 files changed, 30 insertions(+), 40 deletions(-) diff --git a/include/Makefile.in b/include/Makefile.in index 277d702..b1c943b 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -109,8 +109,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. -@SET_MAKE@ - all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @@ -137,10 +135,11 @@ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" = "." && dot_seen=yes; \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ + rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ diff --git a/include/yaz/backend.h b/include/yaz/backend.h index ca346ca..72abdc5 100644 --- a/include/yaz/backend.h +++ b/include/yaz/backend.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-2000, Index Data. + * Copyright (c) 1995-2001, Index Data. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation, in whole or in part, for any purpose, is hereby granted, @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: backend.h,v $ - * Revision 1.10 2000-10-02 11:07:44 adam + * Revision 1.11 2001-01-30 21:34:17 adam + * Added step-size for Scan backend interface. + * + * Revision 1.10 2000/10/02 11:07:44 adam * Added peer_name member for bend_init handler. Changed the YAZ * client so that tcp: can be avoided in target spec. * @@ -190,6 +193,7 @@ typedef struct bend_scan_rr { ODR stream; /* encoding stream - memory source if required */ ODR print; /* printing stream */ + int *step_size; /* step size */ int term_position; /* desired index of term in result list/returned */ int num_entries; /* number of entries requested/returned */ diff --git a/server/seshigh.c b/server/seshigh.c index 6484f48..a150917 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -1,9 +1,12 @@ /* - * Copyright (c) 1995-2000, Index Data + * Copyright (c) 1995-2001, Index Data * See the file LICENSE for details. * * $Log: seshigh.c,v $ - * Revision 1.112 2001-01-29 09:38:22 adam + * Revision 1.113 2001-01-30 21:34:17 adam + * Added step-size for Scan backend interface. + * + * Revision 1.112 2001/01/29 09:38:22 adam * Fixed bug that made the frontend server crash when no attribute set * was specified for scan. * @@ -1614,34 +1617,6 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb, return apdu; } -#if 0 -static int bend_default_scan (void *handle, bend_scan_rr *rr) -{ - bend_scanrequest srq; - bend_scanresult *srs; - - srq.num_bases = rr->num_bases; - srq.basenames = rr->basenames; - srq.attributeset = rr->attributeset; - srq.referenceId = rr->referenceId; - srq.term = rr->term; - srq.term_position = rr->term_position; - srq.num_entries = rr->num_entries; - srq.stream = rr->stream; - srq.print = rr->print; - - srs = bend_scan(handle, &srq, 0); - - rr->term_position = srs->term_position; - rr->num_entries = srs->num_entries; - rr->entries = srs->entries; - rr->status = srs->status; - rr->errcode = srs->errcode; - rr->errstring = srs->errstring; - return 0; -} -#endif - /* * Scan was implemented rather in a hurry, and with support for only the basic * elements of the service in the backend API. Suggestions are welcome. @@ -1669,7 +1644,10 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) apdu->which = Z_APDU_scanResponse; apdu->u.scanResponse = res; res->referenceId = req->referenceId; - res->stepSize = 0; + res->stepSize = (int*) odr_malloc (assoc->encode, sizeof(*res->stepSize)); + *res->stepSize = 0; + if (req->stepSize) + *res->stepSize = *req->stepSize; res->scanStatus = scanStatus; res->numberOfEntriesReturned = numberOfEntriesReturned; res->positionOfTerm = 0; @@ -1704,6 +1682,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) bsrr->referenceId = req->referenceId; bsrr->stream = assoc->encode; bsrr->print = assoc->print; + bsrr->step_size = res->stepSize; if (!(attset = oid_getentbyoid(req->attributeSet)) || attset->oclass != CLASS_RECSYN) bsrr->attributeset = VAL_NONE; diff --git a/ztest/ztest.c b/ztest/ztest.c index fa749d6..d10e4b5 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -1,12 +1,15 @@ /* - * Copyright (c) 1995-2000, Index Data. + * Copyright (c) 1995-2001, Index Data. * See the file LICENSE for details. * * NT Service interface by * Chas Woodfield, Fretwell Downing Datasystems. * * $Log: ztest.c,v $ - * Revision 1.35 2000-11-23 10:58:33 adam + * Revision 1.36 2001-01-30 21:34:18 adam + * Added step-size for Scan backend interface. + * + * Revision 1.35 2000/11/23 10:58:33 adam * SSL comstack support. Separate POSIX thread support library. * * Revision 1.34 2000/09/04 08:58:15 adam @@ -550,6 +553,11 @@ int ztest_scan(void *handle, bend_scan_rr *q) q->errcode = 229; /* unsupported term type */ return 0; } + if (*q->step_size != 0) + { + q->errcode = 205; /*Only zero step size supported for Scan */ + return 0; + } if (q->term->term->u.general->len >= 80) { q->errcode = 11; /* term too long */ -- 1.7.10.4