I'm the author of libb64[1], which (ab)uses the switch statement in a similar way to implement a base64 encoder and decoder.
This was inspired in turn by "Coroutines in C"[2], written by Simon Tatham.
[1] http://libb64.sourceforge.net
[2] http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html