diff options
Diffstat (limited to 'src/runtime/c/gu')
| -rw-r--r-- | src/runtime/c/gu/seq.c | 6 | ||||
| -rw-r--r-- | src/runtime/c/gu/seq.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/c/gu/seq.c b/src/runtime/c/gu/seq.c index 2c3d6c3e3..2b99df318 100644 --- a/src/runtime/c/gu/seq.c +++ b/src/runtime/c/gu/seq.c @@ -136,6 +136,12 @@ gu_buf_data(GuBuf* buf) return &buf->seq->data; } +void* +gu_buf_last(GuBuf* buf) +{ + return buf->seq->data + buf->elem_size*(buf->seq->len-1); +} + GuSeq* gu_buf_data_seq(GuBuf* buf) { diff --git a/src/runtime/c/gu/seq.h b/src/runtime/c/gu/seq.h index 5accb0b24..034620140 100644 --- a/src/runtime/c/gu/seq.h +++ b/src/runtime/c/gu/seq.h @@ -65,6 +65,9 @@ gu_buf_avail(GuBuf* buf); void* gu_buf_data(GuBuf* buf); +void* +gu_buf_last(GuBuf* buf); + GuSeq* gu_buf_data_seq(GuBuf* buf); |
