FreeBSD/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
/*
 * Create the compression buffer, and fill it with the CTF and string
 * table data.  We flush the compression state between the two so the
 * dictionary used for the string tables won't be polluted with values
 * that made sense for the CTF data.
 */
Create the compression buffer, and fill it with the CTF and string
table data.  We flush the compression state between the two so the
dictionary used for the string tables won't be polluted with values
that made sense for the CTF data.
Create the compression buffer and fill it with the CTF and string table data . We flush the compression state between the two so the dictionary used for the string tables won ' t be polluted with values that made sense for the CTF data .
static caddr_t
write_compressed_buffer(ctf_header_t *h, ctf_buf_t *buf, size_t *resszp)
{
	resbuf_t resbuf;
	resbuf.rb_size = RES_BUF_CHUNK_SIZE;
	resbuf.rb_base = xmalloc(resbuf.rb_size);
	bcopy(h, resbuf.rb_base, sizeof (ctf_header_t));
	resbuf.rb_ptr = resbuf.rb_base + sizeof (ctf_header_t);
	compress_start(&resbuf);
	(void) compress_buffer(buf->ctb_base, buf->ctb_ptr - buf->ctb_base,
	    &resbuf);
	compress_flush(&resbuf, Z_FULL_FLUSH);
	(void) strtab_write(&buf->ctb_strtab, compress_buffer, &resbuf);
	compress_end(&resbuf);
	*resszp = (resbuf.rb_ptr - resbuf.rb_base);
	return (resbuf.rb_base);
}
static caddr_t write_compressed_buffer ( ctf_header_t * h , ctf_buf_t * buf , size_t * resszp ) { resbuf_t resbuf ; resbuf . rb_size = RES_BUF_CHUNK_SIZE ; resbuf . rb_base = xmalloc ( resbuf . rb_size ) ; bcopy ( h , resbuf . rb_base , sizeof ( ctf_header_t ) ) ; resbuf . rb_ptr = resbuf . rb_base + sizeof ( ctf_header_t ) ; compress_start ( & resbuf ) ; ( void ) compress_buffer ( buf -> ctb_base , buf -> ctb_ptr - buf -> ctb_base , & resbuf ) ; compress_flush ( & resbuf , Z_FULL_FLUSH ) ; ( void ) strtab_write ( & buf -> ctb_strtab , compress_buffer , & resbuf ) ; compress_end ( & resbuf ) ; * resszp = ( resbuf . rb_ptr - resbuf . rb_base ) ; return ( resbuf . rb_base ) ; }
Create the compression buffer, and fill it with the CTF and string
 table data.
Create the compression buffer and fill it with the CTF and string table data .