mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-10-30 02:13:18 -06:00
added methods for accessing the last element of a buffer in libgu
This commit is contained in:
1 parent
6fb17dc6fc
commit
a6b4212264
1 file changed
+6
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user