Index: src/platform/update_engine/bzip.h |
diff --git a/src/platform/update_engine/bzip.h b/src/platform/update_engine/bzip.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..72c9924d53ce5025ad64f298d60c7d1e81abdc07 |
--- /dev/null |
+++ b/src/platform/update_engine/bzip.h |
@@ -0,0 +1,35 @@ |
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include <string> |
+#include <vector> |
+ |
+namespace chromeos_update_engine { |
+ |
+// BzipData compresses or decompresses the input to the output. |
+// Returns true on success. |
+// Use one of BzipBuffToBuff*ompress as the template parameter to BzipData(). |
+int BzipBuffToBuffDecompress(char* out, |
Daniel Erat
2010/03/11 23:25:04
Are these supposed to be outside-facing? If not,
|
+ size_t* out_length, |
+ const char* in, |
+ size_t in_length); |
+int BzipBuffToBuffCompress(char* out, |
+ size_t* out_length, |
+ const char* in, |
+ size_t in_length); |
+template<int F(char* out, |
+ size_t* out_length, |
+ const char* in, |
+ size_t in_length)> |
+bool BzipData(const char* const in, |
+ const size_t in_size, |
+ std::vector<char>* const out); |
+ |
+// Helper functions: |
+bool BzipDecompress(const std::vector<char>& in, std::vector<char>* out); |
+bool BzipCompress(const std::vector<char>& in, std::vector<char>* out); |
+bool BzipCompressString(const std::string& str, std::vector<char>* out); |
+bool BzipDecompressString(const std::string& str, std::vector<char>* out); |
+ |
+} // namespace chromeos_update_engine |