X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zutil%2Fzoom-c.c;h=9ca55c1700ce488c6bdd17264b0cd2b719f31701;hb=366dc7568281c9774cd309b28c24a077604264a0;hp=c62a08a1d70bd5d4c6ee7046120d499ca03181f1;hpb=162ddfa4248521c7af9183eac839353434c67f3c;p=yaz-moved-to-github.git diff --git a/zutil/zoom-c.c b/zutil/zoom-c.c index c62a08a..9ca55c1 100644 --- a/zutil/zoom-c.c +++ b/zutil/zoom-c.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-c.c,v 1.8 2002-11-30 22:30:51 mike Exp $ + * $Id: zoom-c.c,v 1.9 2002-12-03 10:03:27 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -1119,8 +1120,8 @@ ZOOM_record_get (ZOOM_record rec, const char *type, int *len) } return 0; } - else if (!strcmp (type, "xml") && - npr->which == Z_NamePlusRecord_databaseRecord) + else if (npr->which == Z_NamePlusRecord_databaseRecord && + (!strcmp (type, "xml") || !strcmp(type, "MarcXML"))) { Z_External *r = (Z_External *) npr->u.databaseRecord; oident *ent = oid_getentbyoid(r->direct_reference); @@ -1132,6 +1133,10 @@ ZOOM_record_get (ZOOM_record rec, const char *type, int *len) } else if (r->which == Z_External_octet) { + int marc_decode_type = YAZ_MARC_OAIMARC; + + if (!strcmp(type, "MarcXML")) + marc_decode_type = YAZ_MARC_MARCXML; switch (ent->value) { case VAL_SOIF: @@ -1149,7 +1154,7 @@ ZOOM_record_get (ZOOM_record rec, const char *type, int *len) r->u.octet_aligned->buf, rec->wrbuf_marc, 0, r->u.octet_aligned->len, - 2) > 0) + marc_decode_type) > 0) { if (len) *len = wrbuf_len(rec->wrbuf_marc); return wrbuf_buf(rec->wrbuf_marc);