My state machine implementation for C