96 #ifndef CASESENSITIVITYDEFAULT_NO 97 # if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) 98 # define CASESENSITIVITYDEFAULT_NO 104 #define UNZ_BUFSIZE (16384) 107 #ifndef UNZ_MAXFILENAMEINZIP 108 #define UNZ_MAXFILENAMEINZIP (256) 112 # define ALLOC(size) (malloc(size)) 115 # define TRYFREE(p) {if (p) free(p);} 118 #define SIZECENTRALDIRITEM (0x2e) 119 #define SIZEZIPLOCALHEADER (0x1e) 123 " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
126 typedef struct unz_file_info64_internal_s
144 uLong stream_initialised;
147 uInt size_local_extrafield;
160 } file_in_zip64_read_info_s;
168 int is64bitOpenFunction;
183 file_in_zip64_read_info_s* pfile_in_zip_read;
190 unsigned long keys[3];
215 int err = (
int)
ZREAD64(*pzlib_filefunc_def,filestream,&c,1);
223 if (
ZERROR64(*pzlib_filefunc_def,filestream))
353 char c1=*(fileName1++);
354 char c2=*(fileName2++);
355 if ((c1>=
'a') && (c1<=
'z'))
357 if ((c2>=
'a') && (c2<=
'z'))
360 return ((c2==
'\0') ? 0 : -1);
371 #ifdef CASESENSITIVITYDEFAULT_NO 372 #define CASESENSITIVITYDEFAULTVALUE 2 374 #define CASESENSITIVITYDEFAULTVALUE 1 377 #ifndef STRCMPCASENOSENTIVEFUNCTION 378 #define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal 391 const char* fileName2,
392 int iCaseSensitivity)
395 if (iCaseSensitivity==0)
398 if (iCaseSensitivity==1)
399 return strcmp(fileName1,fileName2);
404 #ifndef BUFREADCOMMENT 405 #define BUFREADCOMMENT (0x400) 425 uSizeFile =
ZTELL64(*pzlib_filefunc_def,filestream);
427 if (uMaxBack>uSizeFile)
428 uMaxBack = uSizeFile;
435 while (uBackRead<uMaxBack)
441 uBackRead = uMaxBack;
444 uReadPos = uSizeFile-uBackRead ;
451 if (
ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
454 for (i=(
int)uReadSize-3; (i--)>0;)
455 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
456 ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
458 uPosFound = uReadPos+
i;
493 uSizeFile =
ZTELL64(*pzlib_filefunc_def,filestream);
495 if (uMaxBack>uSizeFile)
496 uMaxBack = uSizeFile;
503 while (uBackRead<uMaxBack)
509 uBackRead = uMaxBack;
512 uReadPos = uSizeFile-uBackRead ;
519 if (
ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
522 for (i=(
int)uReadSize-3; (i--)>0;)
523 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
524 ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
526 uPosFound = uReadPos+
i;
569 if (uL != 0x06064b50)
572 return relativeOffset;
586 int is64bitOpenFunction)
595 uLong number_disk_with_CD;
606 us.z_filefunc.zseek32_file =
NULL;
607 us.z_filefunc.ztell32_file =
NULL;
608 if (pzlib_filefunc64_32_def==
NULL)
611 us.z_filefunc = *pzlib_filefunc64_32_def;
612 us.is64bitOpenFunction = is64bitOpenFunction;
616 us.filestream =
ZOPEN64(us.z_filefunc,
620 if (us.filestream==
NULL)
631 if (
ZSEEK64(us.z_filefunc, us.filestream,
667 if ((number_entry_CD!=us.gi.number_entry) ||
668 (number_disk_with_CD!=0) ||
681 us.gi.size_comment = 0;
691 if (
ZSEEK64(us.z_filefunc, us.filestream,
710 us.gi.number_entry = uL;
715 number_entry_CD = uL;
717 if ((number_entry_CD!=us.gi.number_entry) ||
718 (number_disk_with_CD!=0) ||
725 us.size_central_dir = uL;
731 us.offset_central_dir = uL;
738 if ((central_pos<us.offset_central_dir+us.size_central_dir) &&
744 ZCLOSE64(us.z_filefunc, us.filestream);
748 us.byte_before_the_zipfile = central_pos -
749 (us.offset_central_dir+us.size_central_dir);
750 us.central_pos = central_pos;
751 us.pfile_in_zip_read =
NULL;
755 s=(unz64_s*)
ALLOC(
sizeof(unz64_s));
768 if (pzlib_filefunc32_def !=
NULL)
781 if (pzlib_filefunc_def !=
NULL)
784 zlib_filefunc64_32_def_fill.
zfile_func64 = *pzlib_filefunc_def;
815 if (s->pfile_in_zip_read!=
NULL)
818 ZCLOSE64(s->z_filefunc, s->filestream);
857 ptm->
tm_mon = (
uInt)((((uDate)&0x1E0)/0x20)-1) ;
858 ptm->
tm_year = (
uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
861 ptm->
tm_min = (
uInt) ((ulDosDate&0x7E0)/0x20) ;
871 *pfile_info_internal,
873 uLong fileNameBufferSize,
875 uLong extraFieldBufferSize,
877 uLong commentBufferSize));
882 *pfile_info_internal,
884 uLong fileNameBufferSize,
886 uLong extraFieldBufferSize,
888 uLong commentBufferSize)
901 if (
ZSEEK64(s->z_filefunc, s->filestream,
902 s->pos_in_central_dir+s->byte_before_the_zipfile,
912 else if (uMagic!=0x02014b50)
965 file_info_internal.offset_curfile = uL;
977 uSizeRead = fileNameBufferSize;
980 if (
ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead)
992 uSizeRead = extraFieldBufferSize;
1003 if (
ZREAD64(s->z_filefunc, s->filestream,extraField,(
uLong)uSizeRead)!=uSizeRead)
1039 if (headerId == 0x0001)
1055 if(file_info_internal.offset_curfile ==
MAXU32)
1089 uSizeRead = commentBufferSize;
1100 if (
ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
1109 *pfile_info=file_info;
1111 if ((err==
UNZ_OK) && (pfile_info_internal!=
NULL))
1112 *pfile_info_internal=file_info_internal;
1126 char * szFileName,
uLong fileNameBufferSize,
1127 void *extraField,
uLong extraFieldBufferSize,
1128 char* szComment,
uLong commentBufferSize)
1131 szFileName,fileNameBufferSize,
1132 extraField,extraFieldBufferSize,
1133 szComment,commentBufferSize);
1138 char * szFileName,
uLong fileNameBufferSize,
1139 void *extraField,
uLong extraFieldBufferSize,
1140 char* szComment,
uLong commentBufferSize)
1145 szFileName,fileNameBufferSize,
1146 extraField,extraFieldBufferSize,
1147 szComment,commentBufferSize);
1152 pfile_info->
flag = file_info64.
flag;
1155 pfile_info->
crc = file_info64.
crc;
1185 s->pos_in_central_dir=s->offset_central_dir;
1188 &s->cur_file_info_internal,
1190 s->current_file_ok = (err ==
UNZ_OK);
1207 if (!s->current_file_ok)
1209 if (s->gi.number_entry != 0xffff)
1210 if (s->num_file+1==s->gi.number_entry)
1214 s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
1217 &s->cur_file_info_internal,
1219 s->current_file_ok = (err ==
UNZ_OK);
1253 if (!s->current_file_ok)
1257 num_fileSaved = s->num_file;
1258 pos_in_central_dirSaved = s->pos_in_central_dir;
1259 cur_file_infoSaved = s->cur_file_info;
1260 cur_file_info_internalSaved = s->cur_file_info_internal;
1268 szCurrentFileName,
sizeof(szCurrentFileName)-1,
1273 szFileName,iCaseSensitivity)==0)
1282 s->num_file = num_fileSaved ;
1283 s->pos_in_central_dir = pos_in_central_dirSaved ;
1284 s->cur_file_info = cur_file_infoSaved;
1285 s->cur_file_info_internal = cur_file_info_internalSaved;
1315 if (!s->current_file_ok)
1353 &s->cur_file_info_internal,
1356 s->current_file_ok = (err ==
UNZ_OK);
1365 if (file_pos ==
NULL)
1386 ZPOS64_T * poffset_local_extrafield,
1387 uInt * psize_local_extrafield)
1389 uLong uMagic,uData,uFlags;
1390 uLong size_filename;
1391 uLong size_extra_field;
1395 *poffset_local_extrafield = 0;
1396 *psize_local_extrafield = 0;
1398 if (
ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile +
1407 else if (uMagic!=0x04034b50)
1422 else if ((err==
UNZ_OK) && (uData!=s->cur_file_info.compression_method))
1425 if ((err==
UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
1427 (s->cur_file_info.compression_method!=
Z_BZIP2ED) &&
1429 (s->cur_file_info.compression_method!=
Z_DEFLATED))
1437 else if ((err==
UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0))
1442 else if (uData != 0xFFFFFFFF && (err==
UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0))
1447 else if (uData != 0xFFFFFFFF && (err==
UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0))
1452 else if ((err==
UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))
1455 *piSizeVar += (
uInt)size_filename;
1459 *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +
1461 *psize_local_extrafield = (
uInt)size_extra_field;
1463 *piSizeVar += (
uInt)size_extra_field;
1478 file_in_zip64_read_info_s* pfile_in_zip_read_info;
1480 uInt size_local_extrafield;
1484 if (password !=
NULL)
1491 if (!s->current_file_ok)
1494 if (s->pfile_in_zip_read !=
NULL)
1500 pfile_in_zip_read_info = (file_in_zip64_read_info_s*)
ALLOC(
sizeof(file_in_zip64_read_info_s));
1501 if (pfile_in_zip_read_info==
NULL)
1505 pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
1506 pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
1507 pfile_in_zip_read_info->pos_local_extrafield=0;
1508 pfile_in_zip_read_info->raw=raw;
1510 if (pfile_in_zip_read_info->read_buffer==
NULL)
1512 TRYFREE(pfile_in_zip_read_info);
1516 pfile_in_zip_read_info->stream_initialised=0;
1519 *method = (
int)s->cur_file_info.compression_method;
1524 switch (s->cur_file_info.flag & 0x06)
1526 case 6 : *level = 1;
break;
1527 case 4 : *level = 2;
break;
1528 case 2 : *level = 9;
break;
1532 if ((s->cur_file_info.compression_method!=0) &&
1534 (s->cur_file_info.compression_method!=
Z_BZIP2ED) &&
1536 (s->cur_file_info.compression_method!=
Z_DEFLATED))
1540 pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;
1541 pfile_in_zip_read_info->crc32=0;
1542 pfile_in_zip_read_info->total_out_64=0;
1543 pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method;
1544 pfile_in_zip_read_info->filestream=s->filestream;
1545 pfile_in_zip_read_info->z_filefunc=s->z_filefunc;
1546 pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;
1548 pfile_in_zip_read_info->stream.total_out = 0;
1550 if ((s->cur_file_info.compression_method==
Z_BZIP2ED) && (!raw))
1553 pfile_in_zip_read_info->bstream.bzalloc = (
void *(*) (
void *,
int,
int))0;
1554 pfile_in_zip_read_info->bstream.bzfree = (free_func)0;
1555 pfile_in_zip_read_info->bstream.opaque = (
voidpf)0;
1556 pfile_in_zip_read_info->bstream.state = (
voidpf)0;
1558 pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
1559 pfile_in_zip_read_info->stream.zfree = (free_func)0;
1560 pfile_in_zip_read_info->stream.opaque = (
voidpf)0;
1561 pfile_in_zip_read_info->stream.next_in = (
voidpf)0;
1562 pfile_in_zip_read_info->stream.avail_in = 0;
1564 err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0);
1566 pfile_in_zip_read_info->stream_initialised=
Z_BZIP2ED;
1569 TRYFREE(pfile_in_zip_read_info);
1573 pfile_in_zip_read_info->raw=1;
1576 else if ((s->cur_file_info.compression_method==
Z_DEFLATED) && (!raw))
1578 pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
1579 pfile_in_zip_read_info->stream.zfree = (free_func)0;
1580 pfile_in_zip_read_info->stream.opaque = (
voidpf)0;
1581 pfile_in_zip_read_info->stream.next_in = 0;
1582 pfile_in_zip_read_info->stream.avail_in = 0;
1586 pfile_in_zip_read_info->stream_initialised=
Z_DEFLATED;
1589 TRYFREE(pfile_in_zip_read_info);
1600 pfile_in_zip_read_info->rest_read_compressed =
1601 s->cur_file_info.compressed_size ;
1602 pfile_in_zip_read_info->rest_read_uncompressed =
1603 s->cur_file_info.uncompressed_size ;
1606 pfile_in_zip_read_info->pos_in_zipfile =
1610 pfile_in_zip_read_info->stream.avail_in = (
uInt)0;
1612 s->pfile_in_zip_read = pfile_in_zip_read_info;
1616 if (password !=
NULL)
1620 init_keys(password,s->keys,s->pcrc_32_tab);
1621 if (
ZSEEK64(s->z_filefunc, s->filestream,
1622 s->pfile_in_zip_read->pos_in_zipfile +
1623 s->pfile_in_zip_read->byte_before_the_zipfile,
1626 if(
ZREAD64(s->z_filefunc, s->filestream,source, 12)<12)
1629 for (i = 0; i<12; i++)
1630 zdecode(s->keys,s->pcrc_32_tab,source[i]);
1632 s->pfile_in_zip_read->pos_in_zipfile+=12;
1661 file_in_zip64_read_info_s* pfile_in_zip_read_info;
1665 pfile_in_zip_read_info=s->pfile_in_zip_read;
1666 if (pfile_in_zip_read_info==
NULL)
1668 return pfile_in_zip_read_info->pos_in_zipfile +
1669 pfile_in_zip_read_info->byte_before_the_zipfile;
1689 file_in_zip64_read_info_s* pfile_in_zip_read_info;
1693 pfile_in_zip_read_info=s->pfile_in_zip_read;
1695 if (pfile_in_zip_read_info==
NULL)
1699 if (pfile_in_zip_read_info->read_buffer ==
NULL)
1704 pfile_in_zip_read_info->stream.next_out = (
Bytef*)buf;
1706 pfile_in_zip_read_info->stream.avail_out = (
uInt)len;
1708 if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&
1709 (!(pfile_in_zip_read_info->raw)))
1710 pfile_in_zip_read_info->stream.avail_out =
1711 (
uInt)pfile_in_zip_read_info->rest_read_uncompressed;
1713 if ((len>pfile_in_zip_read_info->rest_read_compressed+
1714 pfile_in_zip_read_info->stream.avail_in) &&
1715 (pfile_in_zip_read_info->raw))
1716 pfile_in_zip_read_info->stream.avail_out =
1717 (
uInt)pfile_in_zip_read_info->rest_read_compressed+
1718 pfile_in_zip_read_info->stream.avail_in;
1720 while (pfile_in_zip_read_info->stream.avail_out>0)
1722 if ((pfile_in_zip_read_info->stream.avail_in==0) &&
1723 (pfile_in_zip_read_info->rest_read_compressed>0))
1726 if (pfile_in_zip_read_info->rest_read_compressed<uReadThis)
1727 uReadThis = (
uInt)pfile_in_zip_read_info->rest_read_compressed;
1730 if (
ZSEEK64(pfile_in_zip_read_info->z_filefunc,
1731 pfile_in_zip_read_info->filestream,
1732 pfile_in_zip_read_info->pos_in_zipfile +
1733 pfile_in_zip_read_info->byte_before_the_zipfile,
1736 if (
ZREAD64(pfile_in_zip_read_info->z_filefunc,
1737 pfile_in_zip_read_info->filestream,
1738 pfile_in_zip_read_info->read_buffer,
1739 uReadThis)!=uReadThis)
1747 for(i=0;i<uReadThis;i++)
1748 pfile_in_zip_read_info->read_buffer[i] =
1749 zdecode(s->keys,s->pcrc_32_tab,
1750 pfile_in_zip_read_info->read_buffer[i]);
1755 pfile_in_zip_read_info->pos_in_zipfile += uReadThis;
1757 pfile_in_zip_read_info->rest_read_compressed-=uReadThis;
1759 pfile_in_zip_read_info->stream.next_in =
1760 (
Bytef*)pfile_in_zip_read_info->read_buffer;
1761 pfile_in_zip_read_info->stream.avail_in = (
uInt)uReadThis;
1764 if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw))
1768 if ((pfile_in_zip_read_info->stream.avail_in == 0) &&
1769 (pfile_in_zip_read_info->rest_read_compressed == 0))
1770 return (iRead==0) ?
UNZ_EOF : iRead;
1772 if (pfile_in_zip_read_info->stream.avail_out <
1773 pfile_in_zip_read_info->stream.avail_in)
1774 uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
1776 uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
1778 for (i=0;i<uDoCopy;i++)
1779 *(pfile_in_zip_read_info->stream.next_out+i) =
1780 *(pfile_in_zip_read_info->stream.next_in+
i);
1782 pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy;
1784 pfile_in_zip_read_info->crc32 =
crc32(pfile_in_zip_read_info->crc32,
1785 pfile_in_zip_read_info->stream.next_out,
1787 pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;
1788 pfile_in_zip_read_info->stream.avail_in -= uDoCopy;
1789 pfile_in_zip_read_info->stream.avail_out -= uDoCopy;
1790 pfile_in_zip_read_info->stream.next_out += uDoCopy;
1791 pfile_in_zip_read_info->stream.next_in += uDoCopy;
1792 pfile_in_zip_read_info->stream.total_out += uDoCopy;
1795 else if (pfile_in_zip_read_info->compression_method==
Z_BZIP2ED)
1798 uLong uTotalOutBefore,uTotalOutAfter;
1799 const Bytef *bufBefore;
1802 pfile_in_zip_read_info->bstream.next_in = (
char*)pfile_in_zip_read_info->stream.next_in;
1803 pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in;
1804 pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in;
1805 pfile_in_zip_read_info->bstream.total_in_hi32 = 0;
1806 pfile_in_zip_read_info->bstream.next_out = (
char*)pfile_in_zip_read_info->stream.next_out;
1807 pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out;
1808 pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out;
1809 pfile_in_zip_read_info->bstream.total_out_hi32 = 0;
1811 uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32;
1812 bufBefore = (
const Bytef *)pfile_in_zip_read_info->bstream.next_out;
1814 err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream);
1816 uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32;
1817 uOutThis = uTotalOutAfter-uTotalOutBefore;
1819 pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;
1821 pfile_in_zip_read_info->crc32 =
crc32(pfile_in_zip_read_info->crc32,bufBefore, (
uInt)(uOutThis));
1822 pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis;
1823 iRead += (
uInt)(uTotalOutAfter - uTotalOutBefore);
1825 pfile_in_zip_read_info->stream.next_in = (
Bytef*)pfile_in_zip_read_info->bstream.next_in;
1826 pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in;
1827 pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32;
1828 pfile_in_zip_read_info->stream.next_out = (
Bytef*)pfile_in_zip_read_info->bstream.next_out;
1829 pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out;
1830 pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32;
1832 if (err==BZ_STREAM_END)
1833 return (iRead==0) ?
UNZ_EOF : iRead;
1840 ZPOS64_T uTotalOutBefore,uTotalOutAfter;
1841 const Bytef *bufBefore;
1845 uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;
1846 bufBefore = pfile_in_zip_read_info->stream.next_out;
1854 err=
inflate(&pfile_in_zip_read_info->stream,flush);
1856 if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=
NULL))
1859 uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
1860 uOutThis = uTotalOutAfter-uTotalOutBefore;
1862 pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;
1864 pfile_in_zip_read_info->crc32 =
1865 crc32(pfile_in_zip_read_info->crc32,bufBefore,
1868 pfile_in_zip_read_info->rest_read_uncompressed -=
1871 iRead += (
uInt)(uTotalOutAfter - uTotalOutBefore);
1874 return (iRead==0) ?
UNZ_EOF : iRead;
1892 file_in_zip64_read_info_s* pfile_in_zip_read_info;
1896 pfile_in_zip_read_info=s->pfile_in_zip_read;
1898 if (pfile_in_zip_read_info==
NULL)
1901 return (
z_off_t)pfile_in_zip_read_info->stream.total_out;
1908 file_in_zip64_read_info_s* pfile_in_zip_read_info;
1912 pfile_in_zip_read_info=s->pfile_in_zip_read;
1914 if (pfile_in_zip_read_info==
NULL)
1917 return pfile_in_zip_read_info->total_out_64;
1927 file_in_zip64_read_info_s* pfile_in_zip_read_info;
1931 pfile_in_zip_read_info=s->pfile_in_zip_read;
1933 if (pfile_in_zip_read_info==
NULL)
1936 if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
1959 file_in_zip64_read_info_s* pfile_in_zip_read_info;
1966 pfile_in_zip_read_info=s->pfile_in_zip_read;
1968 if (pfile_in_zip_read_info==
NULL)
1971 size_to_read = (pfile_in_zip_read_info->size_local_extrafield -
1972 pfile_in_zip_read_info->pos_local_extrafield);
1975 return (
int)size_to_read;
1977 if (len>size_to_read)
1978 read_now = (
uInt)size_to_read;
1980 read_now = (
uInt)len ;
1985 if (
ZSEEK64(pfile_in_zip_read_info->z_filefunc,
1986 pfile_in_zip_read_info->filestream,
1987 pfile_in_zip_read_info->offset_local_extrafield +
1988 pfile_in_zip_read_info->pos_local_extrafield,
1992 if (
ZREAD64(pfile_in_zip_read_info->z_filefunc,
1993 pfile_in_zip_read_info->filestream,
1994 buf,read_now)!=read_now)
1997 return (
int)read_now;
2009 file_in_zip64_read_info_s* pfile_in_zip_read_info;
2013 pfile_in_zip_read_info=s->pfile_in_zip_read;
2015 if (pfile_in_zip_read_info==
NULL)
2019 if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) &&
2020 (!pfile_in_zip_read_info->raw))
2022 if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
2027 TRYFREE(pfile_in_zip_read_info->read_buffer);
2028 pfile_in_zip_read_info->read_buffer =
NULL;
2029 if (pfile_in_zip_read_info->stream_initialised ==
Z_DEFLATED)
2032 else if (pfile_in_zip_read_info->stream_initialised ==
Z_BZIP2ED)
2033 BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream);
2037 pfile_in_zip_read_info->stream_initialised = 0;
2038 TRYFREE(pfile_in_zip_read_info);
2040 s->pfile_in_zip_read=
NULL;
2059 uReadThis = uSizeBuf;
2060 if (uReadThis>s->gi.size_comment)
2061 uReadThis = s->gi.size_comment;
2069 if (
ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis)
2073 if ((szComment !=
NULL) && (uSizeBuf > s->gi.size_comment))
2074 *(szComment+s->gi.size_comment)=
'\0';
2075 return (
int)uReadThis;
2086 if (!s->current_file_ok)
2088 if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff)
2089 if (s->num_file==s->gi.number_entry)
2091 return s->pos_in_central_dir;
2101 return (
uLong)offset64;
2113 s->pos_in_central_dir = pos;
2114 s->num_file = s->gi.number_entry;
2116 &s->cur_file_info_internal,
2118 s->current_file_ok = (err ==
UNZ_OK);
int ZEXPORT unzLocateFile(unzFile file, const char *szFileName, int iCaseSensitivity)
int ZEXPORT unzGetLocalExtrafield(unzFile file, voidp buf, unsigned len)
local int strcmpcasenosensitive_internal(const char *fileName1, const char *fileName2)
int ZEXPORT unzGoToFirstFile(unzFile file)
int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos *file_pos)
GLsizei GLsizei GLchar * source
int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos *file_pos)
uLong pos_in_zip_directory
int ZEXPORT unzGoToNextFile(unzFile file)
const z_crc_t FAR *ZEXPORT get_crc_table()
#define UNZ_INTERNALERROR
#define ZERROR64(filefunc, filestream)
unzFile ZEXPORT unzOpen64(const void *path)
GLint GLint GLint GLint GLint x
#define ZLIB_FILEFUNC_MODE_READ
#define STRCMPCASENOSENTIVEFUNCTION
int ZEXPORT unzOpenCurrentFile3(unzFile file, int *method, int *level, int raw, const char *password)
int ZEXPORT unzClose(unzFile file)
local void unz64local_DosDateToTmuDate(ZPOS64_T ulDosDate, tm_unz *ptm)
#define inflateInit2(strm, windowBits)
local int unz64local_CheckCurrentFileCoherencyHeader(unz64_s *s, uInt *piSizeVar, ZPOS64_T *poffset_local_extrafield, uInt *psize_local_extrafield)
int ZEXPORT unzeof(unzFile file)
GLenum GLuint GLenum GLsizei const GLchar * buf
int ZEXPORT unzOpenCurrentFile(unzFile file)
int ZEXPORT unzSetOffset(unzFile file, uLong pos)
int ZEXPORT unzGetGlobalInfo64(unzFile file, unz_global_info64 *pglobal_info)
int ZEXPORT unzGetCurrentFileInfo(unzFile file, unz_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)
unzFile ZEXPORT unzOpen2(const char *path, zlib_filefunc_def *pzlib_filefunc32_def)
seek_file_func zseek32_file
#define ZLIB_FILEFUNC_SEEK_CUR
int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, unsigned len)
Addition for GDAL : END.
local int unz64local_getByte OF((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi))
GLsizei const GLchar ** path
unzFile ZEXPORT unzOpen(const char *path)
#define ZCLOSE64(filefunc, filestream)
ZPOS64_T pos_in_zip_directory
int ZEXPORT unzOpenCurrentFile2(unzFile file, int *method, int *level, int raw)
#define ZREAD64(filefunc, filestream, buf, size)
#define ZOPEN64(filefunc, filename, mode)
local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
int ZEXPORT unzCloseCurrentFile(unzFile file)
local int unz64local_getShort(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
int ZEXPORT inflate(z_streamp strm, int flush)
const char unz_copyright[]
unzFile ZEXPORT unzOpen2_64(const void *path, zlib_filefunc64_def *pzlib_filefunc_def)
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
zlib_filefunc64_def zfile_func64
unsigned long long int ZPOS64_T
int ZEXPORT unzOpenCurrentFilePassword(unzFile file, const char *password)
void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def)
#define ZLIB_FILEFUNC_MODE_EXISTING
#define ZTELL64(filefunc, filestream)
int ZEXPORT unzGetGlobalComment(unzFile file, char *szComment, uLong uSizeBuf)
T1_FIELD_DICT_PRIVATE password
int ZEXPORT unzGetFilePos(unzFile file, unz_file_pos *file_pos)
local int unz64local_GetCurrentFileInfoInternal(unzFile file, unz_file_info64 *pfile_info, unz_file_info64_internal *pfile_info_internal, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)
local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
int ZEXPORT unzGetCurrentFileInfo64(unzFile file, unz_file_info64 *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)
tell_file_func ztell32_file
if(!abbox) return FT_THROW(Invalid_Argument)
local int unz64local_getByte(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi)
ZPOS64_T ZEXPORT unztell64(unzFile file)
z_off_t ZEXPORT unztell(unzFile file)
int ZEXPORT unzStringFileNameCompare(const char *fileName1, const char *fileName2, int iCaseSensitivity)
#define zdecode(pkeys, pcrc_32_tab, c)
local unzFile unzOpenInternal(const void *path, zlib_filefunc64_32_def *pzlib_filefunc64_32_def, int is64bitOpenFunction)
#define CASESENSITIVITYDEFAULTVALUE
ZPOS64_T ZEXPORT unzGetOffset64(unzFile file)
#define UNZ_MAXFILENAMEINZIP
local int unz64local_getLong64(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)
int ZEXPORT unzGetGlobalInfo(unzFile file, unz_global_info *pglobal_info32)
uLong ZEXPORT unzGetOffset(unzFile file)
#define ZSEEK64(filefunc, filestream, pos, mode)
ZPOS64_T uncompressed_size
#define SIZECENTRALDIRITEM
#define ZLIB_FILEFUNC_SEEK_END
struct unz_file_info64_internal_s unz_file_info64_internal
int ZEXPORT unzGoToFilePos(unzFile file, unz_file_pos *file_pos)
local int unz64local_getLong(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos)
#define ZLIB_FILEFUNC_SEEK_SET
#define UNZ_END_OF_LIST_OF_FILE
int ZEXPORT inflateEnd(z_streamp strm)
#define SIZEZIPLOCALHEADER
png_infop png_uint_32 png_uint_32 int int int int * compression_method
void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def *p_filefunc64_32, const zlib_filefunc_def *p_filefunc32)
ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64(unzFile file)
Addition for GDAL : START.