void string_slice_from_offset(StringSlice *instance, const StringSliceOffset *offset, const char *source)
Build a string slice from the source string and offsets.
Definition slice.c:29
void string_slice_to_offset(const StringSlice *instance, StringSliceOffset *offset, const char *source)
Get the offsets from a string slice.
Definition slice.c:11
void string_slice_reset(StringSlice *instance)
Reset the slice so that it represents a valid empty string.
Definition slice.c:5
char * string_slice_to_owned_cstr(const StringSlice *instance)
Copy the slice to a zero-terminated owned string.
Definition slice.c:45
Slice of a character string.
Definition slice.h:16
size_t length
Slice length, in bytes.
Definition slice.h:18
const char * first_char
The beginning of the slice.
Definition slice.h:17
Offsets in a string slice.
Definition slice.h:26
size_t start
Offset of the slice's beginning
Definition slice.h:27
size_t end
Offset of the slice's end.
Definition slice.h:28