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