Logo Search packages:      
Sourcecode: randomsound version File versions  Download package

BitBuffer bitbuffer_new ( const int  size )

Allocate a new bitbuffer.

Given the size requested, create a new bit buffer which can store that number of bits and return it having initialised it properly.

Parameters:
sizeThe number of bits to store in this buffer.
Returns:
The new BitBuffer

Definition at line 27 of file bitbuffer.c.

{
  int bytesize = ((size + 7) & ~7) >> 3;
  BitBuffer ret = (BitBuffer)(malloc(sizeof(struct bitbuffer_s) + bytesize));
  ret->size = size;
  ret->firstused = 0;
  ret->nextfree = 0;
  ret->bitsused = 0;
  return ret;
}

Generated by  Doxygen 1.6.0   Back to index