Lines Matching refs:archive
63 "Duplicate entries in archive",
64 "Empty archive",
81 // The input file cannot be processed as a zip archive. Usually because
89 // The zip archive contained two (or possibly more) entries with the same
93 // The zip archive contains no entries.
96 // The specified entry was not found in the archive.
99 // The zip archive contained an invalid local file header pointer.
102 // The zip archive contained inconsistent entry information. This could
120 * A Read-only Zip archive.
129 * It's possible that somebody has handed us a massive (~1GB) zip archive,
218 ZipArchive* archive, off64_t file_length,
234 * Scan backward for the EOCD magic. In an archive without a trailing
270 * archive and verify that they look reasonable.
278 ALOGW("Zip: empty archive?");
287 * in archive.
289 if (!archive->directory_map.create(debug_file_name, fd,
295 archive->num_entries = eocd->num_records;
296 archive->directory_offset = eocd->cd_start_offset;
310 ZipArchive* archive) {
336 * 18 bytes of EOCD stuff and up to 64KB of archive comment. We
349 int32_t result = MapCentralDirectory0(fd, debug_file_name, archive,
357 * Parses the Zip archive's Central Directory. Allocates and populates the
362 static int32_t ParseZipArchive(ZipArchive* archive) {
364 reinterpret_cast<const uint8_t*>(archive->directory_map.getDataPtr());
365 const size_t cd_length = archive->directory_map.getDataLength();
366 const uint16_t num_entries = archive->num_entries;
373 archive->hash_table_size = RoundUpPower2(1 + (num_entries * 4) / 3);
374 archive->hash_table = reinterpret_cast<ZipString*>(calloc(archive->hash_table_size,
397 if (local_header_offset >= archive->directory_offset) {
417 const int add_result = AddToHash(archive->hash_table,
418 archive->hash_table_size, entry_name);
436 static int32_t OpenArchiveInternal(ZipArchive* archive,
439 if ((result = MapCentralDirectory(archive->fd, debug_file_name, archive))) {
443 if ((result = ParseZipArchive(archive))) {
452 ZipArchive* archive = new ZipArchive(fd, assume_ownership);
453 *handle = archive;
454 return OpenArchiveInternal(archive, debug_file_name);
459 ZipArchive* archive = new ZipArchive(fd, true);
460 *handle = archive;
467 return OpenArchiveInternal(archive, fileName);
474 ZipArchive* archive = reinterpret_cast<ZipArchive*>(handle);
475 ALOGV("Closing archive %p", archive);
476 delete archive;
514 static int32_t FindEntry(const ZipArchive* archive, const int ent,
516 const uint16_t nameLen = archive->hash_table[ent].name_length;
521 const uint8_t* ptr = archive->hash_table[ent].name;
528 archive->directory_map.getDataPtr());
529 if (ptr < base_ptr || ptr > base_ptr + archive->directory_map.getDataLength()) {
540 const off64_t cd_offset = archive->directory_offset;
561 if (!ReadAtOffset(archive->fd, lfh_buf, sizeof(lfh_buf), local_header_offset)) {
602 if (!ReadAtOffset(archive->fd, name_buf, nameLen, name_offset)) {
608 if (memcmp(archive->hash_table[ent].name, name_buf, nameLen)) {
650 ZipArchive* archive;
683 ZipArchive* archive = reinterpret_cast<ZipArchive*>(handle);
685 if (archive == NULL || archive->hash_table == NULL) {
692 cookie->archive = archive;
704 const ZipArchive* archive = reinterpret_cast<ZipArchive*>(handle);
710 const int64_t ent = EntryToIndex(archive->hash_table,
711 archive->hash_table_size, entryName);
718 return FindEntry(archive, ent, data);
727 ZipArchive* archive = handle->archive;
728 if (archive == NULL || archive->hash_table == NULL) {
734 const uint32_t hash_table_length = archive->hash_table_size;
735 const ZipString* hash_table = archive->hash_table;
744 const int error = FindEntry(archive, i, data);
1013 ZipArchive* archive = reinterpret_cast<ZipArchive*>(handle);
1017 if (lseek64(archive->fd, data_offset, SEEK_SET) != data_offset) {
1026 return_value = CopyEntryToWriter(archive->fd, entry, writer, &crc);
1028 return_value = InflateEntryToWriter(archive->fd, entry, writer, &crc);
1032 return_value = UpdateEntryFromDataDescriptor(archive->fd, entry);