record_conv: modify new API for conversion types
[yaz-moved-to-github.git] / src / retrieval.c
index e0ed998..26d28fd 100644 (file)
@@ -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 <retrieval>: "
@@ -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,