We have a single saved character.
We have a single saved character. Return it, go to Start state
We have 2 saved characters.
We have 2 saved characters. They must be a LF, then the next character. Return the LF and go to state Buf1.
Done.
Done. Always return -1, stay in state Done
Read another character and if LF go to state GotCRLF.
Read another character and if SP/TAB then what we do depends on IMF or iCalendar mode.
Read another character and if SP/TAB then what we do depends on IMF or iCalendar mode.
In iCalendar mode we just goto Start, and iterate again. effectively absorbing all the CR, LF, and the sp/tab.
In IMF mode we change state to Start, but we return the sp/tab so that we've effectively absorbed the CRLF, but not the space/tab character.
No state.
No state. Read a character, and if CR, go to state GotCR.