+static inline void buffer_add(buffer_t *buf, const void *data, ssize_t len) {
+ buffer_ensure(buf, len);
+ memcpy(buf->data + buf->len, data, len);
+ buf->len += len;
+ buf->data[buf->len] = '\0';
+}
+static inline void buffer_addstr(buffer_t *buf, const char *s) {
+ buffer_add(buf, s, m_strlen(s));
+}
+static inline void buffer_addbuf(buffer_t *buf, buffer_t *buf2) {
+ buffer_add(buf, buf2->data, buf2->len);
+}
+static inline void buffer_addch(buffer_t *buf, int c) {
+ buffer_extendch(buf, 1, c);
+}
+
+static inline void buffer_reset(buffer_t *buf) {
+ if (buf->len) {
+ buf->len = 0;
+ buf->data[0] = '\0';
+ }
+}
+
+void buffer_splice(buffer_t *, ssize_t pos, ssize_t len, const void *, ssize_t);
+
+ssize_t buffer_addvf(buffer_t *buf, const char *fmt, va_list)
+ __attribute__((format(printf, 2, 0)));
+
+ssize_t buffer_addf(buffer_t *buf, const char *fmt, ...)
+ __attribute__((format(printf, 2, 3)));
+
+
+/****** LEGACY BUFFERS *******/
+