X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=include%2Fyaz%2Fnfaxml.h;h=98fd8a679dc3679e2172767cff5ccf1735be9115;hp=582f9e7cd3ada23d3f0b95e8e93194ed58443aaa;hb=fd3a0b7302ceed6425c05b6537cb654201cb1494;hpb=fb61309506b52ca0dad9aea4135ceeda63707b0d diff --git a/include/yaz/nfaxml.h b/include/yaz/nfaxml.h index 582f9e7..98fd8a6 100644 --- a/include/yaz/nfaxml.h +++ b/include/yaz/nfaxml.h @@ -1,6 +1,6 @@ /* Copyright (C) 2006, Index Data ApS * See the file LICENSE for details. - * $Id: nfaxml.h,v 1.1 2006-07-04 12:59:56 heikki Exp $ + * $Id: nfaxml.h,v 1.5 2006-07-14 13:06:37 heikki Exp $ */ /** @@ -10,7 +10,7 @@ * The xml file is something like this (using round brakcets * on tags, not to confuse our documentation tools) * (?xml ...) - * (charmap) + * (ruleset) * (rule) * (fromstring) FOO (/fromstring) * (tostring) BAR (/tostring) @@ -35,31 +35,34 @@ #ifndef YAZ_NFA_XML_H #define YAZ_NFA_XML_H +#if YAZ_HAVE_XML2 + +#include + #include #include #include -#if HAVE_XML2 -#include - YAZ_BEGIN_CDECL - - /** \brief Parse the NFA from a XML document * * \param doc the xml tree to parse - * \param error_info will be filled in case of errors + * \param filename used for info in error messages * * \returns either the NFA, or null in case of errors * * It is up to the caller to destroy the nfa when done. * + * Does not expand XIncludes. + * * In case of errors, returns a null pointer. You can then - * call xmlGetLastError() to get the details of the error. + * call xmlGetLastError() to get the details of the error, + * if you have a recent enough libxml2. Those are already + * logged in yazlog. * */ -yaz_nfa *yaz_nfa_parse_xml_doc(xmlDocPtr doc); +yaz_nfa *yaz_nfa_parse_xml_doc(xmlDocPtr doc, const char *filename); /** \brief Parse the NFA from a file @@ -71,18 +74,40 @@ yaz_nfa *yaz_nfa_parse_xml_doc(xmlDocPtr doc); * * It is up to the caller to destroy the nfa when done. * - * In case of errors, error_info will be filled with - * suitable diagnostics. It may be null, if you don't - * care. + * This routine also expands XIncludes. + * + * In case of errors, returns a null pointer. You can then + * call xmlGetLastError() to get the details of the error, + * if you have a recent enough libxml2. Those are already + * logged in yazlog. * */ -yaz_nfa *yaz_nfa_parse_xml_file(char *filepath); +yaz_nfa *yaz_nfa_parse_xml_file(const char *filepath); -YAZ_END_CDECL +/** \brief Parse the NFA from a memory buffer + * + * \param filepath path to the xml file to parse + * \param error_info will be filled in case of errors + * + * \returns either the NFA, or null in case of errors + * + * It is up to the caller to destroy the nfa when done. + * + * Does not expand XIncludes. + * + * In case of errors, returns a null pointer. You can then + * call xmlGetLastError() to get the details of the error, + * if you have a recent enough libxml2. Those are already + * logged in yazlog. + * + */ +yaz_nfa *yaz_nfa_parse_xml_memory(const char *xmlbuff, const char *filename); -#endif /* HAVE_XML2 */ +YAZ_END_CDECL + +#endif /* YAZ_HAVE_XML2 */ #endif /* YAZ_NFA_XML_H */ /*