![]() |
BSB Developer Docs
|
Slice types for various containers. More...
#include <stddef.h>Go to the source code of this file.
Data Structures | |
| struct | StringSlice |
| Slice of a character string. More... | |
| struct | StringSliceOffset |
| Offsets in a string slice. More... | |
Functions | |
| void | string_slice_reset (StringSlice *instance) |
| Reset the slice so that it represents a valid empty string. | |
| void | string_slice_to_offset (const StringSlice *instance, StringSliceOffset *offset, const char *source) |
| Get the offsets from a string slice. | |
| void | string_slice_from_offset (StringSlice *instance, const StringSliceOffset *offset, const char *source) |
| Build a string slice from the source string and offsets. | |
| char * | string_slice_to_owned_cstr (const StringSlice *instance) |
| Copy the slice to a zero-terminated owned string. | |
Slice types for various containers.
| void string_slice_from_offset | ( | StringSlice * | instance, |
| const StringSliceOffset * | offset, | ||
| const char * | source ) |
Build a string slice from the source string and offsets.
| [out] | instance | pointer to the slice to be populated |
| [in] | offset | pointer to the offset structure containing the offsets |
| [in] | source | zero-terminated string that the slice will look into |
| void string_slice_reset | ( | StringSlice * | instance | ) |
Reset the slice so that it represents a valid empty string.
| [in,out] | instance | pointer to the slice to be reset |
| void string_slice_to_offset | ( | const StringSlice * | instance, |
| StringSliceOffset * | offset, | ||
| const char * | source ) |
Get the offsets from a string slice.
| [in] | instance | pointer to the slice to be converted |
| [out] | offset | pointer to the offset structure to hold the results |
| [in] | source | zero-terminated string that the slice looks into |
| char * string_slice_to_owned_cstr | ( | const StringSlice * | instance | ) |
Copy the slice to a zero-terminated owned string.
The caller is responsible to free the return value when it is not needed anymore.
| [in] | instance | pointer to the slice to be copied |
NULL)