blob: d1f4affc15e804e645ff2ba82aec8be113e47975 [file] [log] [blame]
adlr@google.com3defe6a2009-12-04 20:57:17 +00001// Copyright (c) 2009 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include <string>
6#include <vector>
7
8namespace chromeos_update_engine {
9
10// Gzip compresses or decompresses the input to the output.
11// Returns true on success. If true, *out will point to a malloc()ed
12// buffer, which must be free()d by the caller.
13bool GzipCompressData(const char* const in, const size_t in_size,
14 char** out, size_t* out_size);
15bool GzipDecompressData(const char* const in, const size_t in_size,
16 char** out, size_t* out_size);
17
18// Helper functions:
19bool GzipDecompress(const std::vector<char>& in, std::vector<char>* out);
20bool GzipCompress(const std::vector<char>& in, std::vector<char>* out);
21bool GzipCompressString(const std::string& str, std::vector<char>* out);
22bool GzipDecompressString(const std::string& str, std::vector<char>* out);
23
24} // namespace chromeos_update_engine {