Coroutines
Jason posted in Uncategorized on June 8th, 2006
PuTTY, like a lot of other terminal software, has to interpret a lot of funny grammars and syntaxes in its input. The problem of how to do this clearly and maintainably in C is still an open problem which has no widely accepted solution.
The authors of PuTTY, however, came up with one I haven’t seen before: using the C preprocessor to break down the barriers between two cooperating functions which process grammar in their inputs.



Leave a Response