From: Adam Dickmeiss Date: Fri, 2 Mar 2012 10:28:34 +0000 (+0100) Subject: record_conv: change construct prototype X-Git-Tag: v4.2.28~3 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=b0be69c0a676f1702f12b2ea17cd73f9ebb08ea2;p=yaz-moved-to-github.git record_conv: change construct prototype Removing yaz_record_conv_t from construct conversion type handler. --- diff --git a/include/yaz/record_conv.h b/include/yaz/record_conv.h index d6af158..a9bdebe 100644 --- a/include/yaz/record_conv.h +++ b/include/yaz/record_conv.h @@ -61,7 +61,7 @@ struct yaz_record_conv_type { 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 */ diff --git a/src/record_conv.c b/src/record_conv.c index 5ef8913..bf3c362 100644 --- a/src/record_conv.c +++ b/src/record_conv.c @@ -97,7 +97,7 @@ void yaz_record_conv_destroy(yaz_record_conv_t p) } #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; @@ -241,7 +241,7 @@ static void destroy_xslt(void *info) #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(); @@ -288,7 +288,7 @@ static void *construct_marc(yaz_record_conv_t p, const xmlNode *ptr, } if (!input_format) { - wrbuf_printf(p->wr_error, "Element : " + wrbuf_printf(wr_error, "Element : " "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) { - wrbuf_printf(p->wr_error, + wrbuf_printf(wr_error, "Element :" " 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; } - 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; } @@ -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); - 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;