aboutsummaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-23 21:09:30 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-23 21:09:30 +0100
commit1b71eb8175de976045406035420f62c79a2fc91e (patch)
treea3c5bcd98b50628fbb7ca735bf810f5c30900e3a /strbuf.c
parentEven more work. (diff)
downloadcalp-1b71eb8175de976045406035420f62c79a2fc91e.tar.gz
calp-1b71eb8175de976045406035420f62c79a2fc91e.tar.xz
Vill inte.
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;
+}