Home | History | Annotate | Download | only in bsdiff
      1 // Copyright 2017 The Chromium OS 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 #ifndef _BSDIFF_CONTROL_ENTRY_H_
      6 #define _BSDIFF_CONTROL_ENTRY_H_
      7 
      8 #include <stdint.h>
      9 
     10 struct ControlEntry {
     11   ControlEntry(uint64_t diff_size,
     12                uint64_t extra_size,
     13                int64_t offset_increment)
     14       : diff_size(diff_size),
     15         extra_size(extra_size),
     16         offset_increment(offset_increment) {}
     17 
     18   // The number of bytes to copy from the source and diff stream.
     19   uint64_t diff_size;
     20 
     21   // The number of bytes to copy from the extra stream.
     22   uint64_t extra_size;
     23 
     24   // The value to add to the source pointer after patching from the diff stream.
     25   int64_t offset_increment;
     26 
     27   bool operator==(const ControlEntry& o) const {
     28     return diff_size == o.diff_size && extra_size == o.extra_size &&
     29            offset_increment == o.offset_increment;
     30   }
     31 };
     32 
     33 #endif  // _BSDIFF_CONTROL_ENTRY_H_
     34