
#include "general.H"

typedef struct token_table {
        int code;
        const char *token;
} TOKEN_TABLE;

typedef int X10_ACTION (int housecode, int unit, char **argv);

extern int debug_level;
extern char *program_name;

#define SUCCESS		(0)
// Success false is the return value for successful test with a false value.
#define SUCCESS_FALSE	(1)
#define FAIL_PARSE	(2)
#define FAIL_EXECUTION	(3)
#define FAIL_UNITNEEDED (4)

#define MAPSTATE_READ	(0)
#define	MAPSTATE_READ_TO_WRITE	(1)
#define	MAPSTATE_WRITE	(2)

extern TOKEN_TABLE x10flags [];

extern int get_token (char *command, TOKEN_TABLE *table);
extern int send_command (int housecode, int unit, int command, int count);
extern int mapX10state(int housecode, int unit, struct x10state *state,
			int write = MAPSTATE_READ);

extern X10_ACTION turn;
extern X10_ACTION fade;
extern X10_ACTION x10test;
extern X10_ACTION showunit;
extern X10_ACTION setunit;

