MCPcopy Create free account
hub / github.com/assaultcube/AC / readbuf

Method readbuf

source/src/zip.cpp:224–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222 }
223
224 void readbuf(uint size = BUFSIZE)
225 {
226 if(!zfile.avail_in) zfile.next_in = (Bytef *)buf;
227 size = min(size, uint(&buf[BUFSIZE] - &zfile.next_in[zfile.avail_in]));
228 if(arch->owner != this)
229 {
230 arch->owner = NULL;
231 if(arch->data->seek(reading, SEEK_SET)) arch->owner = this;
232 else return;
233 }
234 uint remaining = info->offset + info->compressedsize - reading;
235 int n = arch->owner == this ? (int)arch->data->read(zfile.next_in + zfile.avail_in, min(size, remaining)) : 0;
236 zfile.avail_in += n;
237 reading += n;
238 }
239
240 bool open(ziparchive *a, zipfile *zf)
241 {

Callers

nothing calls this directly

Calls 3

minFunction · 0.85
seekMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected