llow EXSLT to be used if it's available.
[yazproxy-moved-to-github.git] / src / yaz-proxy-main.cpp
index b5f3ffe..aa6b7c0 100644 (file)
@@ -1,7 +1,7 @@
-/* $Id: yaz-proxy-main.cpp,v 1.17 2005-09-07 09:28:46 adam Exp $
-   Copyright (c) 1998-2005, Index Data.
+/* $Id: yaz-proxy-main.cpp,v 1.21 2007-10-08 11:47:21 adam Exp $
+   Copyright (c) 1998-2006, Index Data.
 
-This file is part of the yaz-proxy.
+This file is part of the yazproxy.
 
 YAZ proxy is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -45,17 +45,21 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <yaz/log.h>
 #include <yaz/options.h>
 
-#include <yaz++/socket-manager.h>
-#include <yaz++/pdu-assoc.h>
+#include <yazpp/socket-manager.h>
+#include <yazpp/pdu-assoc.h>
 #include <yazproxy/proxy.h>
 
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 #include <libxslt/xsltutils.h>
 #include <libxslt/transform.h>
 #endif
 
+#if YAZ_HAVE_EXSLT
+#include <libexslt/exslt.h>
+#endif
+
 using namespace yazpp_1;
 
 void usage(char *prog)
@@ -179,7 +183,7 @@ static void sighup_handler(int num)
         static_yaz_proxy->reconfig();
 }
 
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
 static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
 {
     char buf[1024];
@@ -205,10 +209,14 @@ static void child_run(SocketManager *m, int run)
     signal(SIGHUP, sighup_handler);
 #endif
 
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
     xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
     xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler);
 #endif
+
+#if YAZ_HAVE_EXSLT
+    exsltRegisterAll();
+#endif
 #ifdef WIN32
 #else
     yaz_log(YLOG_LOG, "0 proxy run=%d pid=%ld", run, (long) getpid());
@@ -279,7 +287,7 @@ static void child_run(SocketManager *m, int run)
 
 int main(int argc, char **argv)
 {
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
     xmlInitMemory();
     
     LIBXML_TEST_VERSION