pub unsafe extern "C" fn aws_byte_cursor_split_on_char(
    input_str: *const aws_byte_cursor,
    split_on: c_char,
    output: *mut aws_array_list
) -> c_int
Expand description

No copies, no buffer allocations. Fills in output with a list of aws_byte_cursor instances where buffer is an offset into the input_str and len is the length of that string in the original buffer.

Edge case rules are as follows: if the input begins with split_on, an empty cursor will be the first entry in output. if the input has two adjacent split_on tokens, an empty cursor will be inserted into the output. if the input ends with split_on, an empty cursor will be appended to the output.

It is the user’s responsibility to properly initialize output. Recommended number of preallocated elements from output is your most likely guess for the upper bound of the number of elements resulting from the split.

The type that will be stored in output is struct aws_byte_cursor (you’ll need this for the item size param).

It is the user’s responsibility to make sure the input buffer stays in memory long enough to use the results.