MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / Write_Zip64EndOfCentralDirectoryRecord

Function Write_Zip64EndOfCentralDirectoryRecord

common/minizip/zip.c:1777–1815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1775}
1776
1777int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1778{
1779 int err = ZIP_OK;
1780
1781 uLong Zip64DataSize = 44;
1782
1783 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDHEADERMAGIC,4);
1784
1785 if (err==ZIP_OK) /* size of this 'zip64 end of central directory' */
1786 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)Zip64DataSize,8); // why ZPOS64_T of this ?
1787
1788 if (err==ZIP_OK) /* version made by */
1789 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);
1790
1791 if (err==ZIP_OK) /* version needed */
1792 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);
1793
1794 if (err==ZIP_OK) /* number of this disk */
1795 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
1796
1797 if (err==ZIP_OK) /* number of the disk with the start of the central directory */
1798 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
1799
1800 if (err==ZIP_OK) /* total number of entries in the central dir on this disk */
1801 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8);
1802
1803 if (err==ZIP_OK) /* total number of entries in the central dir */
1804 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8);
1805
1806 if (err==ZIP_OK) /* size of the central directory */
1807 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)size_centraldir,8);
1808
1809 if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */
1810 {
1811 ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writing_offset;
1812 err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8);
1813 }
1814 return err;
1815}
1816int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1817{
1818 int err = ZIP_OK;

Callers 1

zipCloseFunction · 0.85

Calls 1

zip64local_putValueFunction · 0.85

Tested by

no test coverage detected