X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fretrieval.c;h=26d28fdbf4950e20ae061e246118d8f1ae0961a1;hp=e0ed99848168fe88a52eebed5e8329422f5e5eae;hb=a3e65bcd3250b107397675bc65b35b5939355025;hpb=6451a706e744f7b2d6142f60ab2ee025ecf48326 diff --git a/src/retrieval.c b/src/retrieval.c index e0ed998..26d28fd 100644 --- a/src/retrieval.c +++ b/src/retrieval.c @@ -108,7 +108,8 @@ void yaz_retrieval_reset(yaz_retrieval_t p) } /** \brief parse retrieval XML config */ -static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr) +static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr, + struct yaz_record_conv_type *types) { struct _xmlAttr *attr; struct yaz_retrieval_elem *el = (struct yaz_retrieval_elem *) @@ -179,6 +180,7 @@ static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr) } else { + struct _xmlAttr *attr; if (el->record_conv) { wrbuf_printf(p->wr_error, "Element : " @@ -187,7 +189,6 @@ static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr) return -1; } /* parsing attributees */ - struct _xmlAttr *attr; for (attr = ptr->properties; attr; attr = attr->next) { if (!xmlStrcmp(attr->name, BAD_CAST "name") @@ -229,10 +230,10 @@ static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr) /* parsing internal of record conv */ el->record_conv = yaz_record_conv_create(); - + yaz_record_conv_set_path(el->record_conv, p->path); - if (yaz_record_conv_configure(el->record_conv, ptr)) + if (yaz_record_conv_configure_t(el->record_conv, ptr, types)) { wrbuf_printf(p->wr_error, "%s", yaz_record_conv_get_error(el->record_conv)); @@ -247,7 +248,8 @@ static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr) return 0; } -int yaz_retrieval_configure(yaz_retrieval_t p, const xmlNode *ptr) +int yaz_retrieval_configure_t(yaz_retrieval_t p, const xmlNode *ptr, + struct yaz_record_conv_type *types) { yaz_retrieval_reset(p); @@ -260,7 +262,7 @@ int yaz_retrieval_configure(yaz_retrieval_t p, const xmlNode *ptr) continue; if (!strcmp((const char *) ptr->name, "retrieval")) { - if (conf_retrieval(p, ptr)) + if (conf_retrieval(p, ptr, types)) return -1; } else @@ -280,6 +282,11 @@ int yaz_retrieval_configure(yaz_retrieval_t p, const xmlNode *ptr) return 0; } +int yaz_retrieval_configure(yaz_retrieval_t p, const xmlNode *ptr) +{ + return yaz_retrieval_configure_t(p, ptr, 0); +} + int yaz_retrieval_request(yaz_retrieval_t p, const char *schema, Odr_oid *syntax, const char **match_schema, Odr_oid **match_syntax,