#include "puffin/src/include/puffin/utils.h"
#include <inttypes.h>
#include <algorithm>
#include <iterator>
#include <set>
#include <string>
#include <vector>
#include "puffin/file_stream.h"
#include "puffin/memory_stream.h"
#include "puffin/src/bit_reader.h"
#include "puffin/src/include/puffin/common.h"
#include "puffin/src/include/puffin/puffer.h"
#include "puffin/src/logging.h"
#include "puffin/src/puff_writer.h"
set;
string;
vector;
namespace {
template <typename T>
inline T get_unaligned(const void* address) { … }
struct ExtentData { … };
}
namespace puffin {
bool LocateDeflatesInDeflateStream(const uint8_t* data,
uint64_t size,
uint64_t virtual_offset,
vector<BitExtent>* deflates,
uint64_t* compressed_size) { … }
bool LocateDeflatesInZlib(const Buffer& data, vector<BitExtent>* deflates) { … }
bool FindDeflateSubBlocks(const UniqueStreamPtr& src,
const vector<ByteExtent>& deflates,
vector<BitExtent>* subblock_deflates) { … }
bool LocateDeflatesInZlibBlocks(const string& file_path,
const vector<ByteExtent>& zlibs,
vector<BitExtent>* deflates) { … }
namespace {
bool IsValidGzipHeader(const uint8_t* header, size_t size) { … }
}
bool LocateDeflatesInGzip(const Buffer& data, vector<BitExtent>* deflates) { … }
bool LocateDeflatesInZipArchive(const Buffer& data,
vector<BitExtent>* deflates) { … }
bool FindPuffLocations(const UniqueStreamPtr& src,
const vector<BitExtent>& deflates,
vector<ByteExtent>* puffs,
uint64_t* out_puff_size) { … }
void RemoveEqualBitExtents(const Buffer& data1,
const Buffer& data2,
vector<BitExtent>* extents1,
vector<BitExtent>* extents2) { … }
bool RemoveDeflatesWithBadDistanceCaches(const Buffer& data,
vector<BitExtent>* deflates) { … }
}