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) \
/* Send a break between 0.25 and 0.5 seconds long. */
-#define SERIAL_SEND_BREAK(SERIAL_T) \
- ((*(SERIAL_T)->ops->send_break) (SERIAL_T))
+extern int serial_send_break PARAMS ((serial_t scb));
+
+#define SERIAL_SEND_BREAK(SERIAL_T) serial_send_break (SERIAL_T)
/* Turn the port into raw mode. */
#define SERIAL_TIMEOUT -2
#define SERIAL_EOF -3
-#define SERIAL_READCHAR(SERIAL_T, TIMEOUT) ((SERIAL_T)->ops->readchar((SERIAL_T), TIMEOUT))
+extern int serial_readchar PARAMS ((serial_t scb, int timeout));
+
+#define SERIAL_READCHAR(SERIAL_T, TIMEOUT) serial_readchar (SERIAL_T, TIMEOUT)
/* Set the baudrate to the decimal value supplied. Returns 0 for success,
-1 for failure. */
/* Write LEN chars from STRING to the port SERIAL_T. Returns 0 for
success, non-zero for failure. */
-#define SERIAL_WRITE(SERIAL_T, STRING, LEN) ((SERIAL_T)->ops->write((SERIAL_T), STRING, LEN))
+extern int serial_write PARAMS ((serial_t scb, const char *str, int len));
+
+#define SERIAL_WRITE(SERIAL_T, STRING,LEN) serial_write (SERIAL_T, STRING, LEN)
/* Push out all buffers, close the device and destroy SERIAL_T. */
-void serial_close PARAMS ((serial_t, int));
+extern void serial_close PARAMS ((serial_t, int));
#define SERIAL_CLOSE(SERIAL_T) serial_close(SERIAL_T, 1)
extern void serial_printf PARAMS ((serial_t desc, const char *, ...))
ATTR_FORMAT(printf, 2, 3);
+/* File in which to record the remote debugging session */
+
+extern void serial_log_command PARAMS ((const char *));
+
#endif /* SERIAL_H */