readconf.h record_conv.h retrieval.h statserv.h \
tcpip.h test.h timing.h unix.h tpath.h wrbuf.h xmalloc.h \
yaz-ccl.h yaz-iconv.h yaz-util.h yaz-version.h yconfig.h proto.h \
- xmlquery.h libxml2_error.h xmltypes.h snprintf.h query-charset.h \
+ xmlquery.h xmltypes.h snprintf.h query-charset.h \
mutex.h oid_db.h oid_util.h oid_std.h tokenizer.h copy_types.h \
icu.h match_glob.h poll.h daemon.h sc.h \
\
+++ /dev/null
-/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data.
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Index Data nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * \file libxml2_error.h
- * \brief Libxml2 error handler
- */
-
-#ifndef YAZ_LIBXML2_ERROR_H
-#define YAZ_LIBXML2_ERROR_H
-
-#include <stdio.h>
-#include <yaz/yconfig.h>
-
-YAZ_BEGIN_CDECL
-
-/** \brief direct Libxml2/Libxslt errors to yaz_log
- \param level yaz_log level to use
- \param lead_msg leading message (or NULL if none)
- \retval 0 successful; libxml2 is present
- \retval -1 failure; libxml2 is not present
-*/
-YAZ_EXPORT
-int libxml2_error_to_yazlog(int level, const char *lead_msg);
-
-YAZ_END_CDECL
-
-#endif
-/*
- * Local variables:
- * c-basic-offset: 4
- * c-file-style: "Stroustrup"
- * indent-tabs-mode: nil
- * End:
- * vim: shiftwidth=4 tabstop=8 expandtab
- */
-
odr_null.c ber_null.c odr_int.c ber_int.c odr_tag.c odr_cons.c \
odr_seq.c odr_oct.c ber_oct.c odr_bit.c ber_bit.c odr_oid.c \
ber_oid.c odr_use.c odr_choice.c odr_any.c ber_any.c odr.c odr_mem.c \
- dumpber.c odr_enum.c odr-priv.h libxml2_error.c \
+ dumpber.c odr_enum.c odr-priv.h \
comstack.c tcpip.c waislen.c unix.c \
prt-ext.c \
ill-get.c \
+++ /dev/null
-/* 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 <stdlib.h>
-#include <stdarg.h>
-#include <yaz/log.h>
-#include <yaz/snprintf.h>
-#include <yaz/libxml2_error.h>
-
-#if YAZ_HAVE_XML2
-#include <libxml/xmlerror.h>
-#endif
-
-#if YAZ_HAVE_XSLT
-#include <libxslt/xsltutils.h>
-#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
- */
-
int main(int argc, char **argv)
{
YAZ_CHECK_INIT(argc, argv);
- libxml2_error_to_yazlog(0 /* disable log */, 0);
+ yaz_log_xml_errors(0, 0 /* disable log */);
#if YAZ_HAVE_XML2
tst_configure();
#endif
{
YAZ_CHECK_INIT(argc, argv);
- libxml2_error_to_yazlog(0 /* disable it */, "");
+ yaz_log_xml_errors(0, 0 /* disable it */);
#if YAZ_HAVE_XSLT
tst_configure();
$(OBJDIR)\iso5426.obj \
$(OBJDIR)\record_conv.obj \
$(OBJDIR)\retrieval.obj \
- $(OBJDIR)\libxml2_error.obj \
$(OBJDIR)\test.obj \
$(OBJDIR)\diagbib1.obj \
$(OBJDIR)\diagsru_update.obj \