2 ms·
Can someone explain the "restartable function" aspect of the proposal? I'm not familiar with that term and I don't see an explanation in the proposal or blog.
by carom 2y ago
Can someone explain the "restartable function" aspect of the proposal? I'm not familiar with that term and I don't see an explanation in the proposal or blog.
- leni536 2y agoI believe it refers to the mbstate_t* function parameter. It handles chunked transcoding, where chunk boundaries can be in the middle of multi-byte characters. You can than carry this state from one chunk to the next.
- wrs 2y agoThe word “restartable” for C stdlib string functions means the function can return an intermediate answer or error in mid-string, and you can then continue processing the rest of the string. For example, returning a byte count or pointer to where it left off, which you can pass back in. In this case I think the mbstate_t handles that.
- o11c 2y agoIt might also refer to the fact that it's not an error if you're lead with a leading byte at the end of the current buffer if you're planning to stream more still.