Lint: * c-exp.y (parse_number): Avoid shift warning.
[external/binutils.git] / gdb / serial.h
1 /* Remote serial support interface definitions for GDB, the GNU Debugger.
2    Copyright 1992, 1993 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
19
20 #ifdef __GO32__
21
22 /* Then you use the asynctsr */
23
24 struct ttystate {
25         /* No members */
26 };
27
28 #else
29 #ifdef HAVE_TERMIO
30
31 #include <termios.h>
32 #include <unistd.h>
33
34 struct ttystate
35 {
36   int flags;                    /* Flags from fcntl F_GETFL */
37   struct termios termios;       /* old tty driver settings */
38 };
39
40 #else /* not HAVE_TERMIO */
41
42 #include <sgtty.h>
43
44 struct ttystate {
45   int flags;                    /* Flags from fcntl F_GETFL */
46   struct sgttyb sgttyb;         /* old tty driver settings */
47 };
48
49 #endif /* not HAVE_TERMIO */
50 #endif
51 /* Return a sensible default name for a serial device, something which
52    can be used as an argument to serial_open.  */
53    
54 const char *serial_default_name PARAMS ((void));
55
56 /* Try to open the serial device "name", return 1 if ok, 0 if not.  */
57
58 int serial_open PARAMS ((const char *name));
59
60 /* Turn the port into raw mode.  */
61
62 void serial_raw PARAMS ((int fd, struct ttystate *oldstate));
63
64 /* Turn the port into normal mode.  */
65
66 void serial_normal PARAMS ((void));
67
68 /* Read one char from the serial device with <TO>-second timeout.
69    Returns char if ok, else EOF, -2 for timeout, -3 for anything else  */
70
71 int serial_readchar PARAMS ((int to));
72
73 /* Set the baudrate to the decimal value supplied, and return 1, or fail and
74    return 0.  */
75
76 int serial_setbaudrate PARAMS ((int rate));
77
78 /* Return the next rate in the sequence, or return 0 for failure.  */
79
80 /* Write some chars to the device, returns 0 for failure.  See errno for
81    details. */
82
83 int serial_write PARAMS ((const char *str, int len));
84
85 /* Close the serial port */
86
87 void serial_close PARAMS ((void));
88
89 /* Restore the serial port to the state saved in oldstate */
90
91 void serial_restore PARAMS ((int desc, struct ttystate *oldstate));