src/hfsm_stack.c
/*
    Supported transitions limited to the following:
    - peer state transitioning to first-level inner state.
    - super state transitioning to another first-level inner state.
*/
Supported transitions limited to the following:
peer state transitioning to first-level inner state.
super state transitioning to another first-level inner state.
Supported transitions limited to the following : peer state transitioning to first - level inner state . super state transitioning to another first - level inner state .
int hfsm_transition_superstate(
    hfsm* h,
    state_handler source_state,
    state_handler destination_state)
{
  assert(h != NULL);
  assert(h->current_state != NULL);
  assert(source_state != NULL);
  assert(destination_state != NULL);
  int ret;
  ret = _hfsm_recursive_exit(h, source_state);
  if (source_state == h->current_state)
  {
    ret = h->current_state(h, hfsm_exit_event, NULL);
    h->current_state = destination_state;
  }
  return ret;
}
int hfsm_transition_superstate ( hfsm * h , state_handler source_state , state_handler destination_state ) { assert ( h != NULL ) ; assert ( h -> current_state != NULL ) ; assert ( source_state != NULL ) ; assert ( destination_state != NULL ) ; int ret ; ret = _hfsm_recursive_exit ( h , source_state ) ; if ( source_state == h -> current_state ) { ret = h -> current_state ( h , hfsm_exit_event , NULL ) ; h -> current_state = destination_state ; } return ret ; }
Supported transitions limited to the following:
 peer state transitioning to first-level inner state.
Supported transitions limited to the following : peer state transitioning to first - level inner state .
// Super-state handler making a transition must exit all inner states: // Transitions to super states will exit the substate but not enter the superstate again: