xpress_win.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. //
  6. // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
  7. // Use of this source code is governed by a BSD-style license that can be
  8. // found in the LICENSE file. See the AUTHORS file for names of contributors.
  9. #pragma once
  10. #include <string>
  11. #include "rocksdb/rocksdb_namespace.h"
  12. namespace ROCKSDB_NAMESPACE {
  13. namespace port {
  14. namespace xpress {
  15. bool Compress(const char* input, size_t length, std::string* output);
  16. // Returns written size or 0 on failure including if buffer is too small.
  17. size_t CompressWithMaxSize(const char* input, size_t length, char* output,
  18. size_t max_output_size);
  19. char* Decompress(const char* input_data, size_t input_length,
  20. size_t* uncompressed_size);
  21. int64_t GetDecompressedSize(const char* input, size_t input_length);
  22. int64_t DecompressToBuffer(const char* input, size_t input_length, char* output,
  23. size_t output_length);
  24. } // namespace xpress
  25. } // namespace port
  26. } // namespace ROCKSDB_NAMESPACE