Lines Matching refs:len
35 static ssize_t FileSink(const unsigned char* data, ssize_t len, void* token);
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()
394 if (written != len) { in WriteToPartition()
396 written, len, partition); in WriteToPartition()
430 while (start < len) { in WriteToPartition()
431 size_t to_write = len - start; in WriteToPartition()
477 start = len; in WriteToPartition()
479 for (p = 0; p < len; p += sizeof(buffer)) { in WriteToPartition()
480 size_t to_read = len - p; in WriteToPartition()
506 if (start == len) { in WriteToPartition()
626 ssize_t FileSink(const unsigned char* data, ssize_t len, void* token) { in FileSink() argument
630 while (done < (ssize_t) len) { in FileSink()
631 wrote = TEMP_FAILURE_RETRY(write(fd, data+done, len-done)); in FileSink()
633 printf("error writing %d bytes: %s\n", (int)(len-done), strerror(errno)); in FileSink()
647 ssize_t MemorySink(const unsigned char* data, ssize_t len, void* token) { in MemorySink() argument
649 if (msi->size - msi->pos < len) { in MemorySink()
652 memcpy(msi->buffer + msi->pos, data, len); in MemorySink()
653 msi->pos += len; in MemorySink()
654 return len; in MemorySink()