Lines Matching refs:entry

197 static void ExtractToPipe(ZipArchiveHandle zah, const ZipEntry64& entry, const std::string& name) {  in ExtractToPipe()  argument
200 if (entry.uncompressed_length > SIZE_MAX) { in ExtractToPipe()
201 die(0, "entry size %" PRIu64 " is too large to extract.", entry.uncompressed_length); in ExtractToPipe()
203 auto uncompressed_length = static_cast<size_t>(entry.uncompressed_length); in ExtractToPipe()
205 int err = ExtractToMemory(zah, &entry, buffer, uncompressed_length); in ExtractToPipe()
215 static void ExtractOne(ZipArchiveHandle zah, const ZipEntry64& entry, std::string name) { in ExtractOne() argument
236 if (mkdir(name.c_str(), entry.unix_mode) == -1) { in ExtractOne()
248 int fd = open(name.c_str(), O_CREAT | O_WRONLY | O_CLOEXEC | O_EXCL, entry.unix_mode); in ExtractOne()
253 fd = open(name.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC | O_TRUNC, entry.unix_mode); in ExtractOne()
259 int err = ExtractEntryToFile(zah, &entry, fd); in ExtractOne()
264 static void ListOne(const ZipEntry64& entry, const std::string& name) { in ListOne() argument
265 tm t = entry.GetModificationTime(); in ListOne()
270 printf("%8" PRIu64 " %s %8" PRIu64 " %3.0f%% %s %08x %s\n", entry.uncompressed_length, in ListOne()
271 (entry.method == kCompressStored) ? "Stored" : "Defl:N", entry.compressed_length, in ListOne()
272 CompressionRatio(entry.uncompressed_length, entry.compressed_length), time, entry.crc32, in ListOne()
275 printf("%9" PRIu64 " %s %s\n", entry.uncompressed_length, time, name.c_str()); in ListOne()
279 static void InfoOne(const ZipEntry64& entry, const std::string& name) { in InfoOne() argument
286 int version = entry.version_made_by & 0xff; in InfoOne()
287 int os = (entry.version_made_by >> 8) & 0xff; in InfoOne()
295 int attrs = entry.external_file_attributes & 0xff; in InfoOne()
309 mode[0] = S_ISDIR(entry.unix_mode) ? 'd' : (S_ISREG(entry.unix_mode) ? '-' : '?'); in InfoOne()
310 mode[1] = entry.unix_mode & S_IRUSR ? 'r' : '-'; in InfoOne()
311 mode[2] = entry.unix_mode & S_IWUSR ? 'w' : '-'; in InfoOne()
312 mode[3] = entry.unix_mode & S_IXUSR ? 'x' : '-'; in InfoOne()
313 mode[4] = entry.unix_mode & S_IRGRP ? 'r' : '-'; in InfoOne()
314 mode[5] = entry.unix_mode & S_IWGRP ? 'w' : '-'; in InfoOne()
315 mode[6] = entry.unix_mode & S_IXGRP ? 'x' : '-'; in InfoOne()
316 mode[7] = entry.unix_mode & S_IROTH ? 'r' : '-'; in InfoOne()
317 mode[8] = entry.unix_mode & S_IWOTH ? 'w' : '-'; in InfoOne()
318 mode[9] = entry.unix_mode & S_IXOTH ? 'x' : '-'; in InfoOne()
322 if (entry.method == kCompressDeflated) { in InfoOne()
323 snprintf(method, sizeof(method), "def%c", "NXFS"[(entry.gpbf >> 1) & 0x3]); in InfoOne()
328 tm t = entry.GetModificationTime(); in InfoOne()
335 entry.uncompressed_length, entry.is_text ? 't' : 'b', in InfoOne()
336 entry.has_data_descriptor ? 'X' : 'x', method, time, name.c_str()); in InfoOne()
339 static void ProcessOne(ZipArchiveHandle zah, const ZipEntry64& entry, const std::string& name) { in ProcessOne() argument
343 ListOne(entry, name); in ProcessOne()
347 ExtractToPipe(zah, entry, name); in ProcessOne()
349 ExtractOne(zah, entry, name); in ProcessOne()
354 InfoOne(entry, name); in ProcessOne()
356 total_uncompressed_length += entry.uncompressed_length; in ProcessOne()
357 total_compressed_length += entry.compressed_length; in ProcessOne()
372 ZipEntry64 entry; in ProcessAll() local
374 while ((err = Next(cookie, &entry, &name)) >= 0) { in ProcessAll()
375 if (ShouldInclude(name)) ProcessOne(zah, entry, name); in ProcessAll()