| 370 | } |
| 371 | |
| 372 | void fxSerialFlush(modTimer timer, void *refcon, int refconSize) |
| 373 | { |
| 374 | xsSerial s = *(xsSerial *)refcon; |
| 375 | |
| 376 | s->flush = NULL; |
| 377 | |
| 378 | int result = write(s->fd, s->toWrite, s->bytesToWrite); |
| 379 | if (result > 0) { |
| 380 | s->toWrite += result; |
| 381 | s->bytesToWrite -= result; |
| 382 | } |
| 383 | |
| 384 | if (s->bytesToWrite) |
| 385 | s->flush = modTimerAdd(0, 0, fxSerialFlush, &s, sizeof(s)); |
| 386 | else if (!s->writable && s->hasOnWritable) |
| 387 | s->writable = modTimerAdd(0, 0, fxSerialWritable, &s, sizeof(s)); |
| 388 | } |
| 389 | |
| 390 | void fxSerialSetFormat(xsMachine *the, xsSerial s, char *format) |
| 391 | { |
nothing calls this directly
no test coverage detected