diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-08-21 20:06:27 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-08-22 07:58:54 -0400 | 
| commit | 4388866917c8766832346c6fddceb86ec7e34a19 (patch) | |
| tree | 5a81b13c0a490110efb642508259b8f35dec8e44 /lib/stream.c | |
| parent | dca5ef30533ab2a7a5573f065537e7a05067bec7 (diff) | |
lib: Add stream_resize_orig and stream_resize_inplace
Start setup for handling of stream_resize into old
and new functions.
Create a stream_resize_inplace function that takes
a double pointer to allow for a realloc operation
to return the possibly moved pointer.
Add a CONFDATE for removal as well.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/stream.c')
| -rw-r--r-- | lib/stream.c | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/stream.c b/lib/stream.c index cf9af4d3bb..50ee9a5d56 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -166,7 +166,12 @@ struct stream *stream_dupcat(struct stream *s1, struct stream *s2,  	return new;  } -size_t stream_resize(struct stream *s, size_t newsize) +size_t stream_resize_inplace(struct stream **sptr, size_t newsize) +{ +	return stream_resize_orig(*sptr, newsize); +} + +size_t stream_resize_orig(struct stream *s, size_t newsize)  {  	uint8_t *newdata;  	STREAM_VERIFY_SANE(s);  | 
