[Previous] [Contents] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

pmm_state_t

Represent a particular state machine

Synopsis:

typedef struct {
   unsigned state;
   int (*enter)(void *data, unsigned old_state, unsigned
                                             new_state);
   int  (*leave)(void *data, unsigned old_state, unsigned
                                              new_state);
   unsigned (*check)(void *data, unsigned cur_state);
} pmm_state_t;

Description:

The pmm_state_t structure represents a particular state machine:

state
Implementation specific value that identifies this state.

The library attaches no meaning to this value, and only requires that the state value for all states within a single state machine are unique.

enter
Function that will be called when entering this state.
leave
Function that will be called when leaving this state.
check
Evaluate whether a state change is necessary.

A check() function must be defined for each pmm_state_t in a state machine.

Classification:

See also:


[Previous] [Contents] [Next]