diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-23 21:09:30 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-23 21:09:30 +0100 |
commit | 1b71eb8175de976045406035420f62c79a2fc91e (patch) | |
tree | a3c5bcd98b50628fbb7ca735bf810f5c30900e3a /strbuf.c | |
parent | Even more work. (diff) | |
download | calp-1b71eb8175de976045406035420f62c79a2fc91e.tar.gz calp-1b71eb8175de976045406035420f62c79a2fc91e.tar.xz |
Vill inte.
Diffstat (limited to 'strbuf.c')
-rw-r--r-- | strbuf.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; +} |