version 1.31, 2006/08/03 03:34:41 |
version 1.32, 2010/02/09 03:56:28 |
|
|
/* Returns the number of bytes of data in the buffer. */ |
/* Returns the number of bytes of data in the buffer. */ |
|
|
u_int |
u_int |
buffer_len(Buffer *buffer) |
buffer_len(const Buffer *buffer) |
{ |
{ |
return buffer->end - buffer->offset; |
return buffer->end - buffer->offset; |
} |
} |
|
|
/* Returns a pointer to the first used byte in the buffer. */ |
/* Returns a pointer to the first used byte in the buffer. */ |
|
|
void * |
void * |
buffer_ptr(Buffer *buffer) |
buffer_ptr(const Buffer *buffer) |
{ |
{ |
return buffer->buf + buffer->offset; |
return buffer->buf + buffer->offset; |
} |
} |
|
|
/* Dumps the contents of the buffer to stderr. */ |
/* Dumps the contents of the buffer to stderr. */ |
|
|
void |
void |
buffer_dump(Buffer *buffer) |
buffer_dump(const Buffer *buffer) |
{ |
{ |
u_int i; |
u_int i; |
u_char *ucp = buffer->buf; |
u_char *ucp = buffer->buf; |