30 if (m->
base ==
nullptr) {
36 if (offset >= (uint64_t)m->
len) {
39 const uint64_t avail = (uint64_t)m->
len - offset;
40 const size_t n = ((uint64_t)len > avail) ? (
size_t)avail : len;
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.
Bounded flat-memory backing for unarch_read_fn.
const uint8_t * base
First readable byte of the flat view.
size_t len
Readable length in bytes.
size_t unarch_mem_read(void *ctx, uint64_t offset, void *buf, size_t len)
unarch_read_fn over a flat unarch_mem_t view.
Shared seek+read seam and flat-memory backing for the unarchivers.