From: Sebastian Hammer Date: Fri, 11 Oct 1996 11:57:16 +0000 (+0000) Subject: Smallish X-Git-Tag: YAZ.1.8~692 X-Git-Url: http://jsfdemo.indexdata.com/?a=commitdiff_plain;h=e6a55188366477082cb2446e7065d0f624dabcfb;p=yaz-moved-to-github.git Smallish --- diff --git a/include/data1.h b/include/data1.h index dd5ec34..7f21853 100644 --- a/include/data1.h +++ b/include/data1.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: data1.h,v $ - * Revision 1.18 1996-10-07 15:29:16 quinn + * Revision 1.19 1996-10-11 11:57:16 quinn + * Smallish + * + * Revision 1.18 1996/10/07 15:29:16 quinn * Added SOIF support * * Revision 1.17 1996/07/06 19:58:32 quinn @@ -371,7 +374,7 @@ data1_tag *data1_gettagbynum(data1_tagset *s, int type, int value); data1_tagset *data1_read_tagset(char *file); data1_element *data1_getelementbytagname(data1_absyn *abs, data1_element *parent, char *tagname); -Z_GenericRecord *data1_nodetogr(data1_node *n, int select, ODR o); +Z_GenericRecord *data1_nodetogr(data1_node *n, int select, ODR o, int *len); int data1_matchstr(char *s1, char *s2); data1_tag *data1_gettagbyname(data1_tagset *s, char *name); void data1_free_tree(data1_node *t); diff --git a/retrieval/d1_doespec.c b/retrieval/d1_doespec.c index 31f357f..1c361f0 100644 --- a/retrieval/d1_doespec.c +++ b/retrieval/d1_doespec.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_doespec.c,v $ - * Revision 1.5 1996-07-06 19:58:34 quinn + * 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 @@ -196,8 +199,9 @@ static int match_children_here(data1_node *n, Z_Espec1 *e, int i, * 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; } } diff --git a/retrieval/d1_grs.c b/retrieval/d1_grs.c index 9033c4d..a819d21 100644 --- a/retrieval/d1_grs.c +++ b/retrieval/d1_grs.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_grs.c,v $ - * Revision 1.6 1996-07-06 19:58:34 quinn + * Revision 1.7 1996-10-11 11:57:23 quinn + * Smallish + * + * Revision 1.6 1996/07/06 19:58:34 quinn * System headerfiles gathered in yconfig * * Revision 1.5 1996/06/03 09:46:42 quinn @@ -35,7 +38,7 @@ #define D1_VARIANTARRAY 20 /* fixed max length on sup'd variant-list. Lazy me */ -Z_GenericRecord *data1_nodetogr(data1_node *n, int select, ODR o); +Z_GenericRecord *data1_nodetogr(data1_node *n, int select, ODR o, int *len); static Z_ElementMetaData *get_ElementMetaData(ODR o) { @@ -137,7 +140,7 @@ static int traverse_triples(data1_node *n, int level, Z_ElementMetaData *m, } static Z_ElementData *nodetoelementdata(data1_node *n, int select, int leaf, - ODR o) + ODR o, int *len) { Z_ElementData *res = odr_malloc(o, sizeof(*res)); data1_node *p; @@ -161,6 +164,7 @@ static Z_ElementData *nodetoelementdata(data1_node *n, int select, int leaf, res->which = Z_ElementData_numeric; res->u.numeric = odr_malloc(o, sizeof(int)); *res->u.numeric = atoi(n->u.data.data); + *len += 4; break; case DATA1I_text: toget = n->u.data.len; @@ -170,12 +174,14 @@ static Z_ElementData *nodetoelementdata(data1_node *n, int select, int leaf, res->u.string = odr_malloc(o, toget+1); memcpy(res->u.string, n->u.data.data, toget); res->u.string[toget] = '\0'; + *len += toget; break; case DATA1I_oid: res->which = Z_ElementData_oid; strncpy(str, n->u.data.data, n->u.data.len); str[n->u.data.len] = '\0'; res->u.oid = odr_getoidbystr(o, str); + *len += n->u.data.len; break; default: logf(LOG_WARN, "Can't handle datatype."); @@ -185,13 +191,14 @@ static Z_ElementData *nodetoelementdata(data1_node *n, int select, int leaf, else { res->which = Z_ElementData_subtree; - if (!(res->u.subtree = data1_nodetogr(n->parent, select, o))) + if (!(res->u.subtree = data1_nodetogr(n->parent, select, o, len))) return 0; } return res; } -static Z_TaggedElement *nodetotaggedelement(data1_node *n, int select, ODR o) +static Z_TaggedElement *nodetotaggedelement(data1_node *n, int select, ODR o, + int *len) { Z_TaggedElement *res = odr_malloc(o, sizeof(*res)); data1_tag *tag = 0; @@ -274,12 +281,13 @@ static Z_TaggedElement *nodetotaggedelement(data1_node *n, int select, ODR o) res->content->which = Z_ElementData_noDataRequested; res->content->u.noDataRequested = ODR_NULLVAL; } - else if (!(res->content = nodetoelementdata(data, select, leaf, o))) + else if (!(res->content = nodetoelementdata(data, select, leaf, o, len))) return 0; + *len += 10; return res; } -Z_GenericRecord *data1_nodetogr(data1_node *n, int select, ODR o) +Z_GenericRecord *data1_nodetogr(data1_node *n, int select, ODR o, int *len) { Z_GenericRecord *res = odr_malloc(o, sizeof(*res)); data1_node *c; @@ -291,7 +299,7 @@ Z_GenericRecord *data1_nodetogr(data1_node *n, int select, ODR o) if (c->which == DATA1N_tag && select && !c->u.tag.node_selected) continue; if (!(res->elements[res->num_elements++] = - nodetotaggedelement(c, select, o))) + nodetotaggedelement(c, select, o, len))) return 0; } return res; diff --git a/server/seshigh.c b/server/seshigh.c index fd4b2f3..520e024 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: seshigh.c,v $ - * Revision 1.62 1996-07-06 19:58:35 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 @@ -852,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]; @@ -882,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; @@ -931,6 +934,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, surrogatediagrec(a->proto, fres->basename, 16, 0); reclist.num_records++; *next = fres->last_in_set ? 0 : recno + 1; + dumped_records += this_length; continue; } } @@ -941,6 +945,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, surrogatediagrec(a->proto, fres->basename, 17, 0); reclist.num_records++; *next = fres->last_in_set ? 0 : recno + 1; + dumped_records += this_length; continue; } }