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

Function write_zip_data_desc

archive-zip.c:237–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237static void write_zip_data_desc(unsigned long size,
238 unsigned long compressed_size,
239 unsigned long crc)
240{
241 if (size >= 0xffffffff || compressed_size >= 0xffffffff) {
242 struct zip64_data_desc trailer;
243 copy_le32(trailer.magic, 0x08074b50);
244 copy_le32(trailer.crc32, crc);
245 copy_le64(trailer.compressed_size, compressed_size);
246 copy_le64(trailer.size, size);
247 write_or_die(1, &trailer, ZIP64_DATA_DESC_SIZE);
248 zip_offset += ZIP64_DATA_DESC_SIZE;
249 } else {
250 struct zip_data_desc trailer;
251 copy_le32(trailer.magic, 0x08074b50);
252 copy_le32(trailer.crc32, crc);
253 copy_le32(trailer.compressed_size, compressed_size);
254 copy_le32(trailer.size, size);
255 write_or_die(1, &trailer, ZIP_DATA_DESC_SIZE);
256 zip_offset += ZIP_DATA_DESC_SIZE;
257 }
258}
259
260static void set_zip_header_data_desc(struct zip_local_header *header,
261 unsigned long size,

Callers 1

write_zip_entryFunction · 0.85

Calls 3

copy_le32Function · 0.85
copy_le64Function · 0.85
write_or_dieFunction · 0.85

Tested by

no test coverage detected