rcx

library of miscellaneous bits of C code
git clone git://git.rr3.xyz/rcx
Log | Files | Refs | README | LICENSE

commit c8ea3d1bfdb6af4c8c26c5a44c4a54f3a116cdae
parent c49d12ecdb15a8bf968cc04eb2c68aa9ab96f943
Author: Robert Russell <robertrussell.72001@gmail.com>
Date:   Wed, 14 Jun 2023 13:41:12 -0700

Add buf_slice_to_end{,_rc_ref}

Diffstat:
Minc/buffer.h | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/inc/buffer.h b/inc/buffer.h @@ -102,4 +102,15 @@ buf_drop(Buf b) { #include "string.h" Str buf_slice(Buf b, usize l, usize u); + +static inline Str +buf_slice_to_end(Buf b, usize l) { + return buf_slice(b, l, buf_cap(b)); +} + RcStr buf_slice_rc_ref(Buf b, usize l, usize u); + +static inline RcStr +buf_slice_to_end_rc_ref(Buf b, usize l) { + return buf_slice_rc_ref(b, l, buf_cap(b)); +}