aboutsummaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/strbuf.c b/strbuf.c
index 6ed62c51..c2b9a2bf 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,5 +1,7 @@
#include "strbuf.h"
+#include <iostream>
+
#include <string.h>
#include <stdio.h>
@@ -60,7 +62,8 @@ int strbuf_cap(strbuf* s) {
/*
* TODO check memmory usage
*/
- return strbuf_append(s, 0);
+ int retval = strbuf_append(s, 0);
+ return retval;
}
// int DEEP_COPY(strbuf)(strbuf* dest, strbuf* src) {
@@ -164,3 +167,8 @@ FMT_F(strbuf) {
int SIZE(strbuf)(strbuf* self) {
return self->len;
}
+
+std::ostream& operator<<(std::ostream& os, strbuf& str) {
+ os << str.mem;
+ return os;
+}