#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#if ENABLE_ZLIB
#include <zlib.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
* Compression/Decompression
* *************************************************************************/
+#if ENABLE_ZLIB
static uint8_t *_fb_inflate ( const uint8_t *data, size_t size, size_t orig )
{
int err;
return bufout;
}
+#endif
/* **************************************************************************
* Miscellanous
/* Inflate the file */
if (fb->f.orig != -1 && decompress) {
+#if ENABLE_BUNDLE
ret->gzip = 0;
ret->size = fb->f.orig;
ret->buf = _fb_inflate(fb->f.data, fb->f.size, fb->f.orig);
free(ret);
ret = NULL;
}
+#else
+ free(ret);
+ ret = NULL;
+#endif
}
}
/* Compress */
if (ret && !ret->gzip && compress) {
+#if ENABLE_ZLIB
ret->gzip = 1;
/* Get data */
free(ret);
ret = NULL;
}
+#else
+ free(ret);
+ ret = NULL;
+#endif
}
return ret;