X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=server%2Fseshigh.c;h=520e0242770092d8dbcb43aa425421945d6a9d72;hb=527e5237725b631a58124f9b0d7b5ce97c62a183;hp=ab54a948013e4981edd1e516402e68f124ed52f5;hpb=dee13aeae17005ba0ef3adf7bf99958160e393d9;p=yaz-moved-to-github.git diff --git a/server/seshigh.c b/server/seshigh.c index ab54a94..520e024 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -4,7 +4,22 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: seshigh.c,v $ - * Revision 1.58 1996-02-20 12:53:04 quinn + * Revision 1.63 1996-10-11 11:57:26 quinn + * Smallish + * + * Revision 1.62 1996/07/06 19:58:35 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.61 1996/06/10 08:56:16 quinn + * Work on Summary. + * + * Revision 1.60 1996/05/30 11:03:10 quinn + * Fixed NextresultSetPosition bug fixed. + * + * Revision 1.59 1996/05/14 09:26:46 quinn + * Added attribute set to scan backend + * + * Revision 1.58 1996/02/20 12:53:04 quinn * Chanes to SCAN * * Revision 1.57 1996/01/02 08:57:47 quinn @@ -208,11 +223,11 @@ * */ +#include #include #include #include #include -#include #include #include @@ -840,7 +855,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, int *num, Z_RecordComposition *comp, int *next, int *pres, oid_value format) { - int recno, total_length = 0, toget = *num; + int recno, total_length = 0, toget = *num, dumped_records = 0; static Z_Records records; static Z_NamePlusRecordList reclist; static Z_NamePlusRecord *list[MAX_RECORDS]; @@ -870,7 +885,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, * allocation done by the backend - this should give us a reasonable * idea of the total size of the data so far. */ - total_length = odr_total(a->encode); + total_length = odr_total(a->encode) - dumped_records; if (reclist.num_records == MAX_RECORDS - 1) { *pres = Z_PRES_PARTIAL_2; @@ -918,6 +933,8 @@ static Z_Records *pack_records(association *a, char *setname, int start, reclist.records[reclist.num_records] = surrogatediagrec(a->proto, fres->basename, 16, 0); reclist.num_records++; + *next = fres->last_in_set ? 0 : recno + 1; + dumped_records += this_length; continue; } } @@ -927,6 +944,8 @@ static Z_Records *pack_records(association *a, char *setname, int start, reclist.records[reclist.num_records] = surrogatediagrec(a->proto, fres->basename, 17, 0); reclist.num_records++; + *next = fres->last_in_set ? 0 : recno + 1; + dumped_records += this_length; continue; } } @@ -955,6 +974,8 @@ static Z_Records *pack_records(association *a, char *setname, int start, case VAL_GRS1: thisext->which = Z_External_grs1; break; case VAL_EXPLAIN: thisext->which = Z_External_explainRecord; break; + case VAL_SUMMARY: thisext->which = Z_External_summary; break; + case VAL_OPAC: thisext->which = Z_External_OPAC; break; default: logf(LOG_FATAL, "Unknown structured format from backend."); @@ -1195,6 +1216,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) static Z_Entry *tab[SCAN_MAX_ENTRIES]; bend_scanrequest srq; bend_scanresult *srs; + oident *attset; logf(LOG_LOG, "Got scanrequest"); apdu.which = Z_APDU_scanResponse; @@ -1226,6 +1248,11 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) srq.basenames = req->databaseNames; srq.num_entries = *req->numberOfTermsRequested; srq.term = req->termListAndStartPoint; + if (!(attset = oid_getentbyoid(req->attributeSet)) || + attset->oclass != CLASS_RECSYN) + srq.attributeset = VAL_NONE; + else + srq.attributeset = attset->value; srq.term_position = req->preferredPositionInResponse ? *req->preferredPositionInResponse : 1; if (!(srs = bend_scan(assoc->backend, &srq, 0)))