aboutsummaryrefslogtreecommitdiff
path: root/buffer.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-04-03 15:12:44 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-03 21:38:05 +0200
commit7a39508120192d2651aba5387054d3bbcd15a96c (patch)
tree4fba5caa2eacde6a8889ca858badcfd9fbaa2ab0 /buffer.h
parentd22d0cd31133c73366d65e38cddc3cf0f9a02918 (diff)
downloadvis-7a39508120192d2651aba5387054d3bbcd15a96c.tar.gz
vis-7a39508120192d2651aba5387054d3bbcd15a96c.tar.xz
buffer: add buffer_content0 utility function
Diffstat (limited to 'buffer.h')
-rw-r--r--buffer.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/buffer.h b/buffer.h
index cef75f3..1c9f684 100644
--- a/buffer.h
+++ b/buffer.h
@@ -42,6 +42,9 @@ bool buffer_prepend0(Buffer*, const char *data);
size_t buffer_length0(Buffer*);
/* return length of a buffer including possible NUL byte */
size_t buffer_length(Buffer*);
+/* pointer to buffer data, guaranteed to return a NUL terminated
+ * string even if buffer is empty */
+const char *buffer_content0(Buffer*);
/* pointer to buffer data, might be NULL if empty, might not be NUL terminated */
const char *buffer_content(Buffer*);