Commit d9a39361 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remove deprecated VSB_new() and VSB_delete()

parent 7b722799
......@@ -54,6 +54,7 @@
* binary/load-time compatible, increment MAJOR version
*
* NEXT (2021-09-15)
* VSB_new() and VSB_delete() removed
* VCL_STRINGLIST, vrt_magic_string_end removed
* VRT_String(), VRT_StringList(), VRT_CollectString() removed
* VRT_CollectStrands() renamed to VRT_STRANDS_string()
......
......@@ -59,7 +59,6 @@ extern "C" {
/*
* API functions
*/
struct vsb *VSB_new(struct vsb *, char *, int, int) v_deprecated_;
struct vsb *VSB_init(struct vsb *, void *, ssize_t);
struct vsb *VSB_new_auto(void);
void VSB_clear(struct vsb *);
......@@ -76,7 +75,6 @@ int VSB_error(const struct vsb *);
int VSB_finish(struct vsb *);
char *VSB_data(const struct vsb *);
ssize_t VSB_len(const struct vsb *);
void VSB_delete(struct vsb *) v_deprecated_;
void VSB_fini(struct vsb *);
void VSB_destroy(struct vsb **);
......
......@@ -208,35 +208,6 @@ VSB_newbuf(struct vsb *s, char *buf, int length, int flags)
return (s);
}
/*
* Initialize an vsb.
* If buf is non-NULL, it points to a static or already-allocated string
* big enough to hold at least length characters.
*/
struct vsb *
VSB_new(struct vsb *s, char *buf, int length, int flags)
{
KASSERT(length >= 0,
("attempt to create an vsb of negative length (%d)", length));
KASSERT((flags & ~VSB_USRFLAGMSK) == 0,
("%s called with invalid flags", __func__));
flags &= VSB_USRFLAGMSK;
if (s != NULL)
return (VSB_newbuf(s, buf, length, flags));
s = SBMALLOC(sizeof(*s));
if (s == NULL)
return (NULL);
if (VSB_newbuf(s, buf, length, flags) == NULL) {
SBFREE(s);
return (NULL);
}
VSB_SETFLAG(s, VSB_DYNSTRUCT);
return (s);
}
struct vsb *
VSB_init(struct vsb *s, void *buf, ssize_t length)
{
......@@ -510,25 +481,6 @@ VSB_len(const struct vsb *s)
return (s->s_len);
}
/*
* Clear an vsb, free its buffer if necessary.
*/
void
VSB_delete(struct vsb *s)
{
int isdyn;
assert_VSB_integrity(s);
/* don't care if it's finished or not */
if (VSB_ISDYNAMIC(s))
SBFREE(s->s_buf);
isdyn = VSB_ISDYNSTRUCT(s);
memset(s, 0, sizeof(*s));
if (isdyn)
SBFREE(s);
}
void
VSB_fini(struct vsb *s)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment