| 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 | |
| 905 | struct vecstream : stream |
no outgoing calls
no test coverage detected