added methods for accessing the last element of a buffer in libgu

This commit is contained in:
krasimir
2016-04-29 14:05:42 +00:00
parent 6cf80c0769
commit 652cd2d297

View File

@@ -124,6 +124,12 @@ gu_buf_extend(GuBuf* buf)
void
gu_buf_pop_n(GuBuf* buf, size_t n_elems, void* data_out);
#define gu_buf_get_last(BUF, T) \
(((T*)gu_buf_data(BUF))[(BUF)->seq->len-1])
#define gu_buf_index_last(BUF, T) \
(&((T*)gu_buf_data(BUF))[(BUF)->seq->len-1])
const void*
gu_buf_trim_n(GuBuf* buf, size_t n_elems);