// Copyright 2015 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef _BSDIFF_BSPATCH_H_ #define _BSDIFF_BSPATCH_H_ #include #include #include #include "extents_file.h" namespace bsdiff { int bspatch(const char* old_filename, const char* new_filename, const char* patch_filename, const char* old_extents, const char* new_extents); int bspatch(const char* old_filename, const char* new_filename, const uint8_t* patch_data, size_t patch_size, const char* old_extents, const char* new_extents); int bspatch(const uint8_t* old_data, size_t old_size, const uint8_t* patch_data, size_t patch_size, const std::function& sink); int bspatch(const std::unique_ptr& old_file, const std::unique_ptr& new_file, const uint8_t* patch_data, size_t patch_size); bool WriteAll(const std::unique_ptr& file, const uint8_t* data, size_t size); bool IsOverlapping(const char* old_filename, const char* new_filename, const std::vector& old_extents, const std::vector& new_extents); } // namespace bsdiff #endif // _BSDIFF_BSPATCH_H_