Lines Matching refs:data
35 static ssize_t FileSink(const unsigned char* data, ssize_t len, void* token);
53 file->data = NULL; in LoadFileContents()
68 file->data = malloc(file->size); in LoadFileContents()
73 free(file->data); in LoadFileContents()
74 file->data = NULL; in LoadFileContents()
78 ssize_t bytes_read = fread(file->data, 1, file->size, f); in LoadFileContents()
82 free(file->data); in LoadFileContents()
83 file->data = NULL; in LoadFileContents()
88 SHA_hash(file->data, file->size, file->sha1); in LoadFileContents()
213 file->data = malloc(size[index[pairs-1]]); in LoadPartitionContents()
214 char* p = (char*)file->data; in LoadPartitionContents()
236 free(file->data); in LoadPartitionContents()
237 file->data = NULL; in LoadPartitionContents()
253 free(file->data); in LoadPartitionContents()
254 file->data = NULL; in LoadPartitionContents()
285 free(file->data); in LoadPartitionContents()
286 file->data = NULL; in LoadPartitionContents()
319 ssize_t bytes_written = FileSink(file->data, file->size, &fd); in SaveFileContents()
351 int WriteToPartition(unsigned char* data, size_t len, in WriteToPartition() argument
393 size_t written = mtd_write_data(ctx, (char*)data, len); in WriteToPartition()
434 ssize_t written = TEMP_FAILURE_RETRY(write(fd, data+start, to_write)); in WriteToPartition()
499 if (memcmp(buffer, data+p, to_read)) { in WriteToPartition()
584 file.data = NULL; in applypatch_check()
596 free(file.data); in applypatch_check()
597 file.data = NULL; in applypatch_check()
612 free(file.data); in applypatch_check()
617 free(file.data); in applypatch_check()
626 ssize_t FileSink(const unsigned char* data, ssize_t len, void* token) { in FileSink() argument
631 wrote = TEMP_FAILURE_RETRY(write(fd, data+done, len-done)); in FileSink()
647 ssize_t MemorySink(const unsigned char* data, ssize_t len, void* token) { in MemorySink() argument
652 memcpy(msi->buffer + msi->pos, data, len); in MemorySink()
735 copy_file.data = NULL; in applypatch()
736 source_file.data = NULL; in applypatch()
748 free(source_file.data); in applypatch()
753 if (source_file.data == NULL || in applypatch()
758 free(source_file.data); in applypatch()
759 source_file.data = NULL; in applypatch()
763 if (source_file.data != NULL) { in applypatch()
772 free(source_file.data); in applypatch()
773 source_file.data = NULL; in applypatch()
791 free(copy_file.data); in applypatch()
800 free(source_file.data); in applypatch()
801 free(copy_file.data); in applypatch()
957 char* header = patch->data; in GenerateTarget()
966 result = ApplyBSDiffPatch(source_to_use->data, source_to_use->size, in GenerateTarget()
970 result = ApplyImagePatch(source_to_use->data, source_to_use->size, in GenerateTarget()