Mercurial > hg > dmlib
diff tools/packed.c @ 1037:d674ddc0fc82
Change PACK file format to use 64 bit fileoffsets. Also switch some
fields around for nicety. This breaks compatibility, so bump version.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 01 Mar 2015 16:59:00 +0200 |
parents | 1a0a327d8fed |
children | 54970cd5acf0 |
line wrap: on
line diff
--- a/tools/packed.c Sun Mar 01 16:57:50 2015 +0200 +++ b/tools/packed.c Sun Mar 01 16:59:00 2015 +0200 @@ -217,7 +217,7 @@ if (!dm_fwrite_str(pack->file, (Uint8 *) & hdr.ident, sizeof(hdr.ident)) || !dm_fwrite_le16(pack->file, hdr.version) || !dm_fwrite_le32(pack->file, hdr.dirEntries) || - !dm_fwrite_le32(pack->file, hdr.dirOffset)) + !dm_fwrite_le64(pack->file, hdr.dirOffset)) return DMERR_FWRITE; // Write the directory @@ -229,9 +229,9 @@ { // Write one entry if (!dm_fwrite_str(pack->file, node->filename, DMRES_NAME_LEN) || + !dm_fwrite_le64(pack->file, node->offset) || + !dm_fwrite_le32(pack->file, node->length) || !dm_fwrite_le32(pack->file, node->size) || - !dm_fwrite_le32(pack->file, node->offset) || - !dm_fwrite_le32(pack->file, node->length) || !dm_fwrite_le32(pack->file, node->flags)) return DMERR_FWRITE;