Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Latest commit

 

History

History
15 lines (12 loc) · 782 Bytes

README.md

File metadata and controls

15 lines (12 loc) · 782 Bytes

Finite State Machine

The finite state machine (FSM) is an machine that can be in exactly one of a finite number of states at any given time. In these implementations, the machine is represented by the C/C++ function construct.

fsm-struct.c is a implemetation of a FSM where everything is inside of a struct, including the function pointer itself. If you have data, such as a string or integer that is needed, it goes into the struct.

fsm-arg.c is a FSM where you pass data to each function individually. If you have a string or integer to parse through, you have to add it to the function prototypes and definitions.