• Home
  • Raw
  • Download

Lines Matching refs:archive

185 uint64_t GetOwnerTag(const ZipArchive* archive) {  in GetOwnerTag()  argument
187 reinterpret_cast<uint64_t>(archive)); in GetOwnerTag()
229 static int32_t MapCentralDirectory0(const char* debug_file_name, ZipArchive* archive, in MapCentralDirectory0() argument
234 if (!archive->mapped_zip.ReadAtOffset(scan_buffer, read_amount, search_start)) { in MapCentralDirectory0()
298 if (!archive->InitializeCentralDirectory(static_cast<off64_t>(eocd->cd_start_offset), in MapCentralDirectory0()
304 archive->num_entries = eocd->num_records; in MapCentralDirectory0()
305 archive->directory_offset = eocd->cd_start_offset; in MapCentralDirectory0()
318 static int32_t MapCentralDirectory(const char* debug_file_name, ZipArchive* archive) { in MapCentralDirectory() argument
322 off64_t file_length = archive->mapped_zip.GetFileLength(); in MapCentralDirectory()
356 MapCentralDirectory0(debug_file_name, archive, file_length, read_amount, scan_buffer.data()); in MapCentralDirectory()
366 static int32_t ParseZipArchive(ZipArchive* archive) { in ParseZipArchive() argument
367 const uint8_t* const cd_ptr = archive->central_directory.GetBasePtr(); in ParseZipArchive()
368 const size_t cd_length = archive->central_directory.GetMapLength(); in ParseZipArchive()
369 const uint16_t num_entries = archive->num_entries; in ParseZipArchive()
376 archive->hash_table_size = RoundUpPower2(1 + (num_entries * 4) / 3); in ParseZipArchive()
377 archive->hash_table = in ParseZipArchive()
378 reinterpret_cast<ZipStringOffset*>(calloc(archive->hash_table_size, sizeof(ZipStringOffset))); in ParseZipArchive()
379 if (archive->hash_table == nullptr) { in ParseZipArchive()
381 archive->hash_table_size, sizeof(ZipString)); in ParseZipArchive()
407 if (local_header_offset >= archive->directory_offset) { in ParseZipArchive()
434 const int add_result = AddToHash(archive->hash_table, archive->hash_table_size, entry_name, in ParseZipArchive()
435 archive->central_directory.GetBasePtr()); in ParseZipArchive()
449 if (!archive->mapped_zip.ReadAtOffset(reinterpret_cast<uint8_t*>(&lfh_start_bytes), in ParseZipArchive()
468 static int32_t OpenArchiveInternal(ZipArchive* archive, const char* debug_file_name) { in OpenArchiveInternal() argument
470 if ((result = MapCentralDirectory(debug_file_name, archive)) != 0) { in OpenArchiveInternal()
474 if ((result = ParseZipArchive(archive))) { in OpenArchiveInternal()
483 ZipArchive* archive = new ZipArchive(fd, assume_ownership); in OpenArchiveFd() local
484 *handle = archive; in OpenArchiveFd()
485 return OpenArchiveInternal(archive, debug_file_name); in OpenArchiveFd()
490 ZipArchive* archive = new ZipArchive(fd, true); in OpenArchive() local
491 *handle = archive; in OpenArchive()
498 return OpenArchiveInternal(archive, fileName); in OpenArchive()
503 ZipArchive* archive = new ZipArchive(address, length); in OpenArchiveFromMemory() local
504 *handle = archive; in OpenArchiveFromMemory()
505 return OpenArchiveInternal(archive, debug_file_name); in OpenArchiveFromMemory()
511 void CloseArchive(ZipArchiveHandle archive) { in CloseArchive() argument
512 ALOGV("Closing archive %p", archive); in CloseArchive()
513 delete archive; in CloseArchive()
548 static int32_t FindEntry(const ZipArchive* archive, const int ent, ZipEntry* data) { in FindEntry() argument
549 const uint16_t nameLen = archive->hash_table[ent].name_length; in FindEntry()
555 archive->hash_table[ent].GetZipString(archive->central_directory.GetBasePtr()); in FindEntry()
562 const uint8_t* base_ptr = archive->central_directory.GetBasePtr(); in FindEntry()
563 if (ptr < base_ptr || ptr > base_ptr + archive->central_directory.GetMapLength()) { in FindEntry()
573 const off64_t cd_offset = archive->directory_offset; in FindEntry()
594 if (!archive->mapped_zip.ReadAtOffset(lfh_buf, sizeof(lfh_buf), local_header_offset)) { in FindEntry()
662 if (!archive->mapped_zip.ReadAtOffset(name_buf.data(), nameLen, name_offset)) { in FindEntry()
667 archive->hash_table[ent].GetZipString(archive->central_directory.GetBasePtr()); in FindEntry()
709 ZipArchive* archive; member
738 int32_t StartIteration(ZipArchiveHandle archive, void** cookie_ptr, in StartIteration() argument
740 if (archive == NULL || archive->hash_table == NULL) { in StartIteration()
747 cookie->archive = archive; in StartIteration()
757 int32_t FindEntry(const ZipArchiveHandle archive, const ZipString& entryName, ZipEntry* data) { in FindEntry() argument
763 const int64_t ent = EntryToIndex(archive->hash_table, archive->hash_table_size, entryName, in FindEntry()
764 archive->central_directory.GetBasePtr()); in FindEntry()
769 return FindEntry(archive, ent, data); in FindEntry()
779 ZipArchive* archive = handle->archive; in Next() local
780 if (archive == NULL || archive->hash_table == NULL) { in Next()
786 const uint32_t hash_table_length = archive->hash_table_size; in Next()
787 const ZipStringOffset* hash_table = archive->hash_table; in Next()
790 hash_table[i].GetZipString(archive->central_directory.GetBasePtr()); in Next()
795 const int error = FindEntry(archive, i, data); in Next()
1106 int32_t ExtractToWriter(ZipArchiveHandle archive, ZipEntry* entry, zip_archive::Writer* writer) { in ExtractToWriter() argument
1113 return_value = CopyEntryToWriter(archive->mapped_zip, entry, writer, &crc); in ExtractToWriter()
1115 return_value = InflateEntryToWriter(archive->mapped_zip, entry, writer, &crc); in ExtractToWriter()
1119 return_value = ValidateDataDescriptor(archive->mapped_zip, entry); in ExtractToWriter()
1134 int32_t ExtractToMemory(ZipArchiveHandle archive, ZipEntry* entry, uint8_t* begin, uint32_t size) { in ExtractToMemory() argument
1136 return ExtractToWriter(archive, entry, &writer); in ExtractToMemory()
1139 int32_t ExtractEntryToFile(ZipArchiveHandle archive, ZipEntry* entry, int fd) { in ExtractEntryToFile() argument
1145 return ExtractToWriter(archive, entry, &writer); in ExtractEntryToFile()
1162 int GetFileDescriptor(const ZipArchiveHandle archive) { in GetFileDescriptor() argument
1163 return archive->mapped_zip.GetFileDescriptor(); in GetFileDescriptor()
1187 int32_t ProcessZipEntryContents(ZipArchiveHandle archive, ZipEntry* entry, in ProcessZipEntryContents() argument
1190 return ExtractToWriter(archive, entry, &writer); in ProcessZipEntryContents()