diff options
Diffstat (limited to 'include/stc/cstack.h')
| -rw-r--r-- | include/stc/cstack.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/stc/cstack.h b/include/stc/cstack.h index 87ef9405..84bdb41b 100644 --- a/include/stc/cstack.h +++ b/include/stc/cstack.h @@ -80,6 +80,7 @@ STC_INLINE void _cx_memb(_drop)(_cx_self* self) { i_free(self->data); #endif } + STC_INLINE intptr_t _cx_memb(_size)(const _cx_self* self) { return self->_len; } @@ -187,4 +188,10 @@ STC_INLINE void _cx_memb(_next)(_cx_iter* it) STC_INLINE _cx_iter _cx_memb(_advance)(_cx_iter it, size_t n) { if ((it.ref += n) >= it.end) it.ref = NULL ; return it; } +STC_INLINE intptr_t _cx_memb(_index)(const _cx_self* self, _cx_iter it) + { return (it.ref - self->data); } + +STC_INLINE void _cx_memb(_adjust_end_)(_cx_self* self, intptr_t n) + { self->_len += n; } + #include "priv/template2.h" |
