| 242 | |
| 243 | |
| 244 | int |
| 245 | FCEUD_SendData(void *data, |
| 246 | uint32 len) |
| 247 | { |
| 248 | int check = 0, error = 0; |
| 249 | #ifndef WIN32 |
| 250 | error = ioctl(fileno(stdin), FIONREAD, &check); |
| 251 | #endif |
| 252 | if(!error && check) { |
| 253 | char buf[1024]; |
| 254 | char *f; |
| 255 | |
| 256 | buf[0] = 0; |
| 257 | |
| 258 | if ( fgets(buf, 1024, stdin) ) |
| 259 | { |
| 260 | if((f=strrchr(buf,'\n'))) { |
| 261 | *f = 0; |
| 262 | } |
| 263 | } |
| 264 | FCEUI_NetplayText((uint8 *)buf); |
| 265 | } |
| 266 | |
| 267 | #ifdef WIN32 |
| 268 | send(s_Socket, (char*)data, len ,0); |
| 269 | #else |
| 270 | send(s_Socket, data, len ,0); |
| 271 | #endif |
| 272 | return 1; |
| 273 | } |
| 274 | |
| 275 | int |
| 276 | FCEUD_RecvData(void *data, |
nothing calls this directly
no test coverage detected