title: State machines in C
body: <p>What is the best way to write a state machine in C?<br />
  I usually write a big switch-case statement in a for(;;), with callbacks to re-enter the state machine when an external operation is finished.<br />
  Do you know a more efficient way?</p>