This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
put_bytes (zw, &x, sizeof x);
}
static void
put_u32 (struct zip_writer *zw, uint32_t x)
{
put_bytes (zw, &x, sizeof x);
}
static void
put_u32 (struct zip_writer *zw, uint32_t x)
{
- error (0, errno, _("%s: error opening output file"), file_name);
+ msg_error (errno, _("%s: error opening output file"), file_name);
- offset = ftell (zw->file);
- put_u32 (zw, 0x04034b50); /* local file header signature */
+ offset = ftello (zw->file);
+ 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 */
put_u16 (zw, 10); /* version needed to extract */
put_u16 (zw, 1 << 3); /* general purpose bit flag */
put_u16 (zw, 0); /* compression method */
while ((bytes_read = fread (buf, 1, sizeof buf, file)) > 0)
{
put_bytes (zw, buf, bytes_read);
while ((bytes_read = fread (buf, 1, sizeof buf, file)) > 0)
{
put_bytes (zw, buf, bytes_read);
for (i = 0; i < zw->n_members; i++)
{
struct zip_member *m = &zw->members[i];
/* Central directory file header. */
for (i = 0; i < zw->n_members; i++)
{
struct zip_member *m = &zw->members[i];
/* Central directory file header. */
put_u16 (zw, 63); /* version made by */
put_u16 (zw, 10); /* version needed to extract */
put_u16 (zw, 1 << 3); /* general purpose bit flag */
put_u16 (zw, 63); /* version made by */
put_u16 (zw, 10); /* version needed to extract */
put_u16 (zw, 1 << 3); /* general purpose bit flag */
put_u16 (zw, 0); /* number of this disk */
put_u16 (zw, 0); /* number of the disk with the
start of the central directory */
put_u16 (zw, 0); /* number of this disk */
put_u16 (zw, 0); /* number of the disk with the
start of the central directory */
- error (0, errno, _("%s: write failed"), zw->file_name);
+ msg_error (errno, _("%s: write failed"), zw->file_name);