MCPcopy Create free account
hub / github.com/git/git / write_zip_trailer

Function write_zip_trailer

archive-zip.c:590–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588}
589
590static void write_zip_trailer(const struct object_id *oid)
591{
592 struct zip_dir_trailer trailer;
593 int clamped = 0;
594
595 copy_le32(trailer.magic, 0x06054b50);
596 copy_le16(trailer.disk, 0);
597 copy_le16(trailer.directory_start_disk, 0);
598 copy_le16_clamp(trailer.entries_on_this_disk, zip_dir_entries,
599 &clamped);
600 copy_le16_clamp(trailer.entries, zip_dir_entries, &clamped);
601 copy_le32(trailer.size, zip_dir.len);
602 copy_le32_clamp(trailer.offset, zip_offset, &clamped);
603 copy_le16(trailer.comment_length, oid ? the_hash_algo->hexsz : 0);
604
605 write_or_die(1, zip_dir.buf, zip_dir.len);
606 if (clamped)
607 write_zip64_trailer();
608 write_or_die(1, &trailer, ZIP_DIR_TRAILER_SIZE);
609 if (oid)
610 write_or_die(1, oid_to_hex(oid), the_hash_algo->hexsz);
611}
612
613static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
614{

Callers 1

write_zip_archiveFunction · 0.85

Calls 7

copy_le32Function · 0.85
copy_le16Function · 0.85
copy_le16_clampFunction · 0.85
copy_le32_clampFunction · 0.85
write_or_dieFunction · 0.85
write_zip64_trailerFunction · 0.85
oid_to_hexFunction · 0.85

Tested by

no test coverage detected