2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 00:55:24 +00:00

Add isc_buffer_usedcount() and availablecount() -- which should become macros

This commit is contained in:
Michael Graff
1999-09-06 04:45:13 +00:00
parent c520793fb9
commit e4f133deed
2 changed files with 35 additions and 2 deletions

View File

@@ -104,6 +104,14 @@ isc_buffer_used(isc_buffer_t *b, isc_region_t *r) {
r->length = b->used;
}
unsigned int
isc_buffer_usedcount(isc_buffer_t *b)
{
REQUIRE(VALID_BUFFER(b));
return (b->used);
}
void
isc_buffer_available(isc_buffer_t *b, isc_region_t *r) {
/*
@@ -117,6 +125,13 @@ isc_buffer_available(isc_buffer_t *b, isc_region_t *r) {
r->length = b->length - b->used;
}
unsigned int
isc_buffer_availablecount(isc_buffer_t *b)
{
REQUIRE(VALID_BUFFER(b));
return (b->length - b->used);
}
void
isc_buffer_add(isc_buffer_t *b, unsigned int n) {