record_conv: change construct prototype
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 2 Mar 2012 10:28:34 +0000 (11:28 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 2 Mar 2012 10:28:34 +0000 (11:28 +0100)
Removing yaz_record_conv_t from construct conversion type
handler.

include/yaz/record_conv.h
src/record_conv.c

index d6af158..a9bdebe 100644 (file)
@@ -61,7 +61,7 @@ struct yaz_record_conv_type {
     struct yaz_record_conv_type *next;
 
     /** \brief construct and configure a type of ours */
     struct yaz_record_conv_type *next;
 
     /** \brief construct and configure a type of ours */
-    void * (*construct)(yaz_record_conv_t , const xmlNode *, const char *path,
+    void * (*construct)(const xmlNode *, const char *path,
                         WRBUF error_msg);
 
     /** \brief converts a record */
                         WRBUF error_msg);
 
     /** \brief converts a record */
index 5ef8913..bf3c362 100644 (file)
@@ -97,7 +97,7 @@ void yaz_record_conv_destroy(yaz_record_conv_t p)
 }
 
 #if YAZ_HAVE_XSLT
 }
 
 #if YAZ_HAVE_XSLT
-static void *construct_xslt(yaz_record_conv_t p, const xmlNode *ptr,
+static void *construct_xslt(const xmlNode *ptr,
                             const char *path, WRBUF wr_error)
 {
     struct _xmlAttr *attr;
                             const char *path, WRBUF wr_error)
 {
     struct _xmlAttr *attr;
@@ -241,7 +241,7 @@ static void destroy_xslt(void *info)
 #endif
 
 
 #endif
 
 
-static void *construct_marc(yaz_record_conv_t p, const xmlNode *ptr,
+static void *construct_marc(const xmlNode *ptr,
                             const char *path, WRBUF wr_error)
 {
     NMEM nmem = nmem_create();
                             const char *path, WRBUF wr_error)
 {
     NMEM nmem = nmem_create();
@@ -288,7 +288,7 @@ static void *construct_marc(yaz_record_conv_t p, const xmlNode *ptr,
     }
     if (!input_format)
     {
     }
     if (!input_format)
     {
-        wrbuf_printf(p->wr_error, "Element <marc>: "
+        wrbuf_printf(wr_error, "Element <marc>: "
                      "attribute 'inputformat' required");
         nmem_destroy(info->nmem);
         return 0;
                      "attribute 'inputformat' required");
         nmem_destroy(info->nmem);
         return 0;
@@ -364,7 +364,7 @@ static void *construct_marc(yaz_record_conv_t p, const xmlNode *ptr,
                                         info->input_charset);
         if (!cd)
         {
                                         info->input_charset);
         if (!cd)
         {
-            wrbuf_printf(p->wr_error, 
+            wrbuf_printf(wr_error, 
                          "Element <marc inputcharset='%s' outputcharset='%s'>:"
                          " Unsupported character set mapping"
                          " defined by attribute values",
                          "Element <marc inputcharset='%s' outputcharset='%s'>:"
                          " Unsupported character set mapping"
                          " defined by attribute values",
@@ -388,8 +388,8 @@ static void *construct_marc(yaz_record_conv_t p, const xmlNode *ptr,
         nmem_destroy(info->nmem);
         return 0;
     }
         nmem_destroy(info->nmem);
         return 0;
     }
-    info->input_charset = nmem_strdup(p->nmem, info->input_charset);
-    info->output_charset = nmem_strdup(p->nmem, info->output_charset);
+    info->input_charset = nmem_strdup(info->nmem, info->input_charset);
+    info->output_charset = nmem_strdup(info->nmem, info->output_charset);
     return info;
 }
 
     return info;
 }
 
@@ -491,7 +491,7 @@ int yaz_record_conv_configure_t(yaz_record_conv_t p, const xmlNode *ptr,
         for (t = &bt[0]; t; t = t->next)
         {
             wrbuf_rewind(p->wr_error);
         for (t = &bt[0]; t; t = t->next)
         {
             wrbuf_rewind(p->wr_error);
-            info = t->construct(p, ptr, p->path, p->wr_error);
+            info = t->construct(ptr, p->path, p->wr_error);
 
             if (info || wrbuf_len(p->wr_error))
                 break;
 
             if (info || wrbuf_len(p->wr_error))
                 break;