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
e5b0c46f
Commit
e5b0c46f
authored
Oct 29, 1999
by
Andreas Gustafsson
Browse files
added isc_buffer_putmem()
parent
4ed0c326
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/isc/buffer.c
View file @
e5b0c46f
...
...
@@ -384,6 +384,19 @@ isc_buffer_putuint32(isc_buffer_t *b, isc_uint32_t val)
cp
[
3
]
=
(
unsigned
char
)(
val
&
0x000000ff
);
}
void
isc_buffer_putmem
(
isc_buffer_t
*
b
,
unsigned
char
*
base
,
unsigned
int
length
)
{
unsigned
char
*
cp
;
REQUIRE
(
ISC_BUFFER_VALID
(
b
));
REQUIRE
(
b
->
used
+
length
<=
b
->
length
);
cp
=
b
->
base
+
b
->
used
;
memcpy
(
cp
,
base
,
length
);
b
->
used
+=
length
;
}
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 @
e5b0c46f
...
...
@@ -539,6 +539,23 @@ isc_buffer_putuint32(isc_buffer_t *b, isc_uint32_t val);
* The used pointer in 'b' is advanced by 4.
*/
void
isc_buffer_putmem
(
isc_buffer_t
*
b
,
unsigned
char
*
base
,
unsigned
int
length
);
/*
* Copy 'length' bytes of memory at 'base' into 'b'.
*
* Requires:
* 'b' is a valid buffer.
*
* 'base' points to 'length' bytes of valid memory.
*
* Returns:
*
* ISC_R_SUCCESS
* ISC_R_NOSPACE The available region of 'b' is not
* big enough.
*/
isc_result_t
isc_buffer_copyregion
(
isc_buffer_t
*
b
,
isc_region_t
*
r
);
/*
...
...
@@ -556,6 +573,7 @@ isc_buffer_copyregion(isc_buffer_t *b, isc_region_t *r);
* big enough.
*/
ISC_LANG_ENDDECLS
#endif
/* ISC_BUFFER_H */
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