Lines Matching defs:zi
856 zip64_internal* zi;
887 zi = (zip64_internal*)ALLOC(sizeof(zip64_internal));
888 if (zi==NULL)
914 TRYFREE(zi);
919 *zi = ziinit;
920 return (zipFile)zi;
962 int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local)
969 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC, 4);
973 if(zi->ci.zip64)
974 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);/* version needed to extract */
976 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */
980 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2);
983 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2);
986 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4);
990 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */
993 if(zi->ci.zip64)
994 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* compressed size, unknown */
996 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */
1000 if(zi->ci.zip64)
1001 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* uncompressed size, unknown */
1003 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */
1007 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2);
1009 if(zi->ci.zip64)
1015 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield,2);
1019 if (ZWRITE64(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename)
1025 if (ZWRITE64(zi->z_filefunc, zi->filestream, extrafield_local, size_extrafield_local) != size_extrafield_local)
1030 if ((err==ZIP_OK) && (zi->ci.zip64))
1039 zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream);
1041 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2);
1042 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2);
1044 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8);
1045 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8);
1067 zip64_internal* zi;
1090 zi = (zip64_internal*)file;
1092 if (zi->in_opened_file_inzip == 1)
1110 zi->ci.dosDate = 0;
1114 zi->ci.dosDate = zipfi->dosDate;
1116 zi->ci.dosDate = zip64local_TmzDateToDosDate(&zipfi->tmz_date);
1119 zi->ci.flag = flagBase;
1121 zi->ci.flag |= 2;
1123 zi->ci.flag |= 4;
1125 zi->ci.flag |= 6;
1127 zi->ci.flag |= 1;
1129 zi->ci.crc32 = 0;
1130 zi->ci.method = method;
1131 zi->ci.encrypt = 0;
1132 zi->ci.stream_initialised = 0;
1133 zi->ci.pos_in_buffered_data = 0;
1134 zi->ci.raw = raw;
1135 zi->ci.pos_local_header = ZTELL64(zi->z_filefunc,zi->filestream);
1137 zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + size_extrafield_global + size_comment;
1138 zi->ci.size_centralExtraFree = 32; // Extra space we have reserved in case we need to add ZIP64 extra info data
1140 zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader + zi->ci.size_centralExtraFree);
1142 zi->ci.size_centralExtra = size_extrafield_global;
1143 zip64local_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4);
1145 zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)versionMadeBy,2);
1146 zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2);
1147 zip64local_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2);
1148 zip64local_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2);
1149 zip64local_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4);
1150 zip64local_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/
1151 zip64local_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/
1152 zip64local_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/
1153 zip64local_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2);
1154 zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2);
1155 zip64local_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2);
1156 zip64local_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/
1159 zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2);
1161 zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2);
1164 zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4);
1166 zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4);
1168 if(zi->ci.pos_local_header >= 0xffffffff)
1169 zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)0xffffffff,4);
1171 zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header - zi->add_position_when_writting_offset,4);
1174 *(zi->ci.central_header+SIZECENTRALHEADER+i) = *(filename+i);
1177 *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+i) =
1181 *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+
1183 if (zi->ci.central_header == NULL)
1186 zi->ci.zip64 = zip64;
1187 zi->ci.totalCompressedData = 0;
1188 zi->ci.totalUncompressedData = 0;
1189 zi->ci.pos_zip64extrainfo = 0;
1191 err = Write_LocalFileHeader(zi, filename, size_extrafield_local, extrafield_local);
1194 zi->ci.bstream.avail_in = (uInt)0;
1195 zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE;
1196 zi->ci.bstream.next_out = (char*)zi->ci.buffered_data;
1197 zi->ci.bstream.total_in_hi32 = 0;
1198 zi->ci.bstream.total_in_lo32 = 0;
1199 zi->ci.bstream.total_out_hi32 = 0;
1200 zi->ci.bstream.total_out_lo32 = 0;
1203 zi->ci.stream.avail_in = (uInt)0;
1204 zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
1205 zi->ci.stream.next_out = zi->ci.buffered_data;
1206 zi->ci.stream.total_in = 0;
1207 zi->ci.stream.total_out = 0;
1208 zi->ci.stream.data_type = Z_BINARY;
1211 if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED || zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
1213 if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
1216 if(zi->ci.method == Z_DEFLATED)
1218 zi->ci.stream.zalloc = (alloc_func)0;
1219 zi->ci.stream.zfree = (free_func)0;
1220 zi->ci.stream.opaque = (voidpf)0;
1225 err = deflateInit2(&zi->ci.stream, level, Z_DEFLATED, windowBits, memLevel, strategy);
1228 zi->ci.stream_initialised = Z_DEFLATED;
1230 else if(zi->ci.method == Z_BZIP2ED)
1234 zi->ci.bstream.bzalloc = 0;
1235 zi->ci.bstream.bzfree = 0;
1236 zi->ci.bstream.opaque = (voidpf)0;
1238 err = BZ2_bzCompressInit(&zi->ci.bstream, level, 0,35);
1240 zi->ci.stream_initialised = Z_BZIP2ED;
1247 zi->ci.crypt_header_size = 0;
1252 zi->ci.encrypt = 1;
1253 zi->ci.pcrc_32_tab = get_crc_table();
1254 /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/
1256 sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting);
1257 zi->ci.crypt_header_size = sizeHead;
1259 if (ZWRITE64(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead)
1265 zi->in_opened_file_inzip = 1;
1367 local int zip64FlushWriteBuffer(zip64_internal* zi)
1371 if (zi->ci.encrypt != 0)
1376 for (i=0;i<zi->ci.pos_in_buffered_data;i++)
1377 zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, zi->ci.buffered_data[i],t);
1381 if (ZWRITE64(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) != zi->ci.pos_in_buffered_data)
1384 zi->ci.totalCompressedData += zi->ci.pos_in_buffered_data;
1387 if(zi->ci.method == Z_BZIP2ED)
1389 zi->ci.totalUncompressedData += zi->ci.bstream.total_in_lo32;
1390 zi->ci.bstream.total_in_lo32 = 0;
1391 zi->ci.bstream.total_in_hi32 = 0;
1396 zi->ci.totalUncompressedData += zi->ci.stream.total_in;
1397 zi->ci.stream.total_in = 0;
1401 zi->ci.pos_in_buffered_data = 0;
1408 zip64_internal* zi;
1413 zi = (zip64_internal*)file;
1415 if (zi->in_opened_file_inzip == 0)
1418 zi->ci.crc32 = crc32(zi->ci.crc32,buf,(uInt)len);
1421 if(zi->ci.method == Z_BZIP2ED && (!zi->ci.raw))
1423 zi->ci.bstream.next_in = (void*)buf;
1424 zi->ci.bstream.avail_in = len;
1427 while ((err==BZ_RUN_OK) && (zi->ci.bstream.avail_in>0))
1429 if (zi->ci.bstream.avail_out == 0)
1431 if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
1433 zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE;
1434 zi->ci.bstream.next_out = (char*)zi->ci.buffered_data;
1441 if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
1443 uLong uTotalOutBefore_lo = zi->ci.bstream.total_out_lo32;
1444 // uLong uTotalOutBefore_hi = zi->ci.bstream.total_out_hi32;
1445 err=BZ2_bzCompress(&zi->ci.bstream, BZ_RUN);
1447 zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore_lo) ;
1457 zi->ci.stream.next_in = (Bytef*)buf;
1458 zi->ci.stream.avail_in = len;
1460 while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))
1462 if (zi->ci.stream.avail_out == 0)
1464 if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
1466 zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
1467 zi->ci.stream.next_out = zi->ci.buffered_data;
1474 if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
1476 uLong uTotalOutBefore = zi->ci.stream.total_out;
1477 err=deflate(&zi->ci.stream, Z_NO_FLUSH);
1478 if(uTotalOutBefore > zi->ci.stream.total_out)
1484 zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
1489 if (zi->ci.stream.avail_in < zi->ci.stream.avail_out)
1490 copy_this = zi->ci.stream.avail_in;
1492 copy_this = zi->ci.stream.avail_out;
1495 *(((char*)zi->ci.stream.next_out)+i) =
1496 *(((const char*)zi->ci.stream.next_in)+i);
1498 zi->ci.stream.avail_in -= copy_this;
1499 zi->ci.stream.avail_out-= copy_this;
1500 zi->ci.stream.next_in+= copy_this;
1501 zi->ci.stream.next_out+= copy_this;
1502 zi->ci.stream.total_in+= copy_this;
1503 zi->ci.stream.total_out+= copy_this;
1504 zi->ci.pos_in_buffered_data += copy_this;
1520 zip64_internal* zi;
1528 zi = (zip64_internal*)file;
1530 if (zi->in_opened_file_inzip == 0)
1532 zi->ci.stream.avail_in = 0;
1534 if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
1539 if (zi->ci.stream.avail_out == 0)
1541 if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
1543 zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
1544 zi->ci.stream.next_out = zi->ci.buffered_data;
1546 uTotalOutBefore = zi->ci.stream.total_out;
1547 err=deflate(&zi->ci.stream, Z_FINISH);
1548 zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
1551 else if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
1558 if (zi->ci.bstream.avail_out == 0)
1560 if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
1562 zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE;
1563 zi->ci.bstream.next_out = (char*)zi->ci.buffered_data;
1565 uTotalOutBefore = zi->ci.bstream.total_out_lo32;
1566 err=BZ2_bzCompress(&zi->ci.bstream, BZ_FINISH);
1570 zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore);
1581 if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK))
1583 if (zip64FlushWriteBuffer(zi)==ZIP_ERRNO)
1587 if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
1589 int tmp_err = deflateEnd(&zi->ci.stream);
1592 zi->ci.stream_initialised = 0;
1595 else if((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
1597 int tmperr = BZ2_bzCompressEnd(&zi->ci.bstream);
1600 zi->ci.stream_initialised = 0;
1604 if (!zi->ci.raw)
1606 crc32 = (uLong)zi->ci.crc32;
1607 uncompressed_size = zi->ci.totalUncompressedData;
1609 compressed_size = zi->ci.totalCompressedData;
1612 compressed_size += zi->ci.crypt_header_size;
1616 if(compressed_size >= 0xffffffff || uncompressed_size >= 0xffffffff || zi->ci.pos_local_header >= 0xffffffff)
1619 zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)45,2);
1621 zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)45,2);
1625 zip64local_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/
1629 zip64local_putValue_inmemory(zi->ci.central_header+20, invalidValue,4); /*compr size*/
1631 zip64local_putValue_inmemory(zi->ci.central_header+20, compressed_size,4); /*compr size*/
1634 if (zi->ci.stream.data_type == Z_ASCII)
1635 zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2);
1638 zip64local_putValue_inmemory(zi->ci.central_header+24, invalidValue,4); /*uncompr size*/
1640 zip64local_putValue_inmemory(zi->ci.central_header+24, uncompressed_size,4); /*uncompr size*/
1651 if(zi->ci.pos_local_header >= 0xffffffff)
1658 if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree)
1664 p = zi->ci.central_header + zi->ci.size_centralheader;
1684 if(zi->ci.pos_local_header >= 0xffffffff)
1686 zip64local_putValue_inmemory(p, zi->ci.pos_local_header, 8);
1693 zi->ci.size_centralExtraFree -= datasize + 4;
1694 zi->ci.size_centralheader += datasize + 4;
1697 zi->ci.size_centralExtra += datasize + 4;
1698 zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)zi->ci.size_centralExtra,2);
1702 err = add_data_in_datablock(&zi->central_dir, zi->ci.central_header, (uLong)zi->ci.size_centralheader);
1704 free(zi->ci.central_header);
1710 ZPOS64_T cur_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream);
1712 if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0)
1716 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */
1720 if(zi->ci.pos_zip64extrainfo > 0)
1723 if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_zip64extrainfo + 4,ZLIB_FILEFUNC_SEEK_SET)!=0)
1727 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, uncompressed_size, 8);
1730 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, compressed_size, 8);
1738 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4);
1741 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4);
1744 if (ZSEEK64(zi->z_filefunc,zi->filestream, cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0)
1748 zi->number_entry ++;
1749 zi->in_opened_file_inzip = 0;
1759 int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip)
1762 ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writting_offset;
1764 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4);
1768 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
1772 err = zip64local_putValue(&zi->z_filefunc,zi->filestream, pos,8);
1776 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)1,4);
1781 int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1787 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDHEADERMAGIC,4);
1790 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)Zip64DataSize,8); // why ZPOS64_T of this ?
1793 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);
1796 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);
1799 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
1802 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
1805 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8);
1808 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8);
1811 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)size_centraldir,8);
1815 ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
1816 err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8);
1820 int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1825 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4);
1828 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2);
1831 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2);
1836 if(zi->number_entry >= 0xFFFF)
1837 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record
1839 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2);
1845 if(zi->number_entry >= 0xFFFF)
1846 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record
1848 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2);
1852 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4);
1856 ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
1859 err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)0xffffffff,4);
1862 err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4);
1868 int Write_GlobalComment(zip64_internal* zi, const char* global_comment)
1876 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2);
1880 if (ZWRITE64(zi->z_filefunc,zi->filestream, global_comment, size_global_comment) != size_global_comment)
1888 zip64_internal* zi;
1897 zi = (zip64_internal*)file;
1899 if (zi->in_opened_file_inzip == 1)
1906 global_comment = zi->globalcomment;
1909 centraldir_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream);
1913 linkedlist_datablock_internal* ldi = zi->central_dir.first_block;
1918 if (ZWRITE64(zi->z_filefunc,zi->filestream, ldi->data, ldi->filled_in_this_block) != ldi->filled_in_this_block)
1926 free_linkedlist(&(zi->central_dir));
1928 pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
1929 if(pos >= 0xffffffff || zi->number_entry > 0xFFFF)
1931 ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream);
1932 Write_Zip64EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip);
1934 Write_Zip64EndOfCentralDirectoryLocator(zi, Zip64EOCDpos);
1938 err = Write_EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip);
1941 err = Write_GlobalComment(zi, global_comment);
1943 if (ZCLOSE64(zi->z_filefunc,zi->filestream) != 0)
1948 TRYFREE(zi->globalcomment);
1950 TRYFREE(zi);