State machines in C

前端 未结 9 1723
一整个雨季
一整个雨季 2021-01-30 07:34

What is the best way to write a state machine in C?
I usually write a big switch-case statement in a for(;;), with callbacks to re-enter the state machine when an external

9条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 08:18

    Have a look here: http://code.google.com/p/fwprofile/

    It's an open source version (GNU GPLv3) of the state machine implemented in C. The concept and implementation is well-suited for use in mission-critical applications. There are deployments in industrial applications.

提交回复
热议问题