X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fzip-writer.c;h=e93ec887e8be952e08a3db28cd79c4b139ec8249;hb=5cdb1f83c37674ee6d588bb0104729d564012ecb;hp=7e1a6ccc178f5b3e3956c0d3d1e5b1c8f469248b;hpb=f550aee00a62fe1d8baf62d83cd7efef6cc2ee92;p=pspp-builds.git diff --git a/src/libpspp/zip-writer.c b/src/libpspp/zip-writer.c index 7e1a6ccc..e93ec887 100644 --- a/src/libpspp/zip-writer.c +++ b/src/libpspp/zip-writer.c @@ -17,6 +17,7 @@ #include #include "libpspp/zip-writer.h" +#include "libpspp/zip-private.h" #include #include @@ -120,7 +121,7 @@ zip_writer_add (struct zip_writer *zw, FILE *file, const char *member_name) /* Local file header. */ offset = ftello (zw->file); - put_u32 (zw, 0x04034b50); /* local file header signature */ + put_u32 (zw, MAGIC_LHDR); /* local file header signature */ put_u16 (zw, 10); /* version needed to extract */ put_u16 (zw, 1 << 3); /* general purpose bit flag */ put_u16 (zw, 0); /* compression method */ @@ -144,7 +145,7 @@ zip_writer_add (struct zip_writer *zw, FILE *file, const char *member_name) } /* Data descriptor. */ - put_u32 (zw, 0x08074b50); + put_u32 (zw, MAGIC_DDHD); put_u32 (zw, crc); put_u32 (zw, size); put_u32 (zw, size); @@ -179,7 +180,7 @@ zip_writer_close (struct zip_writer *zw) struct zip_member *m = &zw->members[i]; /* Central directory file header. */ - put_u32 (zw, 0x02014b50); /* central file header signature */ + put_u32 (zw, MAGIC_SOCD); /* central file header signature */ put_u16 (zw, 63); /* version made by */ put_u16 (zw, 10); /* version needed to extract */ put_u16 (zw, 1 << 3); /* general purpose bit flag */ @@ -203,7 +204,7 @@ zip_writer_close (struct zip_writer *zw) dir_end = ftello (zw->file); /* End of central directory record. */ - put_u32 (zw, 0x06054b50); /* end of central dir signature */ + put_u32 (zw, MAGIC_EOCD); /* end of central dir signature */ put_u16 (zw, 0); /* number of this disk */ put_u16 (zw, 0); /* number of the disk with the start of the central directory */