void finalize_ofstream(struct ofstream *self) { finalize_ostream(&self->ostream); if (!self->is_owner) return; if (self->fp) fclose(self->fp); else close(self->fd); }
void finalize_ocstream(struct ocstream *self) { finalize_ostream(&self->ostream); if (self->ibuf) b6_deallocate(self->allocator, self->ibuf); if (self->obuf) b6_deallocate(self->allocator, self->obuf); if (self->cbuf) b6_deallocate(self->allocator, self->cbuf); }
void finalize_ozstream(struct ozstream *self) { int retval; self->zstream.next_in = Z_NULL; self->zstream.avail_in = 0; while ((retval = deflate(&self->zstream, Z_FINISH)) != Z_STREAM_END) { if (retval != Z_OK) break; /* FIXME: silent error */ flush_ozstream(&self->up); } finalize_ostream(&self->up); flush_ostream(self->ostream); deflateEnd(&self->zstream); }
void finalize_ohstream(struct ohstream *self) { finalize_ostream(&self->ostream); }
void finalize_ozstream(struct ozstream *self) { finalize_ostream(&self->up); deflateEnd(&self->zstream); }