MCPcopy Create free account
hub / github.com/TASEmulators/fceux / FCEUD_SendData

Function FCEUD_SendData

src/drivers/sdl/unix-netplay.cpp:244–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242
243
244int
245FCEUD_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
275int
276FCEUD_RecvData(void *data,

Callers

nothing calls this directly

Calls 1

FCEUI_NetplayTextFunction · 0.85

Tested by

no test coverage detected