X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Flibxml2_error.c;fp=src%2Flibxml2_error.c;h=0000000000000000000000000000000000000000;hb=1aac63eecd76d5d060da84037a355c153d747ca7;hp=332c7af2dd850d0304379ff0e6de47283daf399e;hpb=d68f051b434a3a6171e56f12c798fd499e9abbbb;p=yaz-moved-to-github.git diff --git a/src/libxml2_error.c b/src/libxml2_error.c deleted file mode 100644 index 332c7af..0000000 --- a/src/libxml2_error.c +++ /dev/null @@ -1,63 +0,0 @@ -/* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2010 Index Data - * See the file LICENSE for details. - */ -/** - * \file libxml2_error.c - * \brief Libxml2 error handling - */ - -#include -#include -#include -#include -#include - -#if YAZ_HAVE_XML2 -#include -#endif - -#if YAZ_HAVE_XSLT -#include -#endif - -static int libxml2_error_level = 0; - -#if YAZ_HAVE_XML2 -static void proxy_xml_error_handler(void *ctx, const char *fmt, ...) -{ - char buf[1024]; - - va_list ap; - va_start(ap, fmt); - - yaz_vsnprintf(buf, sizeof(buf)-1, fmt, ap); - yaz_log(libxml2_error_level, "%s: %s", (char*) ctx, buf); - - va_end (ap); -} -#endif - -int libxml2_error_to_yazlog(int level, const char *lead_msg) -{ - libxml2_error_level = level; -#if YAZ_HAVE_XML2 - xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler); -#if YAZ_HAVE_XSLT - xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler); -#endif - return 0; -#else - return -1; -#endif -} - -/* - * Local variables: - * c-basic-offset: 4 - * c-file-style: "Stroustrup" - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ -