[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[xml] libxml2.zlib-feature.awn.1.patch
- From: "Andrew W. Nosenko" <andrew w nosenko gmail com>
- To: xml gnome org
- Subject: [xml] libxml2.zlib-feature.awn.1.patch
- Date: Tue, 11 Jul 2006 13:50:27 +0300
Attached patch allows to see, whether libxml2 was compiled with Zlib
support over 'xmllint --help' and/or 'xmlHasFeature(XML_WITH_ZLIB)'.
2006-07-11 Andrew W. Nosenko <andrew w nosenko gmail com>
* parser.c (xmlHasFeature):
* include/libxml/parser.h (XML_WITH_ZLIB):
* include/libxml/xmlversion.h.in:
* configure.in:
Possiblity to check, whether libxml2 was compiled with Zlib
support, is added.
* xmllint.c (showVersion):
Use it.
--
Andrew W. Nosenko <andrew w nosenko gmail com>
2006-07-11 Andrew W. Nosenko <andrew w nosenko gmail com>
* parser.c (xmlHasFeature):
* include/libxml/parser.h (XML_WITH_ZLIB):
* include/libxml/xmlversion.h.in:
* configure.in:
Possiblity to check, whether libxml2 was compiled with Zlib
support, is added.
* xmllint.c (showVersion):
Use it.
Index: configure.in
===================================================================
RCS file: /cvs/gnome/libxml2/configure.in,v
retrieving revision 1.319
diff -u -p -r1.319 configure.in
--- configure.in 8 Jun 2006 08:16:30 -0000 1.319
+++ configure.in 11 Jul 2006 10:36:59 -0000
@@ -325,12 +325,14 @@ echo Checking zlib
dnl Checks for zlib library.
+WITH_ZLIB=0
if test "$with_zlib" = "no"; then
echo "Disabling compression support"
else
AC_CHECK_HEADERS(zlib.h,
AC_CHECK_LIB(z, gzread,[
- AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
+ AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
+ WITH_ZLIB=1
if test "x${Z_DIR}" != "x"; then
Z_CFLAGS="-I${Z_DIR}/include"
Z_LIBS="-L${Z_DIR}/lib -lz"
@@ -346,6 +348,7 @@ fi
AC_SUBST(Z_CFLAGS)
AC_SUBST(Z_LIBS)
+AC_SUBST(WITH_ZLIB)
CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}
Index: parser.c
===================================================================
RCS file: /cvs/gnome/libxml2/parser.c,v
retrieving revision 1.452
diff -u -p -r1.452 parser.c
--- parser.c 18 Jun 2006 19:55:20 -0000 1.452
+++ parser.c 11 Jul 2006 10:37:18 -0000
@@ -807,6 +807,12 @@ xmlHasFeature(xmlFeature feature)
#else
return(0);
#endif
+ case XML_WITH_ZLIB:
+#ifdef LIBXML_ZLIB_ENABLED
+ return(1);
+#else
+ return(0);
+#endif
default:
break;
}
Index: xmllint.c
===================================================================
RCS file: /cvs/gnome/libxml2/xmllint.c,v
retrieving revision 1.162
diff -u -p -r1.162 xmllint.c
--- xmllint.c 25 Apr 2006 16:17:53 -0000 1.162
+++ xmllint.c 11 Jul 2006 10:37:21 -0000
@@ -2752,6 +2752,7 @@ static void showVersion(const char *name
if (xmlHasFeature(XML_WITH_DEBUG)) fprintf(stderr, "Debug ");
if (xmlHasFeature(XML_WITH_DEBUG_MEM)) fprintf(stderr, "MemDebug ");
if (xmlHasFeature(XML_WITH_DEBUG_RUN)) fprintf(stderr, "RunDebug ");
+ if (xmlHasFeature(XML_WITH_ZLIB)) fprintf(stderr, "Zlib ");
fprintf(stderr, "\n");
}
Index: include/libxml/parser.h
===================================================================
RCS file: /cvs/gnome/libxml2/include/libxml/parser.h,v
retrieving revision 1.123
diff -u -p -r1.123 parser.h
--- include/libxml/parser.h 9 Jun 2006 19:46:46 -0000 1.123
+++ include/libxml/parser.h 11 Jul 2006 10:37:22 -0000
@@ -1206,6 +1206,7 @@ typedef enum {
XML_WITH_DEBUG = 28,
XML_WITH_DEBUG_MEM = 29,
XML_WITH_DEBUG_RUN = 30,
+ XML_WITH_ZLIB = 31,
XML_WITH_NONE = 99999 /* just to be sure of allocation size */
} xmlFeature;
Index: include/libxml/xmlversion.h.in
===================================================================
RCS file: /cvs/gnome/libxml2/include/libxml/xmlversion.h.in,v
retrieving revision 1.58
diff -u -p -r1.58 xmlversion.h.in
--- include/libxml/xmlversion.h.in 14 Dec 2005 17:14:35 -0000 1.58
+++ include/libxml/xmlversion.h.in 11 Jul 2006 10:37:23 -0000
@@ -373,6 +373,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(i
#endif
/**
+ * LIBXML_ZLIB_ENABLED:
+ *
+ * Whether the Zlib support is compiled in
+ */
+#if @WITH_ZLIB@
+#define LIBXML_ZLIB_ENABLED
+#endif
+
+/**
* ATTRIBUTE_UNUSED:
*
* Macro used to signal to GCC unused function parameters
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]