There are two steps required to implement command processing:
The main command function needs to be changed to update the appropriate application variable and return.
The main command function may make one or more function calls beyond setting application variables, but does not require user interaction. Setting up state functions is not required. Utility commands may do database access such as scanning the design file for specified elements. The stub function would typically have one top-level function call which in turn breaks down into several other compact, modular routines.
The main command function for primitive commands must set up the state machine to handle events such as data points, resets, and element selection. Do this by calling one or more of the mdlState_... or mdlDynamic_... routines. This implies that routines to handle the "state transitions" need to be coded.