diff options
| -rw-r--r-- | buffer.c | 4 | ||||
| -rw-r--r-- | buffer.h | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -99,3 +99,7 @@ size_t buffer_length0(Buffer *buf) { size_t buffer_length(Buffer *buf) { return buf->len; } + +const char *buffer_content(Buffer *buf) { + return buf->data; +} @@ -42,5 +42,7 @@ 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, might be NULL if empty, might not be NUL terminated */ +const char *buffer_content(Buffer*); #endif |
