#include
struct TableState ;
struct TableFSM
{
int (*GetBottleStatus)( struct TableFSM *fsm, void * o );
int (*PutBottleStatus)( struct TableFSM *fsm, void * o );
void (*changeState)( struct TableFSM *fsm, struct TableState *nextState );
struct TableState *m_state;
};
struct TableState
{
int (*GetBottleStatus)( struct TableFSM *fsm, void * o );
int (*PutBottleStatus)( struct TableFSM *fsm, void * o );
};
static struct TableState TableFull;
static struct TableState TableEmpty;
void GetBottle()
{
printf("You get a bottle/n");
}
void GiveBottle()
{
printf("You put bottle on the table/n");
}
void NoBottle()
{
printf("There is no bottle on the table/n");