+ logf (LOG_DEBUG, "grs_retrieve: size");
+ if ((dnew = data1_insert_taggeddata(p->dh, node, node,
+ "size", mem)))
+ {
+ dnew->u.data.what = DATA1I_text;
+ dnew->u.data.data = dnew->lbuf;
+ sprintf(dnew->u.data.data, "%d", p->recordSize);
+ dnew->u.data.len = strlen(dnew->u.data.data);
+ }
+
+ tagname = res_get_def(p->res, "tagrank", "rank");
+ if (strcmp(tagname, "0") && p->score >= 0 &&
+ (dnew = data1_insert_taggeddata(p->dh, node, node, tagname, mem)))
+ {
+ logf (LOG_DEBUG, "grs_retrieve: %s", tagname);
+ dnew->u.data.what = DATA1I_num;
+ dnew->u.data.data = dnew->lbuf;
+ sprintf(dnew->u.data.data, "%d", p->score);
+ dnew->u.data.len = strlen(dnew->u.data.data);
+ }
+
+ tagname = res_get_def(p->res, "tagsysno", "localControlNumber");
+ if (strcmp(tagname, "0") && p->localno > 0 &&
+ (dnew = data1_insert_taggeddata(p->dh, node, node, tagname, mem)))
+ {
+ logf (LOG_DEBUG, "grs_retrieve: %s", tagname);
+ dnew->u.data.what = DATA1I_text;
+ dnew->u.data.data = dnew->lbuf;
+ sprintf(dnew->u.data.data, "%d", p->localno);
+ dnew->u.data.len = strlen(dnew->u.data.data);
+ }
+
+ if (p->comp && p->comp->which == Z_RecordComp_complex &&
+ p->comp->u.complex->generic &&
+ p->comp->u.complex->generic->schema)
+ {
+ oident *oe = oid_getentbyoid (p->comp->u.complex->generic->schema);
+ if (oe)
+ requested_schema = oe->value;
+ }
+
+ /* If schema has been specified, map if possible, then check that
+ * we got the right one
+ */
+ if (requested_schema != VAL_NONE)