src/hfsm_stack.c
/*
    Supported transitions limited to the following:
    - peer states (within the same top-level state).
    - super state transitioning to another peer state (all sub-states will exit).
*/
Supported transitions limited to the following:
peer states (within the same top-level state).
super state transitioning to another peer state (all sub-states will exit).
Supported transitions limited to the following : peer states ( within the same top - level state ) . super state transitioning to another peer state ( all sub - states will exit ) .
int hfsm_transition_peer(hfsm* h, state_handler source_state, state_handler destination_state)
{
  assert(h != NULL);
  assert(source_state != NULL);
  assert(destination_state != NULL);
  int ret = 0;
  ret = _hfsm_recursive_exit(h, source_state);
  if (source_state == h->current_state)
  {
    ret = h->current_state(h, hfsm_exit_event, NULL);
    if (!ret)
    {
      h->current_state = destination_state;
      ret = h->current_state(h, hfsm_entry_event, NULL);
    }
  }
  return ret;
}
int hfsm_transition_peer ( hfsm * h , state_handler source_state , state_handler destination_state ) { assert ( h != NULL ) ; assert ( source_state != NULL ) ; assert ( destination_state != NULL ) ; int ret = 0 ; ret = _hfsm_recursive_exit ( h , source_state ) ; if ( source_state == h -> current_state ) { ret = h -> current_state ( h , hfsm_exit_event , NULL ) ; if ( ! ret ) { h -> current_state = destination_state ; ret = h -> current_state ( h , hfsm_entry_event , NULL ) ; } } return ret ; }
Supported transitions limited to the following:
 peer states (within the same top-level state).
Supported transitions limited to the following : peer states ( within the same top - level state ) .
// Super-state handler making a transition must exit all inner states: // Exit the source state. // Enter the destination state: