- if (pos == rc->pos)
- {
- if (strcmp_null(r->schema, rc->schema))
- continue;
- if (strcmp_null(elementSetName,rc->elementSetName))
- continue;
- if (strcmp_null(syntax, rc->syntax))
- continue;
- /* not destroying rc->npr (it's handled by nmem )*/
- rc->rec.npr = npr;
- /* keeping wrbuf_marc too */
- return;
- }
+ if (pos == rc->pos
+ && strcmp_null(r->schema, rc->schema) == 0
+ && strcmp_null(elementSetName,rc->elementSetName) == 0
+ && strcmp_null(syntax, rc->syntax) == 0)
+ break;
+ }
+ if (!rc)
+ {
+ rc = (ZOOM_record_cache) odr_malloc(r->odr, sizeof(*rc));
+ rc->rec.odr = 0;
+ rc->rec.wrbuf_marc = 0;
+ rc->rec.wrbuf_iconv = 0;
+ rc->rec.wrbuf_opac = 0;
+ rc->elementSetName = odr_strdup_null(r->odr, elementSetName);
+
+ rc->syntax = odr_strdup_null(r->odr, syntax);
+
+ rc->schema = odr_strdup_null(r->odr, r->schema);
+
+ rc->pos = pos;
+ rc->next = r->record_hash[record_hash(pos)];
+ r->record_hash[record_hash(pos)] = rc;