summaryrefslogtreecommitdiffstats
path: root/lib/stream.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-08-22 02:06:27 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-08-22 13:58:54 +0200
commit4388866917c8766832346c6fddceb86ec7e34a19 (patch)
tree5a81b13c0a490110efb642508259b8f35dec8e44 /lib/stream.h
parentMerge pull request #2818 from kssoman/rmap_fix (diff)
downloadfrr-4388866917c8766832346c6fddceb86ec7e34a19.tar.xz
frr-4388866917c8766832346c6fddceb86ec7e34a19.zip
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.h')
-rw-r--r--lib/stream.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/stream.h b/lib/stream.h
index e808f039c..e8cd76362 100644
--- a/lib/stream.h
+++ b/lib/stream.h
@@ -154,7 +154,14 @@ extern struct stream *stream_new(size_t);
extern void stream_free(struct stream *);
extern struct stream *stream_copy(struct stream *, struct stream *src);
extern struct stream *stream_dup(struct stream *);
-extern size_t stream_resize(struct stream *, size_t);
+
+#if CONFDATE > 20190821
+CPP_NOTICE("lib: time to remove stream_resize_orig")
+#endif
+extern size_t stream_resize_orig(struct stream *s, size_t newsize);
+#define stream_resize stream_resize_orig
+extern size_t stream_resize_inplace(struct stream **sptr, size_t newsize);
+
extern size_t stream_get_getp(struct stream *);
extern size_t stream_get_endp(struct stream *);
extern size_t stream_get_size(struct stream *);