memcpy(ds_put_uninit(ds, s_len), s, s_len);
}
+void
+ds_put_and_free_cstr(struct ds *ds, char *s)
+{
+ ds_put_cstr(ds, s);
+ free(s);
+}
+
void
ds_put_format(struct ds *ds, const char *format, ...)
{
return ds->string;
}
+const char *
+ds_cstr_ro(const struct ds *ds)
+{
+ return ds_cstr((struct ds *) ds);
+}
+
/* Returns a null-terminated string representing the current contents of 'ds',
* which the caller is expected to free with free(), then clears the contents
* of 'ds'. */