}\r
cso_struct;\r
\r
-static int uncompress2(void *dest, int destLen, void *source, int sourceLen)\r
+static int uncompress_buf(void *dest, int destLen, void *source, int sourceLen)\r
{\r
z_stream stream;\r
int err;\r
return NULL;\r
\r
ext = get_ext(path);\r
+#ifndef NO_ZLIB\r
if (strcasecmp(ext, "zip") == 0)\r
{\r
struct zipent *zipentry;\r
return NULL;\r
}\r
}\r
- else if (strcasecmp(ext, "cso") == 0)\r
+ else\r
+#endif\r
+ if (strcasecmp(ext, "cso") == 0)\r
{\r
cso_struct *cso = NULL, *tmp = NULL;\r
int size;\r
{\r
ret = fread(ptr, 1, bytes, stream->file);\r
}\r
+#ifndef NO_ZLIB\r
else if (stream->type == PMT_ZIP)\r
{\r
gzFile gf = stream->param;\r
/* we must reset stream pointer or else next seek/read fails */\r
gzrewind(gf);\r
}\r
+#endif\r
else if (stream->type == PMT_CSO)\r
{\r
cso_struct *cso = stream->param;\r
}\r
cso->block_in_buff = block;\r
}\r
- rret = uncompress2(tmp_dst, 2048, cso->in_buff, read_len);\r
+ rret = uncompress_buf(tmp_dst, 2048, cso->in_buff, read_len);\r
if (rret != 0) {\r
elprintf(EL_STATUS, "cso: uncompress failed @ %08x with %i", read_pos, rret);\r
break;\r
fseek(stream->file, offset, whence);\r
return ftell(stream->file);\r
}\r
+#ifndef NO_ZLIB\r
else if (stream->type == PMT_ZIP)\r
{\r
if (PicoMessage != NULL && offset > 6*1024*1024) {\r
}\r
return gzseek((gzFile) stream->param, offset, whence);\r
}\r
+#endif\r
else if (stream->type == PMT_CSO)\r
{\r
cso_struct *cso = stream->param;\r
{\r
fclose(fp->file);\r
}\r
+#ifndef NO_ZLIB\r
else if (fp->type == PMT_ZIP)\r
{\r
ZIP *zipfile = fp->file;\r
zipfile->fp = NULL; // gzclose() closed it\r
closezip(zipfile);\r
}\r
+#endif\r
else if (fp->type == PMT_CSO)\r
{\r
free(fp->param);\r