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

Method write

source/src/stream.cpp:889–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

887 }
888
889 int write(const void *buf, int len)
890 {
891 if(!writing || !buf || !len) return 0;
892 zfile.next_in = (Bytef *)buf;
893 zfile.avail_in = len;
894 while(zfile.avail_in > 0)
895 {
896 if(!zfile.avail_out && !flush()) { stopwriting(); break; }
897 int err = deflate(&zfile, Z_NO_FLUSH);
898 if(err != Z_OK) { stopwriting(); break; }
899 }
900 crc = crc32(crc, (Bytef *)buf, len - zfile.avail_in);
901 return len - zfile.avail_in;
902 }
903};
904
905struct vecstream : stream

Callers 5

rwopswriteFunction · 0.45
writeheaderMethod · 0.45
finishwritingMethod · 0.45
flushMethod · 0.45
streamcopyFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected