MCPcopy Create free account
hub / github.com/assimp/assimp / unzCloseCurrentFile

Function unzCloseCurrentFile

contrib/unzip/unzip.c:1870–1908  ·  view source on GitHub ↗

Close the file in zip opened with unzOpenCurrentFile Return UNZ_CRCERROR if all the file was read but the CRC is not good */

Source from the content-addressed store, hash-verified

1868 Return UNZ_CRCERROR if all the file was read but the CRC is not good
1869*/
1870extern int ZEXPORT unzCloseCurrentFile(unzFile file) {
1871 int err=UNZ_OK;
1872
1873 unz64_s* s;
1874 file_in_zip64_read_info_s* pfile_in_zip_read_info;
1875 if (file==NULL)
1876 return UNZ_PARAMERROR;
1877 s=(unz64_s*)file;
1878 pfile_in_zip_read_info=s->pfile_in_zip_read;
1879
1880 if (pfile_in_zip_read_info==NULL)
1881 return UNZ_PARAMERROR;
1882
1883
1884 if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) &&
1885 (!pfile_in_zip_read_info->raw))
1886 {
1887 if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
1888 err=UNZ_CRCERROR;
1889 }
1890
1891
1892 free(pfile_in_zip_read_info->read_buffer);
1893 pfile_in_zip_read_info->read_buffer = NULL;
1894 if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED)
1895 inflateEnd(&pfile_in_zip_read_info->stream);
1896#ifdef HAVE_BZIP2
1897 else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED)
1898 BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream);
1899#endif
1900
1901
1902 pfile_in_zip_read_info->stream_initialised = 0;
1903 free(pfile_in_zip_read_info);
1904
1905 s->pfile_in_zip_read=NULL;
1906
1907 return err;
1908}
1909
1910
1911/*

Callers 4

unzCloseFunction · 0.70
unzOpenCurrentFile3Function · 0.70
InternReadFileMethod · 0.50
ExtractMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected