Home
last modified time | relevance | path

Searched refs:size_t (Results 1 – 25 of 84) sorted by relevance

1234

/bootable/recovery/applypatch/
Dimgpatch.cpp53 static bool ApplyBSDiffPatchAndStreamOutput(const uint8_t* src_data, size_t src_len, in ApplyBSDiffPatchAndStreamOutput()
54 const Value& patch, size_t patch_offset, in ApplyBSDiffPatchAndStreamOutput()
56 size_t expected_target_length = static_cast<size_t>(Read8(deflate_header + 32)); in ApplyBSDiffPatchAndStreamOutput()
57 CHECK_GT(expected_target_length, static_cast<size_t>(0)); in ApplyBSDiffPatchAndStreamOutput()
78 size_t actual_target_length = 0; in ApplyBSDiffPatchAndStreamOutput()
79 size_t total_written = 0; in ApplyBSDiffPatchAndStreamOutput()
80 static constexpr size_t buffer_size = 32768; in ApplyBSDiffPatchAndStreamOutput()
82 &ret, &sink](const uint8_t* data, size_t len) -> size_t { in ApplyBSDiffPatchAndStreamOutput()
101 size_t have = buffer_size - strm.avail_out; in ApplyBSDiffPatchAndStreamOutput()
135 int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const unsigned char* patch_data, in ApplyImagePatch()
[all …]
Dimgdiff.cpp175 static constexpr size_t VERSION = 2;
180 static constexpr size_t BLOCK_SIZE = 4096;
181 static constexpr size_t BUFFER_SIZE = 0x8000;
197 static bool AlignHead(size_t* start, size_t* length) { in AlignHead()
198 size_t residual = (*start % BLOCK_SIZE == 0) ? 0 : BLOCK_SIZE - *start % BLOCK_SIZE; in AlignHead()
211 static bool AlignTail(size_t* start, size_t* length) { in AlignTail()
212 size_t residual = (*start + *length) % BLOCK_SIZE; in AlignTail()
226 static bool RemoveUsedBlocks(size_t* start, size_t* length, const SortedRangeSet& used_ranges) { in RemoveUsedBlocks()
258 ImageChunk::ImageChunk(int type, size_t start, const std::vector<uint8_t>* file_content, in ImageChunk()
259 size_t raw_data_len, std::string entry_name) in ImageChunk()
[all …]
/bootable/recovery/otautil/include/otautil/
Drangeset.h26 using Range = std::pair<size_t, size_t>;
47 size_t GetBlockNumber(size_t idx) const;
57 std::optional<RangeSet> GetSubRanges(size_t start_index, size_t num_of_blocks) const;
65 std::vector<RangeSet> Split(size_t groups) const;
68 size_t size() const { in size()
73 size_t blocks() const { in blocks()
115 const Range& operator[](size_t i) const {
131 size_t blocks_;
147 static constexpr size_t kBlockSize = 4096;
160 void Insert(size_t start, size_t len);
[all …]
/bootable/recovery/applypatch/include/applypatch/
Dimgdiff_image.h41 ImageChunk(int type, size_t start, const std::vector<uint8_t>* file_content, size_t raw_data_len,
49 size_t GetRawDataLength() const { in GetRawDataLength()
55 size_t GetStartOffset() const { in GetStartOffset()
65 size_t DataLengthForPatch() const;
67 void Dump(size_t index) const;
107 size_t start_; // offset of chunk in the original input file
109 size_t raw_data_len_;
129 static bool RawDataIsSmaller(const ImageChunk& tgt, size_t patch_size);
135 size_t PatchSize() const;
140 size_t GetHeaderSize() const;
[all …]
Dapplypatch.h38 using SinkFn = std::function<size_t(const unsigned char*, size_t)>;
51 Partition(const std::string& name, size_t size, const std::string& hash) in Partition()
66 size_t size;
109 int ApplyBSDiffPatch(const unsigned char* old_data, size_t old_size, const Value& patch,
110 size_t patch_offset, SinkFn sink);
117 int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value& patch, SinkFn sink,
125 bool CheckAndFreeSpaceOnCache(size_t bytes);
129 bool RemoveFilesInDirectory(size_t bytes_needed, const std::string& dirname,
Dimgpatch.h24 using SinkFn = std::function<size_t(const unsigned char*, size_t)>;
26 int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const unsigned char* patch_data,
27 size_t patch_size, SinkFn sink);
/bootable/recovery/otautil/
Drangeset.cpp54 size_t num; in Parse()
55 if (!android::base::ParseUint(pieces[0], &num, static_cast<size_t>(INT_MAX))) { in Parse()
73 for (size_t i = 0; i < num; i += 2) { in Parse()
74 size_t first; in Parse()
75 size_t second; in Parse()
76 if (!android::base::ParseUint(pieces[i + 1], &first, static_cast<size_t>(INT_MAX)) || in Parse()
77 !android::base::ParseUint(pieces[i + 2], &second, static_cast<size_t>(INT_MAX))) { in Parse()
90 size_t sz = range.second - range.first; in PushBack()
106 std::vector<RangeSet> RangeSet::Split(size_t groups) const { in Split()
114 size_t mean = blocks_ / groups; in Split()
[all …]
/bootable/recovery/recovery_ui/include/recovery_ui/
Dscreen_ui.h86 size_t selection() const;
96 Menu(size_t initial_selection, const DrawInterface& draw_func);
98 size_t selection_;
108 TextMenu(bool scrollable, size_t max_items, size_t max_length,
110 size_t initial_selection, int char_height, const DrawInterface& draw_funcs);
121 size_t ItemsCount() const;
124 size_t MenuStart() const;
127 size_t MenuEnd() const;
141 std::string TextItem(size_t index) const;
151 const size_t max_display_items_;
[all …]
Dstub_ui.h64 size_t ShowMenu(const std::vector<std::string>& /* headers */,
65 const std::vector<std::string>& /* items */, size_t /* initial_selection */,
69 size_t ShowPromptWipeDataMenu(const std::vector<std::string>& /* backup_headers */, in ShowPromptWipeDataMenu()
75 size_t ShowPromptWipeDataConfirmationMenu( in ShowPromptWipeDataConfirmationMenu()
/bootable/recovery/minui/include/minui/
Dminui.h37 static constexpr size_t kSurfaceDataAlignment = 8;
45 static std::unique_ptr<GRSurface> Create(size_t width, size_t height, size_t row_bytes,
46 size_t pixel_bytes);
59 size_t data_size() const { in data_size()
63 size_t width;
64 size_t height;
65 size_t row_bytes;
66 size_t pixel_bytes;
69 GRSurface(size_t width, size_t height, size_t row_bytes, size_t pixel_bytes) in GRSurface()
81 size_t data_size_;
/bootable/recovery/updater/include/private/
Dcommands.h47 size_t blocks() const { in blocks()
73 size_t blocks() const { in blocks()
123 std::vector<uint8_t>* buffer, size_t block_size,
132 void DumpBuffer(const std::vector<uint8_t>& buffer, size_t block_size) const;
138 size_t blocks() const { in blocks()
161 size_t blocks_{ 0 };
170 PatchInfo(size_t offset, size_t length) : offset_(offset), length_(length) {} in PatchInfo()
172 size_t offset() const { in offset()
176 size_t length() const { in length()
185 size_t offset_{ 0 };
[all …]
/bootable/recovery/install/
Dasn1_decoder.cpp37 bool asn1_context::skip_bytes(size_t num_skip) { in skip_bytes()
46 bool asn1_context::decode_length(size_t* out_len) { in decode_length()
56 if (static_cast<size_t>(num_octets) >= sizeof(size_t)) { in decode_length()
59 size_t length = 0; in decode_length()
80 size_t length; in asn1_constructed_get()
93 size_t length; in asn1_constructed_skip_all()
110 size_t length; in asn1_sequence_get()
121 size_t length; in asn1_set_get()
129 size_t length; in asn1_sequence_next()
136 bool asn1_context::asn1_oid_get(const uint8_t** oid, size_t* length) { in asn1_oid_get()
[all …]
/bootable/recovery/tests/unit/host/
Dimgdiff_test.cpp38 static void verify_patch_header(const std::string& patch, size_t* num_normal, size_t* num_raw, in verify_patch_header()
39 size_t* num_deflate) { in verify_patch_header()
40 const size_t size = patch.size(); in verify_patch_header()
49 size_t normal = 0; in verify_patch_header()
50 size_t raw = 0; in verify_patch_header()
51 size_t deflate = 0; in verify_patch_header()
53 size_t pos = 12; in verify_patch_header()
87 [&](const unsigned char* data, size_t len) { in GenerateTarget()
137 size_t num_normal; in TEST()
138 size_t num_raw; in TEST()
[all …]
/bootable/recovery/tests/unit/
Dasn1_decoder_test.cpp37 size_t length; in TEST()
61 size_t length; in TEST()
72 size_t length; in TEST()
89 size_t length; in TEST()
107 size_t length; in TEST()
117 size_t length; in TEST()
135 size_t length; in TEST()
145 size_t length; in TEST()
155 size_t length; in TEST()
163 size_t length; in TEST()
[all …]
Drangeset_test.cpp41 ASSERT_EQ(static_cast<size_t>(1), rs.size()); in TEST()
43 ASSERT_EQ(static_cast<size_t>(9), rs.blocks()); in TEST()
46 ASSERT_EQ(static_cast<size_t>(2), rs2.size()); in TEST()
49 ASSERT_EQ(static_cast<size_t>(14), rs2.blocks()); in TEST()
96 ASSERT_EQ(static_cast<size_t>(2), rs.size()); in TEST()
97 ASSERT_EQ(static_cast<size_t>(12), rs.blocks()); in TEST()
109 ASSERT_FALSE(rs.PushBack({ 5, std::numeric_limits<size_t>::max() - 2 })); in TEST()
158 size_t rs6_blocks = rs6.blocks(); in TEST()
166 size_t sum = 0; in TEST()
209 ASSERT_EQ(static_cast<size_t>(1), rs.GetBlockNumber(0)); in TEST()
[all …]
/bootable/recovery/install/include/private/
Dasn1_decoder.h25 asn1_context(const uint8_t* buffer, size_t length) : p_(buffer), length_(length), app_type_(0) {} in asn1_context()
32 bool asn1_oid_get(const uint8_t** oid, size_t* length);
33 bool asn1_octet_string_get(const uint8_t** octet_string, size_t* length);
48 bool skip_bytes(size_t num_skip);
49 bool decode_length(size_t* out_len);
52 size_t length_;
/bootable/recovery/bootloader_message/include/bootloader_message/
Dbootloader_message.h32 constexpr size_t BOOTLOADER_MESSAGE_OFFSET_IN_MISC = 0;
33 constexpr size_t VENDOR_SPACE_OFFSET_IN_MISC = 2 * 1024;
34 constexpr size_t WIPE_PACKAGE_OFFSET_IN_MISC = 16 * 1024;
35 constexpr size_t SYSTEM_SPACE_OFFSET_IN_MISC = 32 * 1024;
36 constexpr size_t SYSTEM_SPACE_SIZE_IN_MISC = 32 * 1024;
124 bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device,
125 size_t offset, std::string* err);
166 bool read_wipe_package(std::string* package_data, size_t size, std::string* err);
/bootable/recovery/minui/
Dgraphics_fbdev.h34 static std::unique_ptr<GRSurfaceFbdev> Create(size_t width, size_t height, size_t row_bytes,
35 size_t pixel_bytes);
61 void SetDisplayedFramebuffer(size_t n);
68 size_t displayed_buffer{ 0 };
Devents.cpp39 constexpr size_t MAX_DEVICES = 16;
40 constexpr size_t MAX_MISC_FDS = 16;
42 constexpr size_t BITS_PER_LONG = sizeof(unsigned long) * 8;
43 constexpr size_t BITS_TO_LONGS(size_t bits) { in BITS_TO_LONGS()
60 static size_t g_ev_count = 0;
61 static size_t g_ev_dev_count = 0;
62 static size_t g_ev_misc_count = 0;
64 static bool test_bit(size_t bit, unsigned long* array) { // NOLINT in test_bit()
97 size_t event_len = event_len_int; in inotify_cb()
111 size_t offset = 0; in inotify_cb()
[all …]
Dgraphics_adf.h44 GRSurfaceAdf(size_t width, size_t height, size_t row_bytes, size_t pixel_bytes, __u32 offset, in GRSurfaceAdf()
73 size_t current_surface;
74 size_t n_surfaces;
Dgraphics_drm.h43 GRSurfaceDrm(size_t width, size_t height, size_t row_bytes, size_t pixel_bytes, int drm_fd, in GRSurfaceDrm()
/bootable/recovery/recovery_ui/
Dscreen_ui.cpp58 Menu::Menu(size_t initial_selection, const DrawInterface& draw_func) in Menu()
61 size_t Menu::selection() const { in selection()
65 TextMenu::TextMenu(bool scrollable, size_t max_items, size_t max_length, in TextMenu()
67 size_t initial_selection, int char_height, const DrawInterface& draw_funcs) in TextMenu()
75 CHECK_LE(max_items, static_cast<size_t>(std::numeric_limits<int>::max())); in TextMenu()
78 size_t items_count = scrollable_ ? items.size() : std::min(items.size(), max_display_items_); in TextMenu()
79 for (size_t i = 0; i < items_count; ++i) { in TextMenu()
90 std::string TextMenu::TextItem(size_t index) const { in TextItem()
96 size_t TextMenu::MenuStart() const { in MenuStart()
100 size_t TextMenu::MenuEnd() const { in MenuEnd()
[all …]
/bootable/recovery/updater/
Dblockimg.cpp75 static constexpr size_t BLOCKSIZE = 4096;
93 static bool ParseLastCommandFile(size_t* last_command_index) { in ParseLastCommandFile()
143 static bool UpdateLastCommandIndex(size_t command_index, const std::string& command_string) { in UpdateLastCommandIndex()
223 static void allocate(size_t size, std::vector<uint8_t>* buffer) { in allocate()
241 CHECK_NE(tgt.size(), static_cast<size_t>(0)); in RangeSinkWriter()
248 size_t AvailableSpace() const { in AvailableSpace()
253 size_t Write(const uint8_t* data, size_t size) { in Write()
259 size_t written = 0; in Write()
266 size_t write_now = size; in Write()
288 size_t BytesWritten() const { in BytesWritten()
[all …]
Dcommands.cpp40 Command::Command(Type type, size_t index, std::string cmdline, HashTreeInfo hash_tree_info) in Command()
98 size_t pos = 0; in ParseTargetInfoAndSourceInfo()
108 size_t src_blocks; in ParseTargetInfoAndSourceInfo()
178 Command Command::Parse(const std::string& line, size_t index, std::string* err) { in Parse()
180 size_t pos = 0; in Parse()
247 size_t offset; in Parse()
248 size_t length; in Parse()
318 const std::vector<uint8_t>& source, size_t block_size) { in MoveRange()
321 size_t start = locs.blocks(); in MoveRange()
324 size_t blocks = it->second - it->first; in MoveRange()
[all …]
/bootable/recovery/bootloader_message/
Dbootloader_message.cpp90 static bool read_misc_partition(void* p, size_t size, const std::string& misc_blk_device, in read_misc_partition()
91 size_t offset, std::string* err) { in read_misc_partition()
114 bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device, in write_misc_partition()
115 size_t offset, std::string* err) { in write_misc_partition()
238 bool read_wipe_package(std::string* package_data, size_t size, std::string* err) { in read_wipe_package()
253 static constexpr size_t kMaximumWipePackageSize = in write_wipe_package()
264 static bool ValidateSystemSpaceRegion(size_t offset, size_t size, std::string* err) { in ValidateSystemSpaceRegion()
272 static bool ReadMiscPartitionSystemSpace(void* data, size_t size, size_t offset, std::string* err) { in ReadMiscPartitionSystemSpace()
284 static bool WriteMiscPartitionSystemSpace(const void* data, size_t size, size_t offset, in WriteMiscPartitionSystemSpace()

1234