| 19 |
#include "common.h" |
#include "common.h" |
| 20 |
#include <stdio.h> |
#include <stdio.h> |
| 21 |
#include <stdarg.h> |
#include <stdarg.h> |
| 22 |
|
#include <sys/ioctl.h> |
| 23 |
|
|
| 24 |
int |
int |
| 25 |
outc(char c) |
outc(char c) |
| 64 |
|
|
| 65 |
if (pos >= len) |
if (pos >= len) |
| 66 |
{ |
{ |
|
len = s_receive (socket_client, buf, 255, ""); |
|
| 67 |
pos = 0; |
pos = 0; |
| 68 |
|
|
| 69 |
|
//len = s_receive (socket_client, buf, 255, ""); |
| 70 |
|
len = read (0, buf, 255); |
| 71 |
|
|
| 72 |
//For debug |
//For debug |
| 73 |
//for (j = 0; j < len; j++) |
//for (j = 0; j < len; j++) |
| 74 |
// log_std ("<--[%u]\n", (buf[j] + 256) % 256); |
// log_std ("<--[%u]\n", (buf[j] + 256) % 256); |
| 161 |
case 49: |
case 49: |
| 162 |
out = KEY_HOME; |
out = KEY_HOME; |
| 163 |
break; |
break; |
| 164 |
|
case 51: |
| 165 |
|
out = KEY_DEL; |
| 166 |
|
break; |
| 167 |
case 52: |
case 52: |
| 168 |
out = KEY_END; |
out = KEY_END; |
| 169 |
break; |
break; |
| 188 |
|
|
| 189 |
return out; |
return out; |
| 190 |
} |
} |
| 191 |
|
|
| 192 |
|
int |
| 193 |
|
ikbhit() |
| 194 |
|
{ |
| 195 |
|
int len; |
| 196 |
|
|
| 197 |
|
ioctl (0, FIONREAD, &len); |
| 198 |
|
|
| 199 |
|
return len; |
| 200 |
|
} |