third_party/cairo/src/cairo-lzw.c
static void
_lzw_buf_init (lzw_buf_t *buf, int size)
{
    if (size == 0)
	size = 16;

    buf->status = CAIRO_STATUS_SUCCESS;
    buf->data_size = size;
    buf->num_data = 0;
    buf->pending = 0;
    buf->pending_bits = 0;

    buf->data = _cairo_malloc (size);
    if (unlikely (buf->data == NULL)) {
	buf->data_size = 0;
	buf->status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
	return;
    }
}
/* An lzw_buf_t is a simple, growable chunk of memory for holding
 * variable-size objects of up to 16 bits each.
 *
 * Initialize an lzw_buf_t to the given size in bytes.
 *
 * To store objects into the lzw_buf_t, call _lzw_buf_store_bits and
 * when finished, call _lzw_buf_store_pending, (which flushes out the
 * last few bits that hadn't yet made a complete byte yet).
 *
 * Instead of returning failure from any functions, lzw_buf_t provides
 * a status value that the caller can query, (and should query at
 * least once when done with the object). The status value will be
 * either %CAIRO_STATUS_SUCCESS or %CAIRO_STATUS_NO_MEMORY;
 */
An lzw_buf_t is a simple, growable chunk of memory for holding
variable-size objects of up to 16 bits each.

Initialize an lzw_buf_t to the given size in bytes.

To store objects into the lzw_buf_t, call _lzw_buf_store_bits and
when finished, call _lzw_buf_store_pending, (which flushes out the
last few bits that hadn't yet made a complete byte yet).

Instead of returning failure from any functions, lzw_buf_t provides
a status value that the caller can query, (and should query at
least once when done with the object). The status value will be
either %CAIRO_STATUS_SUCCESS or %CAIRO_STATUS_NO_MEMORY.
An lzw_buf_t is a simple growable chunk of memory for holding variable - size objects of up to 16 bits each . Initialize an lzw_buf_t to the given size in bytes . To store objects into the lzw_buf_t call _lzw_buf_store_bits and when finished call _lzw_buf_store_pending ( which flushes out the last few bits that hadn ' t yet made a complete byte yet ) . Instead of returning failure from any functions lzw_buf_t provides a status value that the caller can query ( and should query at least once when done with the object ) . The status value will be either %CAIRO_STATUS_SUCCESS or %CAIRO_STATUS_NO_MEMORY .
static void
_lzw_buf_init (lzw_buf_t *buf, int size)
{
    if (size == 0)
	size = 16;
    buf->status = CAIRO_STATUS_SUCCESS;
    buf->data_size = size;
    buf->num_data = 0;
    buf->pending = 0;
    buf->pending_bits = 0;
    buf->data = _cairo_malloc (size);
    if (unlikely (buf->data == NULL)) {
	buf->data_size = 0;
	buf->status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
	return;
    }
}
static void _lzw_buf_init ( lzw_buf_t * buf , int size ) { if ( size == 0 ) size = 16 ; buf -> status = CAIRO_STATUS_SUCCESS ; buf -> data_size = size ; buf -> num_data = 0 ; buf -> pending = 0 ; buf -> pending_bits = 0 ; buf -> data = _cairo_malloc ( size ) ; if ( unlikely ( buf -> data == NULL ) ) { buf -> data_size = 0 ; buf -> status = _cairo_error ( CAIRO_STATUS_NO_MEMORY ) ; return ; } }
An lzw_buf_t is a simple, growable chunk of memory for holding
 variable-size objects of up to 16 bits each.
An lzw_buf_t is a simple growable chunk of memory for holding variable - size objects of up to 16 bits each .