From c8c78d5365a19d5e4e2a3625c751a5eb6b4820b2 Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Thu, 5 Jul 2018 16:57:11 +1200 Subject: [PATCH] Add function to get underlying char array of buffer --- src/main/c/util/buffer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/c/util/buffer.c b/src/main/c/util/buffer.c index 29eb721..388f635 100644 --- a/src/main/c/util/buffer.c +++ b/src/main/c/util/buffer.c @@ -27,6 +27,10 @@ void hbu_buffer_destroy(hbu_buffer_t buf) { free(buf); } +hb_char_t *hbu_buffer_underlying(hbu_buffer_t buf) { + return buf->data; +} + int hbu_buffer_valid_index(hbu_buffer_t buf, size_t idx) { return idx >= 0 && idx < buf->length; }