we have buffers, add an API to readln directly in a buffer instead of implementing...
[apps/madmutt.git] / lib-lib / buffer.h
index a4d1912..9e919b7 100644 (file)
@@ -86,6 +86,11 @@ static inline void buffer_addch(buffer_t *buf, int c) {
     buffer_extendch(buf, 1, c);
 }
 
+static inline void buffer_reset(buffer_t *buf) {
+    buf->len = 0;
+    buf->data[0] = '\0';
+}
+
 
 /****** LEGACY BUFFERS *******/