void (*close) PARAMS ((serial_t));
int (*readchar) PARAMS ((serial_t, int timeout));
int (*write) PARAMS ((serial_t, const char *str, int len));
+ /* Discard pending output */
int (*flush_output) PARAMS ((serial_t));
+ /* Discard pending input */
int (*flush_input) PARAMS ((serial_t));
int (*send_break) PARAMS ((serial_t));
void (*go_raw) PARAMS ((serial_t));
PARAMS ((serial_t, serial_ttystate, serial_ttystate));
int (*setbaudrate) PARAMS ((serial_t, int rate));
int (*setstopbits) PARAMS ((serial_t, int num));
+ /* Wait for output to drain */
+ int (*drain_output) PARAMS ((serial_t));
};
/* Add a new serial interface to the interface list */
#define SERIAL_FDOPEN(FD) serial_fdopen(FD)
-/* Flush pending output. Might also flush input (if this system can't flush
+/* Allow pending output to drain. */
+
+#define SERIAL_DRAIN_OUTPUT(SERIAL_T) \
+ ((SERIAL_T)->ops->drain_output((SERIAL_T)))
+
+/* Flush (discard) pending output. Might also flush input (if this system can't flush
only output). */
#define SERIAL_FLUSH_OUTPUT(SERIAL_T) \