Hacker News new | past | comments | ask | show | jobs | submit login
5 Years Later: The First Win (thephd.dev)
46 points by todsacerdoti 3 months ago | hide | past | favorite | 4 comments



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.


The 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.


It 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.


I 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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: