diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-10-23 23:42:01 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-10-24 00:04:36 +0300 |
commit | cc78b961ed847896c5d94fc564556e2db812df70 (patch) | |
tree | e3232d9376329099f75d97812a012e535ae695cb /contrib/libs/snappy/snappy.h | |
parent | 34017dfc732950000ee19e1e6e48a0175dd2109f (diff) | |
download | ydb-cc78b961ed847896c5d94fc564556e2db812df70.tar.gz |
Update contrib/libs/snappy to 1.1.10
Diffstat (limited to 'contrib/libs/snappy/snappy.h')
-rw-r--r-- | contrib/libs/snappy/snappy.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/contrib/libs/snappy/snappy.h b/contrib/libs/snappy/snappy.h index 1be786609f..3fe79b0b58 100644 --- a/contrib/libs/snappy/snappy.h +++ b/contrib/libs/snappy/snappy.h @@ -72,7 +72,7 @@ namespace snappy { // Higher-level string based routines (should be sufficient for most users) // ------------------------------------------------------------------------ - // Sets "*compressed" to the compressed version of "input[0,input_length-1]". + // Sets "*compressed" to the compressed version of "input[0..input_length-1]". // Original contents of *compressed are lost. // // REQUIRES: "input[]" is not an alias of "*compressed". @@ -81,7 +81,14 @@ namespace snappy { size_t Compress(const char* input, size_t input_length, TString* compressed); - // Decompresses "compressed[0,compressed_length-1]" to "*uncompressed". + // Same as `Compress` above but taking an `iovec` array as input. Note that + // this function preprocesses the inputs to compute the sum of + // `iov[0..iov_cnt-1].iov_len` before reading. To avoid this, use + // `RawCompressFromIOVec` below. + size_t CompressFromIOVec(const struct iovec* iov, size_t iov_cnt, + std::string* compressed); + + // Decompresses "compressed[0..compressed_length-1]" to "*uncompressed". // Original contents of "*uncompressed" are lost. // // REQUIRES: "compressed[]" is not an alias of "*uncompressed". @@ -129,6 +136,12 @@ namespace snappy { char* compressed, size_t* compressed_length); + // Same as `RawCompress` above but taking an `iovec` array as input. Note that + // `uncompressed_length` is the total number of bytes to be read from the + // elements of `iov` (_not_ the number of elements in `iov`). + void RawCompressFromIOVec(const struct iovec* iov, size_t uncompressed_length, + char* compressed, size_t* compressed_length); + // Given data in "compressed[0..compressed_length-1]" generated by // calling the Snappy::Compress routine, this routine // stores the uncompressed data to |