* serial.h: Fix prototye for serial_raw().
[deliverable/binutils-gdb.git] / gdb / serial.h
index 7a5b05b3fca5024de58471de0893f06bb933ff0f..796f2d2b8c5f0179698b76629a62c863454b84e1 100644 (file)
@@ -1,4 +1,4 @@
-/* Remote Serial support interface definitions for GDB, the GNU Debugger.
+/* Remote serial support interface definitions for GDB, the GNU Debugger.
    Copyright 1992 Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -17,46 +17,61 @@ 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.  */
 
-/* Return a sensible default name for a serial device, something which
-   can be used as an argument to serial_open  */
-   
-CONST char *EXFUN(serial_default_name,(void));
+#ifdef HAVE_TERMIO
 
-/* Try to open the serial device "name", return 1 if ok, 0 if not. */
+#include <termios.h>
+#include <unistd.h>
 
-int EXFUN(serial_open,(CONST char *name));
+struct ttystate
+{
+  int flags;                   /* Flags from fcntl F_GETFL */
+  struct termios termios;      /* old tty driver settings */
+};
 
-/* Turn the port into raw mode */
+#else /* not HAVE_TERMIO */
 
-void EXFUN(serial_raw,(void));
+#include <sgtty.h>
 
+struct ttystate {
+  int flags;                   /* Flags from fcntl F_GETFL */
+  struct sgttyb sgttyb;                /* old tty driver settings */
+};
 
-/* Turn the port into normal mode */
+#endif /* not HAVE_TERMIO */
+/* Return a sensible default name for a serial device, something which
+   can be used as an argument to serial_open.  */
+   
+const char *serial_default_name PARAMS ((void));
 
-void EXFUN(serial_normal,(void));
+/* Try to open the serial device "name", return 1 if ok, 0 if not.  */
 
+int serial_open PARAMS ((const char *name));
 
-/* Read one char from the serial device with timeout, return char, and
-   set ok if ok */
+/* Turn the port into raw mode.  */
 
-int EXFUN(serial_timedreadchar,(int to , int *ok));
+void serial_raw PARAMS ((int fd, struct ttystate *oldstate));
 
+/* Turn the port into normal mode.  */
 
-/* Set the baudrate to the value supplied, and return 1, or fail and
-   return 0 */
+void serial_normal PARAMS ((void));
 
-int EXFUN(serial_setbaudrate,(int to));
+/* Read one char from the serial device with <TO>-second timeout.
+   Return char, and set ok if ok.  */
 
-/* Return the next rate in the sequence, or return 0 for a fail*/
+int serial_timedreadchar PARAMS ((int to, int *ok));
 
-int EXFUN(serial_nextbaudrate,(int rate));
+/* Set the baudrate to the decimal value supplied, and return 1, or fail and
+   return 0.  */
 
+int serial_setbaudrate PARAMS ((int rate));
 
-/* Write some chars to the device, return 1 if ok, 0 if not */
+/* Return the next rate in the sequence, or return 0 for failure.  */
 
-int EXFUN(serial_write,( CONST char *str ,  int len));
+/* Write some chars to the device, returns 0 for failure.  See errno for
+   details. */
 
+int serial_write PARAMS ((const char *str, int len));
 
 /* Close the serial port */
 
-int EXFUN(serial_close,(void));
+void serial_close PARAMS ((void));
This page took 0.025737 seconds and 4 git commands to generate.