[gcab] Revert back to zlib decompression



commit b2074edd1351fec7f95cbc4af9154ffa7c3f7fcf
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Wed Jan 23 02:20:52 2013 +0100

    Revert back to zlib decompression

 docs/reference/Makefile.am |    1 +
 libgcab/cabinet.c          |   22 +---------------------
 libgcab/cabinet.h          |    5 -----
 3 files changed, 2 insertions(+), 26 deletions(-)
---
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 548e7f0..55eada1 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -18,6 +18,7 @@ CFILE_GLOB = $(top_srcdir)/libgcab/*.c
 EXTRA_HFILES =
 IGNORE_HFILES =					\
 	cabinet.h				\
+	decomp.h				\
 	gcab-priv.h				\
 	glib-compat.h				\
 	$(NULL)
diff --git a/libgcab/cabinet.c b/libgcab/cabinet.c
index 57efa08..64669b8 100644
--- a/libgcab/cabinet.c
+++ b/libgcab/cabinet.c
@@ -405,7 +405,6 @@ cdata_write (cdata_t *cd, GDataOutputStream *out, int type,
 G_GNUC_INTERNAL void
 cdata_finish (cdata_t *cd, GError **error)
 {
-#ifdef TRY_BUGGY_ZLIB_MSIZP
     z_stream *z = &cd->z;
     int zret;
 
@@ -418,7 +417,6 @@ cdata_finish (cdata_t *cd, GError **error)
     if (zret != Z_OK)
         g_set_error (error, GCAB_ERROR, GCAB_ERROR_FAILED,
                      "zlib failed: %s", zError (zret));
-#endif
 }
 
 G_GNUC_INTERNAL gboolean
@@ -454,7 +452,6 @@ cdata_read (cdata_t *cd, u1 res_data, GCabCompression compression,
         if (cd->in[0] != 'C' || cd->in[1] != 'K')
             goto end;
 
-#ifdef TRY_BUGGY_ZLIB_MSIZP
         z_stream *z = &cd->z;
 
         z->avail_in = cd->ncbytes - 2;
@@ -496,29 +493,12 @@ cdata_read (cdata_t *cd, u1 res_data, GCabCompression compression,
     }
 
     success = TRUE;
+
 end:
     if (zret != Z_OK)
         g_set_error (error, GCAB_ERROR, GCAB_ERROR_FAILED,
                      "zlib failed: %s", zError (zret));
 
-#else /* !zlib */
-
-        if (cd->fdi.alloc == NULL) {
-            cd->fdi.alloc = g_malloc;
-            cd->fdi.free = g_free;
-            cd->decomp.fdi = &cd->fdi;
-            cd->decomp.inbuf = cd->in;
-            cd->decomp.outbuf = cd->out;
-        }
-
-        zret = ZIPfdi_decomp(cd->ncbytes, cd->nubytes, &cd->decomp);
-        if (zret < 0)
-            goto end;
-     }
-
-    success = TRUE;
-end:
-#endif
     if (!*error && !success)
         g_set_error (error, GCAB_ERROR, GCAB_ERROR_FAILED,
                      "Invalid cabinet chunk");
diff --git a/libgcab/cabinet.h b/libgcab/cabinet.h
index d901a8d..79c73ec 100644
--- a/libgcab/cabinet.h
+++ b/libgcab/cabinet.h
@@ -98,12 +98,7 @@ struct cdata
     guint8 *reserved;
     guint8 in[CAB_INPUTMAX+2];
     guint8 out[CAB_BLOCKMAX];
-#ifdef TRY_BUGGY_ZLIB_MSIZP
     z_stream z;
-#else
-    FDI_Int fdi;
-    fdi_decomp_state decomp;
-#endif
 };
 
 gboolean     cheader_write                      (cheader_t *ch,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]