Replacing a bogus file with a semi-bogus one (sharing through devo).
[deliverable/binutils-gdb.git] / gdb / serial.h
index 8f4222f2ed8276fa2de8becf91569ddfefe03adb..04332bcb11fc9c5cad42e5d86945b64bf76f75c8 100644 (file)
@@ -15,7 +15,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifndef SERIAL_H
 #define SERIAL_H
@@ -43,8 +43,6 @@ struct _serial_t
 
 typedef struct _serial_t *serial_t;
 
-serial_t scb_base;             /* Pointer to list of scb's */
-
 struct serial_ops {
   char *name;
   struct serial_ops *next;
@@ -52,7 +50,9 @@ struct serial_ops {
   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));
@@ -63,6 +63,8 @@ struct serial_ops {
     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 */
@@ -85,7 +87,12 @@ serial_t serial_fdopen PARAMS ((const int fd));
 
 #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) \
@@ -99,8 +106,9 @@ serial_t serial_fdopen PARAMS ((const int fd));
 
 /* 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. */
 
@@ -138,7 +146,9 @@ serial_t serial_fdopen PARAMS ((const int fd));
 #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.  */
@@ -157,17 +167,25 @@ serial_t serial_fdopen PARAMS ((const int fd));
 /* 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));
+extern void serial_close PARAMS ((serial_t, int));
+
+#define SERIAL_CLOSE(SERIAL_T) serial_close(SERIAL_T, 1)
+
+/* Push out all buffers and destroy SERIAL_T without closing the device.  */
+
+#define SERIAL_UN_FDOPEN(SERIAL_T) serial_close(SERIAL_T, 0)
 
-#define SERIAL_CLOSE(SERIAL_T) serial_close(SERIAL_T)
+extern void serial_printf PARAMS ((serial_t desc, const char *, ...))
+     ATTR_FORMAT(printf, 2, 3);
 
-/* Destroy SERIAL_T without doing the rest of the stuff that SERIAL_CLOSE
-   does.  */
+/* File in which to record the remote debugging session */
 
-#define SERIAL_UN_FDOPEN(SERIAL_T) (free (SERIAL_T))
+extern void serial_log_command PARAMS ((const char *));
 
 #endif /* SERIAL_H */
This page took 0.024735 seconds and 4 git commands to generate.