Add function to get underlying char array of buffer

This commit is contained in:
Wilson Lin 2018-07-05 16:57:11 +12:00
parent d3113c4047
commit c8c78d5365
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}