Skip to content
GitLab
Menu
Projects
Groups
Snippets
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
8a21ac0f
Commit
8a21ac0f
authored
Dec 13, 1999
by
Mark Andrews
Browse files
Add isc_buffer_putstr().
parent
e8cf926e
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/isc/buffer.c
View file @
8a21ac0f
...
...
@@ -397,6 +397,23 @@ isc_buffer_putmem(isc_buffer_t *b, unsigned char *base, unsigned int length)
b
->
used
+=
length
;
}
isc_result_t
isc_buffer_putstr
(
isc_buffer_t
*
b
,
const
char
*
source
)
{
unsigned
int
l
;
isc_region_t
region
;
REQUIRE
(
ISC_BUFFER_VALID
(
b
));
REQUIRE
(
source
!=
NULL
);
l
=
strlen
(
source
);
if
(
l
>
(
b
->
length
-
b
->
used
))
return
(
ISC_R_NOSPACE
);
memcpy
(
b
->
base
+
b
->
used
,
source
,
l
);
b
->
used
+=
l
;
return
(
ISC_R_SUCCESS
);
}
isc_result_t
isc_buffer_copyregion
(
isc_buffer_t
*
b
,
isc_region_t
*
r
)
{
unsigned
char
*
base
;
...
...
lib/isc/include/isc/buffer.h
View file @
8a21ac0f
...
...
@@ -549,6 +549,18 @@ isc_buffer_putmem(isc_buffer_t *b, unsigned char *base, unsigned int length);
*
* 'base' points to 'length' bytes of valid memory.
*
*/
isc_result_t
isc_buffer_putstr
(
isc_buffer_t
*
b
,
const
char
*
source
);
/*
* Copy 'length' bytes of memory at 'base' into 'b'.
*
* Requires:
* 'b' is a valid buffer.
*
* 'source' to be a valid NULL terminated string.
*
* Returns:
*
* ISC_R_SUCCESS
...
...
Write
Preview
Supports
Markdown
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