unsigned int buffer_takedata(buffer_t *buf, unsigned char *ptr,
static unsigned int buffer_takedata(buffer_t *buf, unsigned char *ptr,
unsigned int buffer_takedata(buffer_t *buf, unsigned char *ptr,		unsigned int size){	unsigned int taken = buf->used;	if(taken > size)		taken = size;	if(taken == 0)		return 0;	if(ptr)		memcpy(ptr, buf->data, taken);	buf->used -= taken;	/* Do we have to scroll? */	if(buf->used > 0)		memmove(buf->data, buf->data + taken, buf->used);	return taken;}