| 1760 | } |
| 1761 | |
| 1762 | int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) |
| 1763 | { |
| 1764 | int err = ZIP_OK; |
| 1765 | |
| 1766 | uLong Zip64DataSize = 44; |
| 1767 | |
| 1768 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (uLong)ZIP64ENDHEADERMAGIC, 4); |
| 1769 | |
| 1770 | if (err == ZIP_OK) /* size of this 'zip64 end of central directory' */ |
| 1771 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)Zip64DataSize, 8); // why ZPOS64_T of this ? |
| 1772 | |
| 1773 | if (err == ZIP_OK) /* version made by */ |
| 1774 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (uLong)45, 2); |
| 1775 | |
| 1776 | if (err == ZIP_OK) /* version needed */ |
| 1777 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (uLong)45, 2); |
| 1778 | |
| 1779 | if (err == ZIP_OK) /* number of this disk */ |
| 1780 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (uLong)0, 4); |
| 1781 | |
| 1782 | if (err == ZIP_OK) /* number of the disk with the start of the central directory */ |
| 1783 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (uLong)0, 4); |
| 1784 | |
| 1785 | if (err == ZIP_OK) /* total number of entries in the central dir on this disk */ |
| 1786 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8); |
| 1787 | |
| 1788 | if (err == ZIP_OK) /* total number of entries in the central dir */ |
| 1789 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8); |
| 1790 | |
| 1791 | if (err == ZIP_OK) /* size of the central directory */ |
| 1792 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)size_centraldir, 8); |
| 1793 | |
| 1794 | if (err == ZIP_OK) /* offset of start of central directory with respect to the starting disk number */ |
| 1795 | { |
| 1796 | ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writing_offset; |
| 1797 | err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)pos, 8); |
| 1798 | } |
| 1799 | return err; |
| 1800 | } |
| 1801 | |
| 1802 | int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) |
| 1803 | { |
no test coverage detected