summaryrefslogtreecommitdiff
path: root/xzlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'xzlib.c')
-rw-r--r--xzlib.c51
1 files changed, 4 insertions, 47 deletions
diff --git a/xzlib.c b/xzlib.c
index 0dcb9f4..928bd17 100644
--- a/xzlib.c
+++ b/xzlib.c
@@ -182,37 +182,12 @@ xz_open(const char *path, int fd, const char *mode ATTRIBUTE_UNUSED)
return (xzFile) state;
}
-static int
-xz_compressed(xzFile f) {
- xz_statep state;
-
- if (f == NULL)
- return(-1);
- state = (xz_statep) f;
- if (state->init <= 0)
- return(-1);
-
- switch (state->how) {
- case COPY:
- return(0);
- case GZIP:
- case LZMA:
- return(1);
- }
- return(-1);
-}
-
xzFile
__libxml2_xzopen(const char *path, const char *mode)
{
return xz_open(path, -1, mode);
}
-int
-__libxml2_xzcompressed(xzFile f) {
- return xz_compressed(f);
-}
-
xzFile
__libxml2_xzdopen(int fd, const char *mode)
{
@@ -270,20 +245,6 @@ xz_avail(xz_statep state)
return 0;
}
-#ifdef HAVE_ZLIB_H
-static int
-xz_avail_zstrm(xz_statep state)
-{
- int ret;
- state->strm.avail_in = state->zstrm.avail_in;
- state->strm.next_in = state->zstrm.next_in;
- ret = xz_avail(state);
- state->zstrm.avail_in = (uInt) state->strm.avail_in;
- state->zstrm.next_in = (Bytef *) state->strm.next_in;
- return ret;
-}
-#endif
-
static int
is_format_xz(xz_statep state)
{
@@ -353,10 +314,6 @@ is_format_lzma(xz_statep state)
#define NEXT() ((strm->avail_in == 0 && xz_avail(state) == -1) ? -1 : \
(strm->avail_in == 0 ? -1 : \
(strm->avail_in--, *(strm->next_in)++)))
-/* Same thing, but from zstrm */
-#define NEXTZ() ((strm->avail_in == 0 && xz_avail_zstrm(state) == -1) ? -1 : \
- (strm->avail_in == 0 ? -1 : \
- (strm->avail_in--, *(strm->next_in)++)))
/* Get a four-byte little-endian integer and return 0 on success and the value
in *ret. Otherwise -1 is returned and *ret is not modified. */
@@ -367,10 +324,10 @@ gz_next4(xz_statep state, unsigned long *ret)
unsigned long val;
z_streamp strm = &(state->zstrm);
- val = NEXTZ();
- val += (unsigned) NEXTZ() << 8;
- val += (unsigned long) NEXTZ() << 16;
- ch = NEXTZ();
+ val = NEXT();
+ val += (unsigned) NEXT() << 8;
+ val += (unsigned long) NEXT() << 16;
+ ch = NEXT();
if (ch == -1)
return -1;
val += (unsigned long) ch << 24;