Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
e4f133de
Commit
e4f133de
authored
Sep 06, 1999
by
Michael Graff
Browse files
Add isc_buffer_usedcount() and availablecount() -- which should become macros
parent
c520793f
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/isc/buffer.c
View file @
e4f133de
...
...
@@ -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
)
{
...
...
lib/isc/include/isc/buffer.h
View file @
e4f133de
...
...
@@ -141,8 +141,6 @@ struct isc_buffer {
isc_mem_t
*
mctx
;
};
typedef
ISC_LIST
(
isc_buffer_t
)
isc_bufferlist_t
;
/***
*** Functions
***/
...
...
@@ -248,6 +246,16 @@ isc_buffer_used(isc_buffer_t *b, isc_region_t *r);
* 'r' points to a region structure.
*/
unsigned
int
isc_buffer_usedcount
(
isc_buffer_t
*
b
);
/*
* Return the size of the used region of buffer 'b'
*
* Requires:
*
* 'b' is a valid buffer.
*/
void
isc_buffer_available
(
isc_buffer_t
*
b
,
isc_region_t
*
r
);
/*
...
...
@@ -260,6 +268,16 @@ isc_buffer_available(isc_buffer_t *b, isc_region_t *r);
* 'r' points to a region structure.
*/
unsigned
int
isc_buffer_availablecount
(
isc_buffer_t
*
b
);
/*
* Return the size of the available region of buffer 'b'
*
* Requires:
*
* 'b' is a valid buffer.
*/
void
isc_buffer_add
(
isc_buffer_t
*
b
,
unsigned
int
n
);
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment