Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
void finalize_ohstream(struct ohstream *self)
{
	finalize_ostream(&self->ostream);
}
Ejemplo n.º 5
0
void finalize_ozstream(struct ozstream *self)
{
	finalize_ostream(&self->up);
	deflateEnd(&self->zstream);
}