00001 #include "white_interface.h"
00002
00019 char *strchr(const char *s, int c);
00020
00028 int sscanf(const char *s, const char *format, ...);
00029
00030 #define TRUE 1
00031 #define FALSE 0
00032
00033
00039 int is_move(char *str)
00040 {
00041 if (*str == 'm')
00042 return TRUE;
00043 else
00044 return FALSE;
00045 }
00046
00053 int is_button(char *str)
00054 {
00055 if (*str == 'b')
00056 return TRUE;
00057 else
00058 return FALSE;
00059 }
00060
00065
00066 void poin_entry_Init()
00067 {
00068 }
00069
00074
00075 void poin_entry_Run()
00076 {
00077 char *comma;
00078 char *input;
00079 move m;
00080 button b;
00081 int player, x1, y1, x2, y2, button_no;
00082
00083 if (in_Enabled())
00084 {
00085 input = in_Value();
00086
00087 comma = strchr(input, ',');
00088
00089
00090
00091
00092
00093
00094 if (is_move(input))
00095 {
00096 sscanf(comma+1, "%d,%d,%d,%d,%d", &player, &x1, &y1, &x2, &y2);
00097 m.player = player;
00098 m.x1 = x1;
00099 m.y1 = y1;
00100 m.x2 = x2;
00101 m.y2 = y2;
00102 move_out_Post(&m);
00103 }
00104
00105
00106
00107
00108 if (is_button(input))
00109 {
00110 sscanf(comma+1, "%d,%d", &player, &button_no);
00111 b.player = player;
00112 b.button_no = button_no;
00113 button_out_Post(&b);
00114 }
00115 }
00116 }
00117