- bend_scan_rr *bsrr = (bend_scan_rr *)
- odr_malloc (assoc->encode, sizeof(*bsrr));
- if (req->databaseNames)
- {
- int i;
- for (i = 0; i < req->num_databaseNames; i++)
- yaz_log (LOG_LOG, "Database '%s'", req->databaseNames[i]);
- }
- bsrr->num_bases = req->num_databaseNames;
- bsrr->basenames = req->databaseNames;
- bsrr->num_entries = *req->numberOfTermsRequested;
- bsrr->term = req->termListAndStartPoint;
- 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;
- else
- bsrr->attributeset = attset->value;
- log_scan_term (req->termListAndStartPoint, bsrr->attributeset);
- bsrr->term_position = req->preferredPositionInResponse ?
- *req->preferredPositionInResponse : 1;
- ((int (*)(void *, bend_scan_rr *))
- (*assoc->init->bend_scan))(assoc->backend, bsrr);
- if (bsrr->errcode)
- diagrecs_p = diagrecs(assoc, bsrr->errcode, bsrr->errstring);
- else
- {
- int i;
- Z_Entry **tab = (Z_Entry **)
- odr_malloc (assoc->encode, sizeof(*tab) * bsrr->num_entries);
-
- if (bsrr->status == BEND_SCAN_PARTIAL)
- *scanStatus = Z_Scan_partial_5;
- else
- *scanStatus = Z_Scan_success;
- ents->entries = tab;
- ents->num_entries = bsrr->num_entries;
- res->numberOfEntriesReturned = &ents->num_entries;
- res->positionOfTerm = &bsrr->term_position;
- for (i = 0; i < bsrr->num_entries; i++)
- {
- Z_Entry *e;
- Z_TermInfo *t;
- Odr_oct *o;
-
- tab[i] = e = (Z_Entry *)odr_malloc(assoc->encode, sizeof(*e));
- if (bsrr->entries[i].occurrences >= 0)
- {
- e->which = Z_Entry_termInfo;
- e->u.termInfo = t = (Z_TermInfo *)
- odr_malloc(assoc->encode, sizeof(*t));
- t->suggestedAttributes = 0;
- t->displayTerm = 0;
- t->alternativeTerm = 0;
- t->byAttributes = 0;
- t->otherTermInfo = 0;
- t->globalOccurrences = &bsrr->entries[i].occurrences;
- t->term = (Z_Term *)
- odr_malloc(assoc->encode, sizeof(*t->term));
- t->term->which = Z_Term_general;
- t->term->u.general = o =
- (Odr_oct *)odr_malloc(assoc->encode, sizeof(Odr_oct));
- o->buf = (unsigned char *)
- odr_malloc(assoc->encode, o->len = o->size =
- strlen(bsrr->entries[i].term));
- memcpy(o->buf, bsrr->entries[i].term, o->len);
- yaz_log(LOG_DEBUG, " term #%d: '%s' (%d)", i,
+ int i;
+ Z_Entry **tab = (Z_Entry **)
+ odr_malloc (assoc->encode, sizeof(*tab) * bsrr->num_entries);
+
+ if (bsrr->status == BEND_SCAN_PARTIAL)
+ *scanStatus = Z_Scan_partial_5;
+ else
+ *scanStatus = Z_Scan_success;
+ ents->entries = tab;
+ ents->num_entries = bsrr->num_entries;
+ res->numberOfEntriesReturned = &ents->num_entries;
+ res->positionOfTerm = &bsrr->term_position;
+ for (i = 0; i < bsrr->num_entries; i++)
+ {
+ Z_Entry *e;
+ Z_TermInfo *t;
+ Odr_oct *o;
+
+ tab[i] = e = (Z_Entry *)odr_malloc(assoc->encode, sizeof(*e));
+ if (bsrr->entries[i].occurrences >= 0)
+ {
+ e->which = Z_Entry_termInfo;
+ e->u.termInfo = t = (Z_TermInfo *)
+ odr_malloc(assoc->encode, sizeof(*t));
+ t->suggestedAttributes = 0;
+ t->displayTerm = 0;
+ t->alternativeTerm = 0;
+ t->byAttributes = 0;
+ t->otherTermInfo = 0;
+ t->globalOccurrences = &bsrr->entries[i].occurrences;
+ t->term = (Z_Term *)
+ odr_malloc(assoc->encode, sizeof(*t->term));
+ t->term->which = Z_Term_general;
+ t->term->u.general = o =
+ (Odr_oct *)odr_malloc(assoc->encode, sizeof(Odr_oct));
+ o->buf = (unsigned char *)
+ odr_malloc(assoc->encode, o->len = o->size =
+ strlen(bsrr->entries[i].term));
+ memcpy(o->buf, bsrr->entries[i].term, o->len);
+ yaz_log(LOG_DEBUG, " term #%d: '%s' (%d)", i,