X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Frecord_conv.h;fp=include%2Fyaz%2Frecord_conv.h;h=acf1c82901cad25d11ee46eba7cc95a6135a6879;hb=95b69dabd857fa3342a71df2be123333b42c8da2;hp=501e1e983c170b3c365dabcfe278f0b1a3ee0ec6;hpb=558df80ae85811e84dbe5767df72bffdd19c3bcf;p=yaz-moved-to-github.git diff --git a/include/yaz/record_conv.h b/include/yaz/record_conv.h index 501e1e9..acf1c82 100644 --- a/include/yaz/record_conv.h +++ b/include/yaz/record_conv.h @@ -44,6 +44,22 @@ YAZ_BEGIN_CDECL /** record conversion handle */ typedef struct yaz_record_conv_struct *yaz_record_conv_t; +/** record conversion type */ +struct yaz_record_conv_type { + /** \brief internal; no need to set */ + 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, + WRBUF error_msg); + + /** \brief converts a record */ + int (*convert)(void *info, WRBUF record, WRBUF error_msg); + + /** \brief destroys our conversion handler */ + void (*destroy)(void *info); +}; + /** creates record handle \return record handle */ @@ -127,6 +143,14 @@ const char *yaz_record_conv_get_error(yaz_record_conv_t p); YAZ_EXPORT void yaz_record_conv_set_path(yaz_record_conv_t p, const char *path); +/** adds a type to our conversion handler + \param p record conversion handle + \param type info +*/ +YAZ_EXPORT +void yaz_record_conv_add_type(yaz_record_conv_t p, + struct yaz_record_conv_type *type); + YAZ_END_CDECL #endif