Simple Finite State Machines in C

I was having discussion about State Machines with one of my friend, regarding pro’s and con’s of implementing programs as Sate Machines, it was then that i realised there is no simple way to implement programs as Finite State Machines, so here is a very basic implementation of FSM in C github repo

file: fsm.h contains the function definition for our FSM

file: fsm.c contains the function implementation for our FSM

file: main.c contains an example on how this FSM can be used

PS - If you are reading this post on a blog aggregator like planet you can view full post here

UPDATE - check out the github repo for latest code

Published: April 04 2010

  • category:
blog comments powered by Disqus