39 #ifndef THIRD_PARTY_SNAPPY_SNAPPY_H__ 40 #define THIRD_PARTY_SNAPPY_SNAPPY_H__ 45 #include "snappy-stubs-public.h" 57 size_t Compress(Source* source, Sink* sink);
66 bool GetUncompressedLength(Source* source, uint32* result);
76 size_t Compress(
const char* input,
size_t input_length,
string* output);
84 bool Uncompress(
const char* compressed,
size_t compressed_length,
85 string* uncompressed);
90 bool Uncompress(Source* compressed, Sink* uncompressed);
98 size_t UncompressAsMuchAsPossible(Source* compressed, Sink* uncompressed);
119 void RawCompress(
const char* input,
122 size_t* compressed_length);
129 bool RawUncompress(
const char* compressed,
size_t compressed_length,
137 bool RawUncompress(Source* compressed,
char* uncompressed);
147 bool RawUncompressToIOVec(
const char* compressed,
size_t compressed_length,
148 const struct iovec* iov,
size_t iov_cnt);
158 bool RawUncompressToIOVec(Source* compressed,
const struct iovec* iov,
163 size_t MaxCompressedLength(
size_t source_bytes);
169 bool GetUncompressedLength(
const char* compressed,
size_t compressed_length,
176 bool IsValidCompressedBuffer(
const char* compressed,
177 size_t compressed_length);
185 bool IsValidCompressed(Source* compressed);
196 static const int kBlockLog = 16;
197 static const size_t kBlockSize = 1 << kBlockLog;
199 static const int kMaxHashTableBits = 14;
200 static const size_t kMaxHashTableSize = 1 << kMaxHashTableBits;
203 #endif // THIRD_PARTY_SNAPPY_SNAPPY_H__