X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fserial.h;h=446b896345ff06ea7df1d24e529aae652212f7c2;hb=5b6d1e4fa4fc6827c7b3f0e99ff120dfa14d65d2;hp=495b04d73164f131d4c38eaea7ad7a26a61dd205;hpb=618f726fcb851883a0094aa7fa17003889b7189f;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/serial.h b/gdb/serial.h index 495b04d731..446b896345 100644 --- a/gdb/serial.h +++ b/gdb/serial.h @@ -1,5 +1,5 @@ /* Remote serial support interface definitions for GDB, the GNU Debugger. - Copyright (C) 1992-2016 Free Software Foundation, Inc. + Copyright (C) 1992-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -34,6 +34,9 @@ struct ui_file; typedef void *serial_ttystate; struct serial; +struct serial_ops; + +/* Create a new serial for OPS. The new serial is not opened. */ /* Try to open NAME. Returns a new `struct serial *' on success, NULL on failure. The new serial object has a reference count of 1. @@ -44,6 +47,10 @@ struct serial; extern struct serial *serial_open (const char *name); +/* Open a new serial stream using OPS. */ + +extern struct serial *serial_open_ops (const struct serial_ops *ops); + /* Returns true if SCB is open. */ extern int serial_is_open (struct serial *scb); @@ -68,8 +75,8 @@ extern void serial_ref (struct serial *scb); extern void serial_unref (struct serial *scb); -/* Create a pipe, and put the read end in files[0], and the write end - in filde[1]. Returns 0 for success, negative value for error (in +/* Create a pipe, and put the read end in FILDES[0], and the write end + in FILDES[1]. Returns 0 for success, negative value for error (in which case errno contains the error). */ extern int gdb_pipe (int fildes[2]); @@ -162,16 +169,6 @@ extern void serial_print_tty_state (struct serial *scb, serial_ttystate ttystate, struct ui_file *); -/* Set the tty state to NEW_TTYSTATE, where OLD_TTYSTATE is the - current state (generally obtained from a recent call to - serial_get_tty_state()), but be careful not to discard any input. - This means that we never switch in or out of raw mode, even if - NEW_TTYSTATE specifies a switch. */ - -extern int serial_noflush_set_tty_state (struct serial *scb, - serial_ttystate new_ttystate, - serial_ttystate old_ttystate); - /* Set the baudrate to the decimal value supplied. Returns 0 for success, -1 for failure. */ @@ -243,12 +240,6 @@ struct serial buffer. -ve for sticky errors. */ unsigned char *bufp; /* Current byte */ unsigned char buf[BUFSIZ]; /* Da buffer itself */ - int current_timeout; /* (ser-unix.c termio{,s} only), last - value of VTIME */ - int timeout_remaining; /* (ser-unix.c termio{,s} only), we - still need to wait for this many - more seconds. */ - char *name; /* The name of the device or host */ struct serial *next; /* Pointer to the next `struct serial *' */ int debug_p; /* Trace this serial devices operation. */ int async_state; /* Async internal state. */ @@ -258,7 +249,7 @@ struct serial struct serial_ops { - char *name; + const char *name; int (*open) (struct serial *, const char *name); void (*close) (struct serial *); int (*fdopen) (struct serial *, int fd); @@ -275,8 +266,6 @@ struct serial_ops int (*set_tty_state) (struct serial *, serial_ttystate); void (*print_tty_state) (struct serial *, serial_ttystate, struct ui_file *); - int (*noflush_set_tty_state) (struct serial *, serial_ttystate, - serial_ttystate); int (*setbaudrate) (struct serial *, int rate); int (*setstopbits) (struct serial *, int num); /* Set the value PARITY as parity setting for serial object.