From: Adam Dickmeiss Date: Thu, 6 Jul 2006 10:17:51 +0000 (+0000) Subject: For Libxml2 and friends, YAZ defines YAZ_HAVE_{XML2,XSLT,EXSLT) in X-Git-Tag: YAZ.2.1.26~41 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=fc6d778b923000b5c6ad8e108b0b184178a9d33f For Libxml2 and friends, YAZ defines YAZ_HAVE_{XML2,XSLT,EXSLT) in the compitation phase, but also for yaz-config --cflags output. This allows us to have public headers with Libxml2 stuff in them . It should also, eventually, make Libxml2 checks redundant in packages using YAZ, such as yazproxy. --- diff --git a/buildconf.sh b/buildconf.sh index acb37df..5f076a5 100755 --- a/buildconf.sh +++ b/buildconf.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: buildconf.sh,v 1.39 2006-06-27 12:23:11 adam Exp $ +# $Id: buildconf.sh,v 1.40 2006-07-06 10:17:51 adam Exp $ automake=automake aclocal=aclocal @@ -26,7 +26,7 @@ fi set -x # I am tired of underquoted warnings for Tcl macros -$aclocal -I m4 2>&1 | grep -v "warning: underquoted definition" +$aclocal -I m4 $libtoolize --automake --force $automake --add-missing $autoconf diff --git a/client/client.c b/client/client.c index 2204574..a2d1116 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: client.c,v 1.310 2006-06-02 13:12:53 adam Exp $ + * $Id: client.c,v 1.311 2006-07-06 10:17:51 adam Exp $ */ /** \file client.c * \brief yaz-client program @@ -86,7 +86,7 @@ static char *codeset = 0; /* character set for output */ static int hex_dump = 0; static char *dump_file_prefix = 0; static ODR out, in, print; /* encoding and decoding streams */ -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static ODR srw_sr_odr_out = 0; static Z_SRW_PDU *srw_sr = 0; #endif @@ -689,7 +689,7 @@ int session_connect(const char *arg) printf ("Couldn't create comstack\n"); return 0; } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 if (conn->protocol == PROTO_HTTP) queryType = QueryType_CQL; #else @@ -1257,7 +1257,7 @@ static int send_deleteResultSetRequest(const char *arg) return 2; } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static int send_srw(Z_SRW_PDU *sr) { const char *charset = negotiationCharset; @@ -1311,7 +1311,7 @@ static int send_srw(Z_SRW_PDU *sr) } #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static char *encode_SRW_term(ODR o, const char *q) { const char *in_charset = "ISO-8859-1"; @@ -2384,7 +2384,7 @@ static int cmd_explain(const char *arg) { if (protocol != PROTO_HTTP) return 0; -#if HAVE_XML2 +#if YAZ_HAVE_XML2 if (!conn) cmd_open(0); if (conn) @@ -2449,7 +2449,7 @@ static int cmd_find(const char *arg) } if (protocol == PROTO_HTTP) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 if (!conn) cmd_open(0); if (!conn) @@ -2657,7 +2657,7 @@ static int send_presentRequest(const char *arg) return 2; } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static int send_SRW_presentRequest(const char *arg) { char setstring[100]; @@ -2725,7 +2725,7 @@ static int cmd_show(const char *arg) { if (protocol == PROTO_HTTP) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 if (!conn) cmd_open(0); if (!conn) @@ -3046,7 +3046,7 @@ int cmd_scan(const char *arg) { if (protocol == PROTO_HTTP) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 if (!conn) cmd_open(0); if (!conn) @@ -3700,7 +3700,7 @@ static void initialize(void) struct timeval tv_start; #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static void handle_srw_record(Z_SRW_record *rec) { if (rec->recordPosition) @@ -3999,7 +3999,7 @@ void wait_and_handle_response(int one_response_only) close_session (); } } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 else if (gdu->which == Z_GDU_HTTP_Response) { http_response(gdu->u.HTTP_Response); diff --git a/configure.ac b/configure.ac index 684b43a..23ded0f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl YAZ Toolkit, Index Data 1994-2006 dnl See the file LICENSE for details. -dnl $Id: configure.ac,v 1.27 2006-06-27 12:23:11 adam Exp $ +dnl $Id: configure.ac,v 1.28 2006-07-06 10:17:51 adam Exp $ AC_PREREQ(2.59) AC_INIT([yaz],[2.1.23],[adam@indexdata.dk]) AC_CONFIG_SRCDIR(configure.ac) @@ -321,10 +321,30 @@ fi dnl ----- libXSLT/libEXLT/libXML2 AC_SUBST(XML2_CFLAGS) +AC_SUBST(YAZ_CONFIG_CFLAGS) +YAZ_CONFIG_CFLAGS="" -YAZ_LIBXML2 -YAZ_LIBXSLT -YAZ_LIBEXSLT +YAZ_LIBXML2( + [ + AC_DEFINE(YAZ_HAVE_XML2) + YAZ_CONFIG_CFLAGS="$YAZ_CONFIG_CFLAGS -DYAZ_HAVE_XML2=1" + ] +) + +YAZ_LIBXSLT( + [ + AC_DEFINE(YAZ_HAVE_XSLT) + YAZ_CONFIG_CFLAGS="$YAZ_CONFIG_CFLAGS -DYAZ_HAVE_XSLT=1" + ] +) +YAZ_LIBEXSLT( + [ + AC_DEFINE(YAZ_HAVE_EXSLT) + YAZ_CONFIG_CFLAGS="$YAZ_CONFIG_CFLAGS -DYAZ_HAVE_EXSLT=1" + ] +) + +YAZ_CONFIG_CFLAGS="$YAZ_CONFIG_CFLAGS $XML2_CFLAGS" if test "$XML2_LIBS"; then LIBS="$XML2_LIBS $LIBS" diff --git a/include/yaz/xmlquery.h b/include/yaz/xmlquery.h index 7eb13ef..6456f0b 100644 --- a/include/yaz/xmlquery.h +++ b/include/yaz/xmlquery.h @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: xmlquery.h,v 1.4 2006-04-20 20:50:51 adam Exp $ + * $Id: xmlquery.h,v 1.5 2006-07-06 10:17:52 adam Exp $ */ /** \file xmlquery.h @@ -12,13 +12,16 @@ #ifndef YAZ_XMLQUERY_H #define YAZ_XMLQUERY_H +#if YAZ_HAVE_XML2 #include #include +#include + YAZ_BEGIN_CDECL -YAZ_EXPORT void yaz_query2xml(const Z_Query *q, void *docp_void); -YAZ_EXPORT void yaz_rpnquery2xml(const Z_RPNQuery *rpn, void *docp_void); +YAZ_EXPORT void yaz_query2xml(const Z_Query *q, xmlDocPtr *docp); +YAZ_EXPORT void yaz_rpnquery2xml(const Z_RPNQuery *rpn, xmlDocPtr *docp); YAZ_EXPORT void yaz_xml2query(const void *xmlnodep, Z_Query **query, ODR odr, int *error_code, const char **addinfo); @@ -26,6 +29,8 @@ YAZ_EXPORT void yaz_xml2query(const void *xmlnodep, Z_Query **query, ODR odr, YAZ_END_CDECL #endif +#endif + /* * Local variables: * c-basic-offset: 4 diff --git a/src/libxml2_error.c b/src/libxml2_error.c index 3241a63..00f5881 100644 --- a/src/libxml2_error.c +++ b/src/libxml2_error.c @@ -2,7 +2,7 @@ * Copyright (C) 2006, Index Data ApS * See the file LICENSE for details. * - * $Id: libxml2_error.c,v 1.1 2006-05-07 17:45:41 adam Exp $ + * $Id: libxml2_error.c,v 1.2 2006-07-06 10:17:53 adam Exp $ */ /** * \file libxml2_error.c @@ -14,11 +14,11 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #endif -#if HAVE_XSLT +#if YAZ_HAVE_XSLT #include #endif @@ -44,10 +44,10 @@ static void proxy_xml_error_handler(void *ctx, const char *fmt, ...) int libxml2_error_to_yazlog(int level, const char *lead_msg) { libxml2_error_level = level; -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler); #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler); return 0; #else diff --git a/src/marcdisp.c b/src/marcdisp.c index e7df01e..2b06b2a 100644 --- a/src/marcdisp.c +++ b/src/marcdisp.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: marcdisp.c,v 1.30 2006-05-23 13:17:30 adam Exp $ + * $Id: marcdisp.c,v 1.31 2006-07-06 10:17:53 adam Exp $ */ /** @@ -26,7 +26,7 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include #endif @@ -181,7 +181,7 @@ void yaz_marc_add_controlfield(yaz_marc_t mt, const char *tag, } } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 void yaz_marc_add_controlfield_xml(yaz_marc_t mt, const xmlNode *ptr_tag, const xmlNode *ptr_data) { @@ -206,7 +206,7 @@ void yaz_marc_add_datafield(yaz_marc_t mt, const char *tag, mt->subfield_pp = &n->u.datafield.subfields; } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 void yaz_marc_add_datafield_xml(yaz_marc_t mt, const xmlNode *ptr_tag, const char *indicator, size_t indicator_len) { @@ -692,7 +692,7 @@ int yaz_marc_write_iso2709(yaz_marc_t mt, WRBUF wr) return 0; } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 int yaz_marc_read_xml_subfields(yaz_marc_t mt, const xmlNode *ptr) { for (; ptr; ptr = ptr->next) diff --git a/src/nfaxml.c b/src/nfaxml.c index e423643..4bd2c4e 100644 --- a/src/nfaxml.c +++ b/src/nfaxml.c @@ -1,7 +1,7 @@ /* Copyright (C) 2006, Index Data ApS * See the file LICENSE for details. * - * $Id: nfaxml.c,v 1.5 2006-07-06 08:28:37 adam Exp $ + * $Id: nfaxml.c,v 1.6 2006-07-06 10:17:53 adam Exp $ */ /** @@ -10,7 +10,7 @@ * */ -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include @@ -75,7 +75,7 @@ yaz_nfa *yaz_nfa_parse_xml_file(const char *filepath) { -#endif /* HAVE_XML2 */ +#endif /* YAZ_HAVE_XML2 */ /* diff --git a/src/nmemsdup.c b/src/nmemsdup.c index 7b2a051..a0856ec 100644 --- a/src/nmemsdup.c +++ b/src/nmemsdup.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: nmemsdup.c,v 1.7 2006-05-03 13:04:46 adam Exp $ + * $Id: nmemsdup.c,v 1.8 2006-07-06 10:17:53 adam Exp $ */ /** @@ -16,7 +16,7 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #endif @@ -89,7 +89,7 @@ void nmem_strsplit(NMEM nmem, const char *delim, const char *dstr, } } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 char *nmem_text_node_cdata(const void *ptr_cdata, NMEM nmem) { char *cdata; diff --git a/src/record_conv.c b/src/record_conv.c index 94447f5..9d8a934 100644 --- a/src/record_conv.c +++ b/src/record_conv.c @@ -2,7 +2,7 @@ * Copyright (C) 2005-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: record_conv.c,v 1.10 2006-05-26 15:07:08 adam Exp $ + * $Id: record_conv.c,v 1.11 2006-07-06 10:17:53 adam Exp $ */ /** * \file record_conv.c @@ -22,15 +22,15 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include #include -#if HAVE_XSLT +#if YAZ_HAVE_XSLT #include #include #endif -#if HAVE_EXSLT +#if YAZ_HAVE_EXSLT #include #endif @@ -64,7 +64,7 @@ enum YAZ_RECORD_CONV_RULE struct yaz_record_conv_rule { enum YAZ_RECORD_CONV_RULE which; union { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT struct { xsltStylesheetPtr xsp; } xslt; @@ -89,7 +89,7 @@ static void yaz_record_conv_reset(yaz_record_conv_t p) if (r->u.marc.iconv_t) yaz_iconv_close(r->u.marc.iconv_t); } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT else if (r->which == YAZ_RECORD_CONV_RULE_XSLT) { xsltFreeStylesheet(r->u.xslt.xsp); @@ -112,7 +112,7 @@ yaz_record_conv_t yaz_record_conv_create() p->rules = 0; p->path = 0; -#if HAVE_EXSLT +#if YAZ_HAVE_EXSLT exsltRegisterAll(); #endif yaz_record_conv_reset(p); @@ -146,7 +146,7 @@ static struct yaz_record_conv_rule *add_rule(yaz_record_conv_t p, /** \brief parse 'xslt' conversion node */ static int conv_xslt(yaz_record_conv_t p, const xmlNode *ptr) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT struct _xmlAttr *attr; const char *stylesheet = 0; @@ -334,7 +334,7 @@ int yaz_record_conv_configure(yaz_record_conv_t p, const void *ptr_v) } else if (!strcmp((const char *) ptr->name, "exslt")) { -#if HAVE_EXSLT +#if YAZ_HAVE_EXSLT if (conv_xslt(p, ptr)) return -1; #else @@ -425,7 +425,7 @@ int yaz_record_conv_record(yaz_record_conv_t p, } yaz_marc_destroy(mt); } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT else if (r->which == YAZ_RECORD_CONV_RULE_XSLT) { xmlDocPtr doc = xmlParseMemory(wrbuf_buf(record), @@ -443,7 +443,7 @@ int yaz_record_conv_record(yaz_record_conv_t p, xmlChar *out_buf = 0; int out_len; -#if HAVE_XSLTSAVERESULTTOSTRING +#if YAZ_HAVE_XSLTSAVERESULTTOSTRING xsltSaveResultToString(&out_buf, &out_len, res, r->u.xslt.xsp); #else diff --git a/src/retrieval.c b/src/retrieval.c index d902642..12cf9d8 100644 --- a/src/retrieval.c +++ b/src/retrieval.c @@ -2,7 +2,7 @@ * Copyright (C) 2005-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: retrieval.c,v 1.10 2006-05-09 13:39:47 adam Exp $ + * $Id: retrieval.c,v 1.11 2006-07-06 10:17:53 adam Exp $ */ /** * \file retrieval.c @@ -21,7 +21,7 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include #include diff --git a/src/seshigh.c b/src/seshigh.c index 768e22a..3b2614c 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.87 2006-06-20 21:20:51 adam Exp $ + * $Id: seshigh.c,v 1.88 2006-07-06 10:17:53 adam Exp $ */ /** * \file seshigh.c @@ -50,7 +50,7 @@ #include #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include #endif @@ -577,7 +577,7 @@ static void set_esn(Z_RecordComposition **comp_p, const char *esn, NMEM nmem) static int retrieve_fetch(association *assoc, bend_fetch_rr *rr) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 yaz_record_conv_t rc = 0; const char *match_schema = 0; int *match_syntax = 0; @@ -1141,7 +1141,7 @@ static void srw_bend_search(association *assoc, request *req, static char *srw_bend_explain_default(void *handle, bend_explain_rr *rr) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 xmlNodePtr ptr = rr->server_node_ptr; if (!ptr) return 0; @@ -1791,7 +1791,7 @@ static void process_http_request(association *assoc, request *req) if (http_code == 200 || http_code == 500) { static Z_SOAP_Handler soap_handlers[4] = { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 {"http://www.loc.gov/zing/srw/", 0, (Z_SOAP_fun) yaz_srw_codec}, {"http://www.loc.gov/zing/srw/v1.0/", 0, @@ -2288,7 +2288,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) assoc->init->implementation_name, odr_prepend(assoc->encode, "GFS", resp->implementationName)); - version = odr_strdup(assoc->encode, "$Revision: 1.87 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.88 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode, diff --git a/src/soap.c b/src/soap.c index 45e86cb..5bfa8b3 100644 --- a/src/soap.c +++ b/src/soap.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: soap.c,v 1.13 2006-03-01 23:24:25 adam Exp $ + * $Id: soap.c,v 1.14 2006-07-06 10:17:54 adam Exp $ */ /** * \file soap.c @@ -14,7 +14,7 @@ #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include diff --git a/src/srw.c b/src/srw.c index 958a85b..aaadd43 100644 --- a/src/srw.c +++ b/src/srw.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: srw.c,v 1.45 2006-05-07 14:31:30 adam Exp $ + * $Id: srw.c,v 1.46 2006-07-06 10:17:54 adam Exp $ */ /** * \file srw.c @@ -10,7 +10,7 @@ */ #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include diff --git a/src/srwutil.c b/src/srwutil.c index 841b571..9e698c6 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: srwutil.c,v 1.44 2006-06-14 05:47:10 adam Exp $ + * $Id: srwutil.c,v 1.45 2006-07-06 10:17:54 adam Exp $ */ /** * \file srwutil.c @@ -333,7 +333,7 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, const char *charset_p = 0; static Z_SOAP_Handler soap_handlers[4] = { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 {"http://www.loc.gov/zing/srw/", 0, (Z_SOAP_fun) yaz_srw_codec}, {"http://www.loc.gov/zing/srw/v1.0/", 0, @@ -422,7 +422,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, Z_SOAP **soap_package, ODR decode, char **charset, Z_SRW_diagnostic **diag, int *num_diag) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static Z_SOAP_Handler soap_handlers[2] = { {"http://www.loc.gov/zing/srw/", 0, (Z_SOAP_fun) yaz_srw_codec}, @@ -447,7 +447,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, { char *db = "Default"; const char *p0 = hreq->path, *p1; -#if HAVE_XML2 +#if YAZ_HAVE_XML2 const char *operation = 0; char *version = 0; char *query = 0; @@ -486,7 +486,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, if (!strcmp(hreq->method, "POST")) p1 = hreq->content_buf; yaz_uri_array(p1, decode, &uri_name, &uri_val); -#if HAVE_XML2 +#if YAZ_HAVE_XML2 if (uri_name) { int i; @@ -1207,7 +1207,7 @@ int yaz_sru_soap_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu, ODR odr, const char *charset) { Z_SOAP_Handler handlers[2] = { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 {"http://www.loc.gov/zing/srw/", 0, (Z_SOAP_fun) yaz_srw_codec}, #endif {0, 0, 0} diff --git a/src/statserv.c b/src/statserv.c index 1735314..ccd0007 100644 --- a/src/statserv.c +++ b/src/statserv.c @@ -5,7 +5,7 @@ * NT threaded server code by * Chas Woodfield, Fretwell Downing Informatics. * - * $Id: statserv.c,v 1.38 2006-05-08 10:16:47 adam Exp $ + * $Id: statserv.c,v 1.39 2006-07-06 10:17:54 adam Exp $ */ /** @@ -36,7 +36,7 @@ #include #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include #include @@ -144,11 +144,11 @@ static void get_logbits(int force) static int add_listener(char *where, int listen_id); -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static xmlDocPtr xml_config_doc = 0; #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static xmlNodePtr xml_config_get_root() { xmlNodePtr ptr = 0; @@ -168,7 +168,7 @@ static xmlNodePtr xml_config_get_root() } #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static char *nmem_dup_xml_content(NMEM n, xmlNodePtr ptr) { unsigned char *cp; @@ -222,7 +222,7 @@ static struct gfs_server * gfs_server_new() n->directory = 0; n->docpath = 0; n->stylesheet = 0; -#if HAVE_XML2 +#if YAZ_HAVE_XML2 n->retrieval = yaz_retrieval_create(); #endif return n; @@ -322,7 +322,7 @@ static void xml_config_read() { struct gfs_server **gfsp = &gfs_server_list; struct gfs_listen **gfslp = &gfs_listen_list; -#if HAVE_XML2 +#if YAZ_HAVE_XML2 xmlNodePtr ptr = xml_config_get_root(); if (!ptr) @@ -467,7 +467,7 @@ static void xml_config_open() #endif gfs_nmem = nmem_create(); -#if HAVE_XML2 +#if YAZ_HAVE_XML2 if (control_block.xml_config[0] == '\0') return; @@ -496,7 +496,7 @@ static void xml_config_open() static void xml_config_close() { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 if (xml_config_doc) { xmlFreeDoc(xml_config_doc); @@ -1440,7 +1440,7 @@ int check_options(int argc, char **argv) option_copy(control_block.pid_fname, arg); break; case 'f': -#if HAVE_XML2 +#if YAZ_HAVE_XML2 option_copy(control_block.xml_config, arg); #else fprintf(stderr, "%s: Option -f unsupported since YAZ is compiled without Libxml2 support\n", me); diff --git a/src/xmlquery.c b/src/xmlquery.c index 2323509..62ebd7f 100644 --- a/src/xmlquery.c +++ b/src/xmlquery.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * All rights reserved. * - * $Id: xmlquery.c,v 1.9 2006-05-02 20:47:45 adam Exp $ + * $Id: xmlquery.c,v 1.10 2006-07-06 10:17:54 adam Exp $ */ /** \file xmlquery.c @@ -13,7 +13,7 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include @@ -248,18 +248,17 @@ xmlNodePtr yaz_query2xml_cql(const char *cql, xmlNodePtr node) return 0; } -void yaz_rpnquery2xml(const Z_RPNQuery *rpn, void *docp_void) +void yaz_rpnquery2xml(const Z_RPNQuery *rpn, xmlDocPtr *docp) { Z_Query query; query.which = Z_Query_type_1; query.u.type_1 = (Z_RPNQuery *) rpn; - yaz_query2xml(&query, docp_void); + yaz_query2xml(&query, docp); } -void yaz_query2xml(const Z_Query *q, void *docp_void) +void yaz_query2xml(const Z_Query *q, xmlDocPtr *docp) { - xmlDocPtr *docp = (xmlDocPtr *) docp_void; xmlNodePtr top_node, q_node = 0, child_node = 0; assert(q); @@ -777,7 +776,7 @@ void yaz_xml2query(const void *xmlnodep, Z_Query **query, ODR odr, yaz_xml2query_(xmlnodep, query, odr, error_code, addinfo); } -/* HAVE_XML2 */ +/* YAZ_HAVE_XML2 */ #endif /* diff --git a/src/zoom-c.c b/src/zoom-c.c index 82044fa..0ff631d 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: zoom-c.c,v 1.80 2006-06-16 12:34:32 adam Exp $ + * $Id: zoom-c.c,v 1.81 2006-07-06 10:17:54 adam Exp $ */ /** * \file zoom-c.c @@ -152,7 +152,7 @@ static void set_dset_error (ZOOM_connection c, int error, addinfo2 ? addinfo2 : ""); } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static void set_HTTP_error (ZOOM_connection c, int error, const char *addinfo, const char *addinfo2) { @@ -1008,7 +1008,7 @@ static zoom_ret do_connect (ZOOM_connection c) if (c->cs && c->cs->protocol == PROTO_HTTP) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 const char *path = 0; c->proto = PROTO_HTTP; @@ -1196,7 +1196,7 @@ static zoom_ret ZOOM_connection_send_init (ZOOM_connection c) ZOOM_options_get(c->options, "implementationName"), odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName)); - version = odr_strdup(c->odr_out, "$Revision: 1.80 $"); + version = odr_strdup(c->odr_out, "$Revision: 1.81 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; ireq->implementationVersion = odr_prepend(c->odr_out, @@ -1274,7 +1274,7 @@ static zoom_ret ZOOM_connection_send_init (ZOOM_connection c) return send_APDU (c, apdu); } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static zoom_ret send_srw (ZOOM_connection c, Z_SRW_PDU *sr) { Z_GDU *gdu; @@ -1305,7 +1305,7 @@ static zoom_ret send_srw (ZOOM_connection c, Z_SRW_PDU *sr) } #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) { int i; @@ -3406,7 +3406,7 @@ static void recv_apdu (ZOOM_connection c, Z_APDU *apdu) } } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static void handle_srw_response(ZOOM_connection c, Z_SRW_searchRetrieveResponse *res) { @@ -3485,7 +3485,7 @@ static void handle_srw_response(ZOOM_connection c, } #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres) { int ret = -1; @@ -3605,7 +3605,7 @@ static int do_read (ZOOM_connection c) recv_apdu (c, gdu->u.z3950); else if (gdu->which == Z_GDU_HTTP_Response) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 handle_http (c, gdu->u.HTTP_Response); #else set_ZOOM_error(c, ZOOM_ERROR_DECODE, 0); diff --git a/test/nfaxmltest1.c b/test/nfaxmltest1.c index 04c26ee..106c78d 100644 --- a/test/nfaxmltest1.c +++ b/test/nfaxmltest1.c @@ -1,7 +1,7 @@ /* Copyright (C) 2006, Index Data ApS * See the file LICENSE for details. * - * $Id: nfaxmltest1.c,v 1.1 2006-07-05 08:12:48 heikki Exp $ + * $Id: nfaxmltest1.c,v 1.2 2006-07-06 10:17:55 adam Exp $ * */ @@ -13,7 +13,7 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include diff --git a/test/tst_record_conv.c b/test/tst_record_conv.c index 7846373..358b73d 100644 --- a/test/tst_record_conv.c +++ b/test/tst_record_conv.c @@ -2,7 +2,7 @@ * Copyright (C) 2005-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: tst_record_conv.c,v 1.8 2006-05-08 10:16:47 adam Exp $ + * $Id: tst_record_conv.c,v 1.9 2006-07-06 10:17:55 adam Exp $ * */ #include @@ -16,7 +16,7 @@ #include #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include @@ -113,7 +113,7 @@ static void tst_configure() YAZ_CHECK(conv_configure_test("", "Bad element 'bad'." "Expected marc, xslt, ..", 0)); -#if HAVE_XSLT +#if YAZ_HAVE_XSLT YAZ_CHECK(conv_configure_test("" "" " @@ -16,7 +16,7 @@ #include #endif -#if HAVE_XSLT +#if YAZ_HAVE_XSLT #include #include @@ -233,7 +233,7 @@ int main(int argc, char **argv) libxml2_error_to_yazlog(0 /* disable it */, ""); -#if HAVE_XSLT +#if YAZ_HAVE_XSLT tst_configure(); #endif YAZ_CHECK_TERM; diff --git a/test/tstsoap1.c b/test/tstsoap1.c index 7da6967..2290e83 100644 --- a/test/tstsoap1.c +++ b/test/tstsoap1.c @@ -2,18 +2,18 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tstsoap1.c,v 1.6 2006-01-30 16:58:06 adam Exp $ + * $Id: tstsoap1.c,v 1.7 2006-07-06 10:17:55 adam Exp $ */ #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #endif #include void tst() { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 xmlChar *buf_out; int len_out; xmlDocPtr doc; @@ -38,14 +38,14 @@ void tst() #endif -/* HAVE_XML2 */ +/* YAZ_HAVE_XML2 */ #endif } int main(int argc, char **argv) { YAZ_CHECK_INIT(argc, argv); -#if HAVE_XML2 +#if YAZ_HAVE_XML2 LIBXML_TEST_VERSION; #endif tst(); diff --git a/test/tstsoap2.c b/test/tstsoap2.c index 8884920..6bf0181 100644 --- a/test/tstsoap2.c +++ b/test/tstsoap2.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tstsoap2.c,v 1.4 2006-02-01 19:53:00 adam Exp $ + * $Id: tstsoap2.c,v 1.5 2006-07-06 10:17:55 adam Exp $ */ #include @@ -10,7 +10,7 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include static void tst_srw(void) @@ -52,7 +52,7 @@ static void tst_srw(void) int main(int argc, char **argv) { YAZ_CHECK_INIT(argc, argv); -#if HAVE_XML2 +#if YAZ_HAVE_XML2 LIBXML_TEST_VERSION; tst_srw(); #endif diff --git a/test/tstxmlquery.c b/test/tstxmlquery.c index aea6177..8f0e13b 100644 --- a/test/tstxmlquery.c +++ b/test/tstxmlquery.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tstxmlquery.c,v 1.10 2006-02-23 11:17:25 adam Exp $ + * $Id: tstxmlquery.c,v 1.11 2006-07-06 10:17:55 adam Exp $ */ #include @@ -14,7 +14,7 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include #endif @@ -47,7 +47,7 @@ enum pqf2xml_status pqf2xml_text(const char *pqf, const char *expect_xml, status = PQF_FAILED; else { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 xmlDocPtr doc = 0; yaz_rpnquery2xml(rpn, &doc); @@ -107,7 +107,7 @@ enum pqf2xml_status pqf2xml_text(const char *pqf, const char *expect_xml, static void tst() { YAZ_CHECK_EQ(pqf2xml_text("@attr 1=4 bad query", "", 0), PQF_FAILED); -#if HAVE_XML2 +#if YAZ_HAVE_XML2 YAZ_CHECK_EQ(pqf2xml_text( "@attr 1=4 computer", "\n" diff --git a/util/marcdump.c b/util/marcdump.c index f5087e4..3b6163c 100644 --- a/util/marcdump.c +++ b/util/marcdump.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: marcdump.c,v 1.39 2006-06-12 16:12:58 mike Exp $ + * $Id: marcdump.c,v 1.40 2006-07-06 10:17:55 adam Exp $ */ #define _FILE_OFFSET_BITS 64 @@ -11,7 +11,7 @@ #include #endif -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #include @@ -54,7 +54,7 @@ static void usage(const char *prog) prog); } -#if HAVE_XML2 +#if YAZ_HAVE_XML2 static void marcdump_read_xml(yaz_marc_t mt, const char *fname) { xmlNodePtr ptr; @@ -105,7 +105,7 @@ static void dump(const char *fname, const char *from, const char *to, if (read_xml) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 marcdump_read_xml(mt, fname); #else return; @@ -285,7 +285,7 @@ int main (int argc, char **argv) cfile = fopen(arg, "w"); break; case 'x': -#if HAVE_XML2 +#if YAZ_HAVE_XML2 read_xml = 1; #else fprintf(stderr, "%s: -x not supported." diff --git a/util/srwtst.c b/util/srwtst.c index 1524abc..35e60b4 100644 --- a/util/srwtst.c +++ b/util/srwtst.c @@ -2,13 +2,13 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: srwtst.c,v 1.4 2005-06-25 15:46:07 adam Exp $ + * $Id: srwtst.c,v 1.5 2006-07-06 10:17:55 adam Exp $ */ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 Z_SOAP_Handler h[2] = { {"http://www.loc.gov/zing/srw/v1.0/", 0, (Z_SOAP_fun) yaz_srw_codec}, {0, 0, 0} diff --git a/util/yaz-xmlquery.c b/util/yaz-xmlquery.c index 12a9c47..b2dc588 100644 --- a/util/yaz-xmlquery.c +++ b/util/yaz-xmlquery.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: yaz-xmlquery.c,v 1.2 2006-03-06 08:11:41 adam Exp $ + * $Id: yaz-xmlquery.c,v 1.3 2006-07-06 10:17:55 adam Exp $ */ #include @@ -14,13 +14,13 @@ #include #include -#if HAVE_XML2 +#if YAZ_HAVE_XML2 #include #endif static char *prog = "yaz-xmlquery"; -#if HAVE_XML2 +#if YAZ_HAVE_XML2 void pqftoxmlquery(const char *pqf) { YAZ_PQF_Parser parser = yaz_pqf_create(); @@ -163,7 +163,7 @@ void usage() int main (int argc, char **argv) { -#if HAVE_XML2 +#if YAZ_HAVE_XML2 char *arg; int r; int active = 0; diff --git a/win/makefile b/win/makefile index 4ad9634..879a6c2 100644 --- a/win/makefile +++ b/win/makefile @@ -1,6 +1,6 @@ # Copyright (C) 1994-2006, Index Data ApS # All rights reserved. -# $Id: makefile,v 1.112 2006-07-05 13:05:32 adam Exp $ +# $Id: makefile,v 1.113 2006-07-06 10:17:56 adam Exp $ # # Programmed by # Heikki Levanto & Adam Dickmeiss @@ -151,7 +151,7 @@ iconv: !if $(HAVE_LIBXML2) LIBXML2_LIB="$(LIBXML2_DIR)\lib\libxml2.lib" -LIBXML2_DEF=/D HAVE_XML2=1 /I"$(LIBXML2_DIR)\include" +LIBXML2_DEF=/D YAZ_HAVE_XML2=1 /I"$(LIBXML2_DIR)\include" libxml2: $(BINDIR)\libxml2.dll $(BINDIR)\zlib1.dll $(BINDIR)\libxml2.dll: @@ -162,7 +162,7 @@ $(BINDIR)\zlib1.dll: !else LIBXML2_LIB= -LIBXML2_DEF=/D HAVE_XML2=0 +LIBXML2_DEF=/D YAZ_HAVE_XML2=0 libxml2: !endif @@ -171,7 +171,7 @@ libxml2: LIBXSLT_LIB="$(LIBXSLT_DIR)\lib\libxslt.lib" LIBXSLT_DEF= \ /D HAVE_XSLTSAVERESULTTOSTRING=1 \ - /D HAVE_XSLT=1 \ + /D YAZ_HAVE_XSLT=1 \ /I"$(LIBXSLT_DIR)\include" libxslt: $(BINDIR)\libxslt.dll @@ -180,7 +180,7 @@ $(BINDIR)\libxslt.dll: !else LIBXSLT_LIB= -LIBXSLT_DEF=/D HAVE_XSLT=0 +LIBXSLT_DEF=/D YAZ_HAVE_XSLT=0 libxslt: !endif diff --git a/yaz-config.in b/yaz-config.in index d2325ab..e4d99da 100644 --- a/yaz-config.in +++ b/yaz-config.in @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: yaz-config.in,v 1.24 2006-06-13 15:36:09 adam Exp $ +# $Id: yaz-config.in,v 1.25 2006-07-06 10:17:51 adam Exp $ yazprefix=@prefix@ yaz_echo_cflags=no yaz_echo_libs=no @@ -75,11 +75,13 @@ done lyaz="-lyaz" +YAZINC="@YAZ_CONFIG_CFLAGS@" + if test "$yaz_echo_source" = "yes"; then YAZBIN=${yaz_build_root}/bin YAZLIB="-L${yaz_build_root}/src/.libs $lyaz $yazextralibs" YAZLALIB="${yaz_build_root}/src/libyaz.la $yazextralibs" - YAZINC="-I${yaz_src_root}/include" + YAZINC="$YAZINC -I${yaz_src_root}/include" YAZCOMP=${yaz_src_root}/util/yaz-asncomp else YAZBIN=${yazprefix}/bin @@ -91,15 +93,11 @@ else YAZLIB="-L$yazprefix/lib $lyaz $yazextralibs" fi YAZLALIB=$YAZLIB - if test "$yazprefix" = "/usr"; then - YAZINC= - else - YAZINC=-I$yazprefix/include + if test "$yazprefix" != "/usr"; then + YAZINC="$YAZINC -I$yazprefix/include" fi fi -YAZINC="$YAZINC @YAZ_CONF_CFLAGS@" - if test "$lib_thread" = "yes"; then YAZINC="$YAZINC @THREAD_CFLAGS@" fi