X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=retrieval%2Fd1_doespec.c;h=5914a678db5dc9b0fed4414c73a740e6fba5690f;hp=4a1e002f50ad6a3619627d9c1d966860cb69e569;hb=85a2e7affad79fd8bd59b403ba7b5f7867d60523;hpb=a309d6ece06c0ab732d98c59f2718efaebd01ec6 diff --git a/retrieval/d1_doespec.c b/retrieval/d1_doespec.c index 4a1e002..5914a67 100644 --- a/retrieval/d1_doespec.c +++ b/retrieval/d1_doespec.c @@ -4,7 +4,19 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_doespec.c,v $ - * Revision 1.3 1995-11-13 09:27:33 quinn + * Revision 1.7 1997-04-30 08:52:11 quinn + * Null + * + * Revision 1.6 1996/10/11 11:57:22 quinn + * Smallish + * + * Revision 1.5 1996/07/06 19:58:34 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.4 1996/06/07 11:04:32 quinn + * Fixed tag->tagset dependency + * + * Revision 1.3 1995/11/13 09:27:33 quinn * Fiddling with the variant stuff. * * Revision 1.2 1995/11/01 13:54:45 quinn @@ -58,7 +70,7 @@ static Z_Triple *find_triple(Z_Variant *var, oid_value universalset, } static void mark_subtree(data1_node *n, int make_variantlist, int no_data, - Z_Variant *vreq) + int get_bytes, Z_Variant *vreq) { data1_node *c; @@ -67,6 +79,7 @@ static void mark_subtree(data1_node *n, int make_variantlist, int no_data, n->u.tag.node_selected = 1; n->u.tag.make_variantlist = make_variantlist; n->u.tag.no_data_requested = no_data; + n->u.tag.get_bytes = get_bytes; } for (c = n->child; c; c = c->next) @@ -77,8 +90,9 @@ static void mark_subtree(data1_node *n, int make_variantlist, int no_data, c->u.tag.node_selected = 1; c->u.tag.make_variantlist = make_variantlist; c->u.tag.no_data_requested = no_data; + c->u.tag.get_bytes = get_bytes; } - mark_subtree(c, make_variantlist, no_data, vreq); + mark_subtree(c, make_variantlist, no_data, get_bytes, vreq); } } @@ -103,7 +117,8 @@ static int match_children_here(data1_node *n, Z_Espec1 *e, int i, occur = want->occurrences; if (c->u.tag.element) tag = c->u.tag.element->tag; - if (*want->tagType != (tag ? tag->tagset->type : 3)) + if (*want->tagType != ((tag && tag->tagset) ? tag->tagset->type : + 3)) continue; if (want->tagValue->which == Z_StringOrNumeric_numeric) { @@ -149,6 +164,8 @@ static int match_children_here(data1_node *n, Z_Espec1 *e, int i, { int show_variantlist = 0; int no_data = 0; + int get_bytes = -1; + Z_Variant *vreq = e->elements[i]->u.simpleElement->variantRequest; oident *defset = oid_getentbyoid(e->defaultVariantSetId); @@ -160,6 +177,8 @@ static int match_children_here(data1_node *n, Z_Espec1 *e, int i, if (vreq) { + Z_Triple *r; + /* * 6,5: meta-data requested, variant list. */ @@ -170,16 +189,22 @@ static int match_children_here(data1_node *n, Z_Espec1 *e, int i, */ if (find_triple(vreq, defsetval, var1, 9, 1)) no_data = 1; + + /* howmuch */ + if ((r = find_triple(vreq, defsetval, var1, 5, 5))) + if (r->which == Z_Triple_integer) + get_bytes = *r->value.integer; } - mark_subtree(c, show_variantlist, no_data, vreq); + mark_subtree(c, show_variantlist, no_data, get_bytes, vreq); } hits++; /* * have we looked at enough children? */ if (!occur || (occur->which == Z_Occurrences_values && + (!occur->u.values->howMany || counter - *occur->u.values->start >= - *occur->u.values->howMany - 1)) + *occur->u.values->howMany - 1))) return hits; } }