Commit adf5ec94 authored by Daniel Veillard's avatar Daniel Veillard

Cleanups of lzma support

- fix inclusion of the separated file
- use namespaced name for the 4 non-static routines
- add padding after external structures included in-situ
- add new requirement to spec file
- general cleanup of code
parent 48a305f5
......@@ -40,7 +40,7 @@ libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \
xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
xmlmodule.c schematron.c
xmlmodule.c schematron.c xzlib.c
else
libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
......@@ -50,7 +50,7 @@ libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
xmlreader.c relaxng.c dict.c SAX2.c \
xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
xmlmodule.c schematron.c
xmlmodule.c schematron.c xzlib.c
endif
DEPS = $(top_builddir)/libxml2.la
......@@ -1195,7 +1195,7 @@ EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
example/Makefile.am example/gjobread.c example/gjobs.xml \
$(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \
trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
triop.h triodef.h libxml.h elfgcchack.h xzlib.c xzlib.h \
triop.h triodef.h libxml.h elfgcchack.h xzlib.h \
testThreadsWin32.c genUnicode.py TODO_SCHEMAS \
dbgen.pl dbgenattr.pl regressions.py regressions.xml \
README.tests Makefile.tests libxml2.syms \
......
......@@ -6,7 +6,7 @@ License: MIT
Group: Development/Libraries
Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: python python-devel zlib-devel pkgconfig
BuildRequires: python python-devel zlib-devel pkgconfig xz-devel
URL: http://xmlsoft.org/
%description
......@@ -25,6 +25,7 @@ Summary: Libraries, includes, etc. to develop XML and HTML applications
Group: Development/Libraries
Requires: libxml2 = %{version}-%{release}
Requires: zlib-devel
Requires: xz-devel
Requires: pkgconfig
%description devel
......
......@@ -1315,7 +1315,7 @@ xmlGzfileClose (void * context) {
* I/O for compressed file accesses *
* *
************************************************************************/
#include "xzlib.c"
#include "xzlib.h"
/**
* xmlXzfileMatch:
* @filename: the URI for matching
......@@ -1344,7 +1344,7 @@ xmlXzfileOpen_real (const char *filename) {
xzFile fd;
if (!strcmp(filename, "-")) {
fd = xzdopen(dup(0), "rb");
fd = __libxml2_xzdopen(dup(0), "rb");
return((void *) fd);
}
......@@ -1363,7 +1363,7 @@ xmlXzfileOpen_real (const char *filename) {
if (!xmlCheckFilename(path))
return(NULL);
fd = xzopen(path, "rb");
fd = __libxml2_xzopen(path, "rb");
return((void *) fd);
}
......@@ -1407,7 +1407,7 @@ static int
xmlXzfileRead (void * context, char * buffer, int len) {
int ret;
ret = xzread((xzFile) context, &buffer[0], len);
ret = __libxml2_xzread((xzFile) context, &buffer[0], len);
if (ret < 0) xmlIOErr(0, "xzread()");
return(ret);
}
......@@ -1422,7 +1422,7 @@ static int
xmlXzfileClose (void * context) {
int ret;
ret = (xzclose((xzFile) context) == LZMA_OK ) ? 0 : -1;
ret = (__libxml2_xzclose((xzFile) context) == LZMA_OK ) ? 0 : -1;
if (ret < 0) xmlIOErr(0, "xzclose()");
return(ret);
}
......
This diff is collapsed.
typedef void* xzFile; /* opaque lzma file descriptor */
/**
* xzlib.h: header for the front end for the transparent suport of lzma
* compression at the I/O layer
*
* See Copyright for the status of this software.
*
* Anders F Bjorklund <afb@users.sourceforge.net>
*/
static xzFile xzopen(const char *path, const char *mode);
static xzFile xzdopen(int fd, const char *mode);
static int xzread(xzFile file, void *buf, unsigned len);
static int xzclose(xzFile file);
#ifndef LIBXML2_XZLIB_H
#define LIBXML2_XZLIB_H
typedef void *xzFile; /* opaque lzma file descriptor */
xzFile __libxml2_xzopen(const char *path, const char *mode);
xzFile __libxml2_xzdopen(int fd, const char *mode);
int __libxml2_xzread(xzFile file, void *buf, unsigned len);
int __libxml2_xzclose(xzFile file);
#endif /* LIBXML2_XZLIB_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment