]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
s/typedef serial_t/struct serial */
authorAndrew Cagney <cagney@redhat.com>
Wed, 11 Jul 2001 17:52:32 +0000 (17:52 +0000)
committerAndrew Cagney <cagney@redhat.com>
Wed, 11 Jul 2001 17:52:32 +0000 (17:52 +0000)
35 files changed:
gdb/ChangeLog
gdb/dsrec.c
gdb/inflow.c
gdb/mon960-rom.c
gdb/nindy-share/Onindy.c
gdb/nindy-share/nindy.c
gdb/nindy-share/ttyflush.c
gdb/ocd.c
gdb/remote-array.c
gdb/remote-e7000.c
gdb/remote-es.c
gdb/remote-mips.c
gdb/remote-nindy.c
gdb/remote-nrom.c
gdb/remote-os9k.c
gdb/remote-rdp.c
gdb/remote-sds.c
gdb/remote-st.c
gdb/remote.c
gdb/ser-e7kpc.c
gdb/ser-go32.c
gdb/ser-pipe.c
gdb/ser-tcp.c
gdb/ser-unix.c
gdb/ser-unix.h
gdb/serial.c
gdb/serial.h
gdb/sh3-rom.c
gdb/sparcl-tdep.c
gdb/sparclet-rom.c
gdb/srec.h
gdb/utils.c
gdb/w89k-rom.c
gdb/xmodem.c
gdb/xmodem.h

index cc7c4114c883d25368583887052fe965d500e5b0..2320282cfcf1659585f446a00963926ad57a003a 100644 (file)
@@ -1,3 +1,42 @@
+2001-07-10  Andrew Cagney  <ac131313@redhat.com>
+
+       * serial.h (typedef serial_t): Delete. Replace all references to
+       serial_t with `struct serial *'.
+       * serial.c: Update.
+       * nindy-share/ttyflush.c: Update.
+       * nindy-share/ttyflush.c: Update.
+       * nindy-share/Onindy.c: Update.
+       * nindy-share/nindy.c: Update.
+       * remote-rdp.c: Update.
+       * remote-sds.c: Update.
+       * remote-st.c: Update.
+       * remote-nindy.c: Update.
+       * remote-mips.c: Update.
+       * remote-e7000.c: Update.
+       * remote-os9k.c: Update.
+       * remote-nrom.c: Update.
+       * remote-es.c: Update.
+       * remote-array.c: Update.
+       * ocd.c: Update.
+       * mon960-rom.c: Update.
+       * dsrec.c: Update.
+       * inflow.c: Update.
+       * ser-e7kpc.c: Update.
+       * sparclet-rom.c: Update.
+       * srec.h: Update.
+       * ser-tcp.c: Update.
+       * ser-go32.c: Update.
+       * sparcl-tdep.c: Update.
+       * w89k-rom.c: Update.
+       * utils.c: Update.
+       * sh3-rom.c: Update.
+       * remote.c: Update.
+       * ser-pipe.c: Update.
+       * ser-unix.c: Update.
+       * ser-unix.h: Update.
+       * xmodem.c: Update.
+       * xmodem.h: Update.
+
 2001-07-11  J.T. Conklin  <jtc@redback.com>
 
        From Greg McGary <greg@mcgary.org>:
index 669a74a664dfaeb9808adcf359282e398baec05d..01fba79caac7064d5669c1b64d478fd0d16f84a5 100644 (file)
@@ -33,19 +33,20 @@ static int make_srec (char *srec, CORE_ADDR targ_addr, bfd * abfd,
                      int flags);
 
 /* Download an executable by converting it to S records.  DESC is a
-   serial_t to send the data to.  FILE is the name of the file to be
-   loaded.  LOAD_OFFSET is the offset into memory to load data into.
-   It is usually specified by the user and is useful with the a.out
-   file format.  MAXRECSIZE is the length in chars of the largest
-   S-record the host can accomodate.  This is measured from the
-   starting `S' to the last char of the checksum.  FLAGS is various
-   random flags, and HASHMARK is non-zero to cause a `#' to be
+   `struct serial *' to send the data to.  FILE is the name of the
+   file to be loaded.  LOAD_OFFSET is the offset into memory to load
+   data into.  It is usually specified by the user and is useful with
+   the a.out file format.  MAXRECSIZE is the length in chars of the
+   largest S-record the host can accomodate.  This is measured from
+   the starting `S' to the last char of the checksum.  FLAGS is
+   various random flags, and HASHMARK is non-zero to cause a `#' to be
    printed out for each record loaded.  WAITACK, if non-NULL, is a
-   function that waits for an acknowledgement after each S-record,
-   and returns non-zero if the ack is read correctly.  */
+   function that waits for an acknowledgement after each S-record, and
+   returns non-zero if the ack is read correctly.  */
 
 void
-load_srec (serial_t desc, const char *file, bfd_vma load_offset, int maxrecsize,
+load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
+          int maxrecsize,
           int flags, int hashmark, int (*waitack) (void))
 {
   bfd *abfd;
index 28ebf7d152db18b1d43bbf5f66a213233616c10d..f24704d7917b9f1c33e1d76334d64a5b8e20a347 100644 (file)
@@ -70,7 +70,7 @@ static void terminal_ours_1 (int);
 \f
 /* Record terminal status separately for debugger and inferior.  */
 
-static serial_t stdin_serial;
+static struct serial *stdin_serial;
 
 /* TTY state for the inferior.  We save it whenever the inferior stops, and
    restore it when it resumes.  */
index 847d4cf73deb8f279abd06e076d2d5417c1bd112..2b7fe5fd58d1cc7c7fd65aaaef774b9591f81b0f 100644 (file)
@@ -53,7 +53,7 @@ mon960_load_gen (char *filename, int from_tty)
 #else
 
 static void
-mon960_load (serial_t desc, char *file, int hashmark)
+mon960_load (struct serial *desc, char *file, int hashmark)
 {
   bfd *abfd;
   asection *s;
index a11400d7286accfe544dc211b1b578dd16a9a581..f89bafdeeb673f1addbab791778562f4a5afe63b 100644 (file)
@@ -58,7 +58,7 @@
 extern int quiet;      /* 1 => stifle unnecessary messages */
 
 /* tty connected to 960/NINDY board.  */
-extern serial_t nindy_serial;
+extern struct serial *nindy_serial;
 
 static OninStrGet();
 \f
index 9846fc65076515cf86ab4f2f0101d16b5d260da0..f32b1a2b18e995f230f729e9892b4da33e550440 100644 (file)
@@ -89,7 +89,7 @@
 #define TIMEOUT                -1
 
 int quiet = 0; /* 1 => stifle unnecessary messages */
-serial_t nindy_serial;
+struct serial *nindy_serial;
 
 static int old_nindy = 0; /* 1 => use old (hex) communication protocol */
 static ninStrGet();
@@ -514,7 +514,7 @@ parse_baudrate(s)
 
 static int
 try_baudrate (serial, brp)
-     serial_t serial;
+     struct serial *serial;
      struct baudrate *brp;
 {
   unsigned char c;
@@ -540,7 +540,7 @@ try_baudrate (serial, brp)
  ******************************************************************************/
 static
 autobaud( serial, brp )
-     serial_t serial;
+     struct serial *serial;
      struct baudrate *brp;
 {
   int i;
index ff3b64402291db1b60c45d431850fb1a83e88579..786850a5fa1a9341802ad2264f61ba9cd0efe5f9 100644 (file)
@@ -27,7 +27,7 @@
 
 int
 tty_flush (serial)
-     serial_t serial;
+     struct serial *serial;
 {
   while (1)
     {
index f5962c03c6f9d00212066a47bed182413ff864ab..72e05e8817897078a522e96ca20355bf81e4df07 100644 (file)
--- a/gdb/ocd.c
+++ b/gdb/ocd.c
@@ -83,7 +83,7 @@ static int remote_timeout = 2;
 /* Descriptor for I/O to remote machine.  Initialize it to NULL so that
    ocd_open knows that we don't have a file open when the program
    starts.  */
-static serial_t ocd_desc = NULL;
+static struct serial *ocd_desc = NULL;
 \f
 void
 ocd_error (char *s, int error_code)
index beb0c6bda00d68c4ed0a97ddf869001331a75a9d..dc7589aba04b3f73fba542282a3d5da9e24fd9b5 100644 (file)
@@ -90,7 +90,7 @@ static int timeout = 30;
  * Descriptor for I/O to remote machine.  Initialize it to NULL so that
  * array_open knows that we don't have a file open when the program starts.
  */
-serial_t array_desc = NULL;
+struct serial *array_desc = NULL;
 
 /*
  * this array of registers need to match the indexes used by GDB. The
@@ -694,7 +694,7 @@ array_wait (ptid_t ptid, struct target_waitstatus *status)
   int old_timeout = timeout;
   int result, i;
   char c;
-  serial_t tty_desc;
+  struct serial *tty_desc;
   serial_ttystate ttystate;
 
   debuglogs (1, "array_wait (), printing extraneous text.");
index 320584b94e3cc8a83d97ec3451ed38b4945fdb40..2a9a176f9e1981b1f5d1db2fef178c49c6e8f3b2 100644 (file)
@@ -115,7 +115,7 @@ static void expect_prompt (void);
 static int e7000_parse_device (char *args, char *dev_name, int baudrate);
 /* Variables. */
 
-static serial_t e7000_desc;
+static struct serial *e7000_desc;
 
 /* Allow user to chose between using hardware breakpoints or memory. */
 static int use_hard_breakpoints = 0;   /* use sw breakpoints by default */
index 6423fe2ac36a53ff07ba67a3b02cf46e0f484d11..7aa4d628d8b6dc6a5c3feb906131d1616f6ea65d 100644 (file)
@@ -231,7 +231,7 @@ static int m68020;
    es1800_open knows that we don't have a file open when the program
    starts.  */
 
-static serial_t es1800_desc = NULL;
+static struct serial *es1800_desc = NULL;
 
 #define        PBUFSIZ 1000
 #define HDRLEN sizeof("@.BAAAAAAAA=$VV\r")
index 882cbca163c78c6be8d0212f258905dbecde9446..5adb729193c4dfe3d6f550994dabd651be91e85f 100644 (file)
@@ -362,10 +362,10 @@ static int mips_receive_wait = 5;
 static int mips_need_reply = 0;
 
 /* Handle used to access serial I/O stream.  */
-static serial_t mips_desc;
+static struct serial *mips_desc;
 
 /* UDP handle used to download files to target.  */
-static serial_t udp_desc;
+static struct serial *udp_desc;
 static int udp_in_use;
 
 /* TFTP filename used to download files to DDB board, in the form
@@ -1540,7 +1540,7 @@ device is attached to the target board (e.g., /dev/ttya).\n"
 
   /* Open and initialize the serial port.  */
   mips_desc = SERIAL_OPEN (serial_port_name);
-  if (mips_desc == (serial_t) NULL)
+  if (mips_desc == NULL)
     perror_with_name (serial_port_name);
 
   if (baud_rate != -1)
index 9b8dfe88c697d282b6eeb7d837bb2320182fdadf..0acd90da7e88df79d107fedf497b19eb97fefe8d 100644 (file)
@@ -141,7 +141,7 @@ char *nindy_ttyname;                /* name of tty to talk to nindy on, or null */
 #define FALSE  0
 
 /* From nindy-share/nindy.c.  */
-extern serial_t nindy_serial;
+extern struct serial *nindy_serial;
 
 static int have_regs = 0;      /* 1 iff regs read since i960 last halted */
 static int regs_changed = 0;   /* 1 iff regs were modified since last read */
@@ -277,7 +277,7 @@ nindy_resume (ptid_t ptid, int step, enum target_signal siggnal)
 struct clean_up_tty_args
 {
   serial_ttystate state;
-  serial_t serial;
+  struct serial *serial;
 };
 static struct clean_up_tty_args tty_args;
 
index 9b6b0477fcb90e51eebfa2ce7452736f5bafcadd..340972328f604b096765fb9cc2a89363638cc0e2 100644 (file)
@@ -46,8 +46,8 @@ static void nrom_passthru (char *, int);
 
 /* We talk to the NetROM over these sockets.  */
 
-static serial_t load_desc = NULL;
-static serial_t ctrl_desc = NULL;
+static struct serial *load_desc = NULL;
+static struct serial *ctrl_desc = NULL;
 
 static int load_port = DEFAULT_NETROM_LOAD_PORT;
 static int control_port = DEFAULT_NETROM_CONTROL_PORT;
@@ -97,11 +97,11 @@ nrom_kill (void)
   nrom_close (0);
 }
 
-static serial_t
+static struct serial *
 open_socket (char *name, int port)
 {
   char sockname[100];
-  serial_t desc;
+  struct serial *desc;
 
   sprintf (sockname, "%s:%d", name, port);
   desc = SERIAL_OPEN (sockname);
index 3302580d4b80ee0ffd7b3ef23865a0ba87890186..1b693ebd3efd9d4f5030de3891dd6bd6966a05d5 100644 (file)
@@ -80,7 +80,7 @@ static int tty_xoff = 0;
 static int timeout = 10;
 static int is_trace_mode = 0;
 /* Descriptor for I/O to remote machine.  Initialize it to NULL */
-static serial_t monitor_desc = NULL;
+static struct serial *monitor_desc = NULL;
 
 static CORE_ADDR bufaddr = 0;
 static int buflen = 0;
index 673e423a793483f81e760ca5ae30f221230cb518..f0fe2a975822e55c4bc83dcb41fa7380cf8f1f00 100644 (file)
@@ -55,7 +55,7 @@
 #endif
 
 extern struct target_ops remote_rdp_ops;
-static serial_t io;
+static struct serial *io;
 static host_callback *callback = &default_callback;
 
 struct
index 7d2f5477ec3dec1ee47c9de6c89e4441b7f40dc0..73fab941c9509df4b977b20426249baf8a93c051 100644 (file)
@@ -127,7 +127,7 @@ static int sds_timeout = 2;
    that sds_open knows that we don't have a file open when the program
    starts.  */
 
-static serial_t sds_desc = NULL;
+static struct serial *sds_desc = NULL;
 
 /* This limit comes from the monitor.  */
 
index 55e1392642d75f2f872067146f14dd713f31dc77..cda69b6ae9eee546aea37157ee7d771c24b61ed0 100644 (file)
@@ -61,7 +61,7 @@ static int timeout = 24;
    st2000_open knows that we don't have a file open when the program
    starts.  */
 
-static serial_t st2000_desc;
+static struct serial *st2000_desc;
 
 /* Send data to stdebug.  Works just like printf. */
 
index 86ba3c1eb14d47e793dcaff50d63f33f2adeef4c..72a791387ec6c3d86ec631ae4a2749f74ee56131 100644 (file)
@@ -240,7 +240,7 @@ static int remote_break;
 /* Descriptor for I/O to remote machine.  Initialize it to NULL so that
    remote_open knows that we don't have a file open when the program
    starts.  */
-static serial_t remote_desc = NULL;
+static struct serial *remote_desc = NULL;
 
 /* This is set by the target (thru the 'S' message)
    to denote that the target is in kernel mode.  */
@@ -5669,7 +5669,7 @@ static void *async_client_context;
 static serial_event_ftype remote_async_serial_handler;
 
 static void
-remote_async_serial_handler (serial_t scb, void *context)
+remote_async_serial_handler (struct serial *scb, void *context)
 {
   /* Don't propogate error information up to the client.  Instead let
      the client find out about the error by querying the target.  */
index 209765ef400952f6ad2c6f223cd72f39f15b08c4..49b2c89c3246a3d90a28c71ec08f0c9c7a1c4149 100644 (file)
 #include <sys/dos.h>
 #endif
 
-static int e7000pc_open (serial_t scb, const char *name);
-static void e7000pc_raw (serial_t scb);
-static int e7000pc_readchar (serial_t scb, int timeout);
-static int e7000pc_setbaudrate (serial_t scb, int rate);
-static int e7000pc_write (serial_t scb, const char *str, int len);
-static void e7000pc_close (serial_t scb);
-static serial_ttystate e7000pc_get_tty_state (serial_t scb);
-static int e7000pc_set_tty_state (serial_t scb, serial_ttystate state);
+static int e7000pc_open (struct serial *scb, const char *name);
+static void e7000pc_raw (struct serial *scb);
+static int e7000pc_readchar (struct serial *scb, int timeout);
+static int e7000pc_setbaudrate (struct serial *scb, int rate);
+static int e7000pc_write (struct serial *scb, const char *str, int len);
+static void e7000pc_close (struct serial *scb);
+static serial_ttystate e7000pc_get_tty_state (struct serial *scb);
+static int e7000pc_set_tty_state (struct serial *scb, serial_ttystate state);
 
 #define OFF_DPD        0x0000
 #define OFF_DDP        0x1000
@@ -291,7 +291,7 @@ dosasync_write (int fd, const char *buf, int len)
 }
 
 static int
-e7000pc_open (serial_t scb, const char *name)
+e7000pc_open (struct serial *scb, const char *name)
 {
   if (strncasecmp (name, "pc", 2) != 0)
     {
@@ -308,19 +308,19 @@ e7000pc_open (serial_t scb, const char *name)
 }
 
 static int
-e7000pc_noop (serial_t scb)
+e7000pc_noop (struct serial *scb)
 {
   return 0;
 }
 
 static void
-e7000pc_raw (serial_t scb)
+e7000pc_raw (struct serial *scb)
 {
   /* Always in raw mode */
 }
 
 static int
-e7000pc_readchar (serial_t scb, int timeout)
+e7000pc_readchar (struct serial *scb, int timeout)
 {
   char buf;
 
@@ -345,7 +345,7 @@ struct e7000pc_ttystate
    vector.  Someday, they may do something real... */
 
 static serial_ttystate
-e7000pc_get_tty_state (serial_t scb)
+e7000pc_get_tty_state (struct serial *scb)
 {
   struct e7000pc_ttystate *state;
 
@@ -355,20 +355,21 @@ e7000pc_get_tty_state (serial_t scb)
 }
 
 static int
-e7000pc_set_tty_state (serial_t scb, serial_ttystate ttystate)
+e7000pc_set_tty_state (struct serial *scb, serial_ttystate ttystate)
 {
   return 0;
 }
 
 static int
-e7000pc_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate,
+e7000pc_noflush_set_tty_state (struct serial *scb,
+                              serial_ttystate new_ttystate,
                               serial_ttystate old_ttystate)
 {
   return 0;
 }
 
 static void
-e7000pc_print_tty_state (serial_t scb,
+e7000pc_print_tty_state (struct serial *scb,
                         serial_ttystate ttystate,
                         struct ui_file *stream)
 {
@@ -377,19 +378,19 @@ e7000pc_print_tty_state (serial_t scb,
 }
 
 static int
-e7000pc_setbaudrate (serial_t scb, int rate)
+e7000pc_setbaudrate (struct serial *scb, int rate)
 {
   return 0;
 }
 
 static int
-e7000pc_setstopbits (serial_t scb, int rate)
+e7000pc_setstopbits (struct serial *scb, int rate)
 {
   return 0;
 }
 
 static int
-e7000pc_write (serial_t scb, const char *str, int len)
+e7000pc_write (struct serial *scb, const char *str, int len)
 {
   dosasync_write (scb->fd, str, len);
 
@@ -397,7 +398,7 @@ e7000pc_write (serial_t scb, const char *str, int len)
 }
 
 static void
-e7000pc_close (serial_t scb)
+e7000pc_close (struct serial *scb)
 {
 }
 
index a8521f2a0e60637e4e2c435ea298357db065b6e7..0642b5aa4bdaef2d3bf54c5b65996ab585e34e1a 100644 (file)
@@ -228,14 +228,14 @@ ports[4] =
   }
 };
 
-static int dos_open (serial_t scb, const char *name);
-static void dos_raw (serial_t scb);
-static int dos_readchar (serial_t scb, int timeout);
-static int dos_setbaudrate (serial_t scb, int rate);
-static int dos_write (serial_t scb, const char *str, int len);
-static void dos_close (serial_t scb);
-static serial_ttystate dos_get_tty_state (serial_t scb);
-static int dos_set_tty_state (serial_t scb, serial_ttystate state);
+static int dos_open (struct serial *scb, const char *name);
+static void dos_raw (struct serial *scb);
+static int dos_readchar (struct serial *scb, int timeout);
+static int dos_setbaudrate (struct serial *scb, int rate);
+static int dos_write (struct serial *scb, const char *str, int len);
+static void dos_close (struct serial *scb);
+static serial_ttystate dos_get_tty_state (struct serial *scb);
+static int dos_set_tty_state (struct serial *scb, serial_ttystate state);
 static int dos_baudconv (int rate);
 
 #define inb(p,a)       inportb((p)->base + (a))
@@ -453,7 +453,7 @@ dos_unhookirq (struct intrupt *intr)
 
 
 static int
-dos_open (serial_t scb, const char *name)
+dos_open (struct serial *scb, const char *name)
 {
   struct dos_ttystate *port;
   int fd, i;
@@ -558,7 +558,7 @@ ok:
 
 
 static void
-dos_close (serial_t scb)
+dos_close (struct serial *scb)
 {
   struct dos_ttystate *port;
   struct intrupt *intrupt;
@@ -600,19 +600,19 @@ dos_close (serial_t scb)
 
 
 static int
-dos_noop (serial_t scb)
+dos_noop (struct serial *scb)
 {
   return 0;
 }
 
 static void
-dos_raw (serial_t scb)
+dos_raw (struct serial *scb)
 {
   /* Always in raw mode */
 }
 
 static int
-dos_readchar (serial_t scb, int timeout)
+dos_readchar (struct serial *scb, int timeout)
 {
   struct dos_ttystate *port = &ports[scb->fd];
   long then;
@@ -630,7 +630,7 @@ dos_readchar (serial_t scb, int timeout)
 
 
 static serial_ttystate
-dos_get_tty_state (serial_t scb)
+dos_get_tty_state (struct serial *scb)
 {
   struct dos_ttystate *port = &ports[scb->fd];
   struct dos_ttystate *state;
@@ -654,7 +654,7 @@ dos_get_tty_state (serial_t scb)
 }
 
 static int
-dos_set_tty_state (serial_t scb, serial_ttystate ttystate)
+dos_set_tty_state (struct serial *scb, serial_ttystate ttystate)
 {
   struct dos_ttystate *state;
 
@@ -664,7 +664,7 @@ dos_set_tty_state (serial_t scb, serial_ttystate ttystate)
 }
 
 static int
-dos_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate,
+dos_noflush_set_tty_state (struct serial *scb, serial_ttystate new_ttystate,
                           serial_ttystate old_ttystate)
 {
   struct dos_ttystate *state;
@@ -675,7 +675,7 @@ dos_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate,
 }
 
 static int
-dos_flush_input (serial_t scb)
+dos_flush_input (struct serial *scb)
 {
   struct dos_ttystate *port = &ports[scb->fd];
   disable ();
@@ -687,7 +687,7 @@ dos_flush_input (serial_t scb)
 }
 
 static void
-dos_print_tty_state (serial_t scb, serial_ttystate ttystate,
+dos_print_tty_state (struct serial *scb, serial_ttystate ttystate,
                     struct ui_file *stream)
 {
   /* Nothing to print */
@@ -718,7 +718,7 @@ dos_baudconv (int rate)
 
 
 static int
-dos_setbaudrate (serial_t scb, int rate)
+dos_setbaudrate (struct serial *scb, int rate)
 {
   struct dos_ttystate *port = &ports[scb->fd];
 
@@ -750,7 +750,7 @@ dos_setbaudrate (serial_t scb, int rate)
 }
 
 static int
-dos_setstopbits (serial_t scb, int num)
+dos_setstopbits (struct serial *scb, int num)
 {
   struct dos_ttystate *port = &ports[scb->fd];
   unsigned char cfcr;
@@ -777,7 +777,7 @@ dos_setstopbits (serial_t scb, int num)
 }
 
 static int
-dos_write (serial_t scb, const char *str, int len)
+dos_write (struct serial *scb, const char *str, int len)
 {
   volatile struct dos_ttystate *port = &ports[scb->fd];
   int fifosize = port->fifo ? 16 : 1;
@@ -818,7 +818,7 @@ dos_write (serial_t scb, const char *str, int len)
 
 
 static int
-dos_sendbreak (serial_t scb)
+dos_sendbreak (struct serial *scb)
 {
   volatile struct dos_ttystate *port = &ports[scb->fd];
   unsigned char cfcr;
@@ -856,7 +856,7 @@ static struct serial_ops dos_ops =
   dos_setbaudrate,
   dos_setstopbits,
   dos_noop,                    /* wait for output to drain */
-  (void (*)(serial_t, int))NULL        /* change into async mode */
+  (void (*)(struct serial *, int))NULL /* change into async mode */
 };
 
 
index 3e232872301b1564dacf80606b3d9027c23e4940..bca0e54e4bab95eb834e2229f6dc1d1ac228ccd2 100644 (file)
@@ -34,8 +34,8 @@
 
 #include <signal.h>
 
-static int pipe_open (serial_t scb, const char *name);
-static void pipe_close (serial_t scb);
+static int pipe_open (struct serial *scb, const char *name);
+static void pipe_close (struct serial *scb);
 
 extern void _initialize_ser_pipe (void);
 
@@ -47,7 +47,7 @@ struct pipe_state
 /* Open up a raw pipe */
 
 static int
-pipe_open (serial_t scb, const char *name)
+pipe_open (struct serial *scb, const char *name)
 {
 #if !HAVE_SOCKETPAIR
   return -1;
@@ -117,7 +117,7 @@ pipe_open (serial_t scb, const char *name)
 }
 
 static void
-pipe_close (serial_t scb)
+pipe_close (struct serial *scb)
 {
   struct pipe_state *state = scb->state;
   if (state != NULL)
index 30281cde1ee3d132ab3275c426a20459670790cd..fe5cb4420b9d81c6818410395f696ededdb27b4a 100644 (file)
 #include <signal.h>
 #include "gdb_string.h"
 
-static int tcp_open (serial_t scb, const char *name);
-static void tcp_close (serial_t scb);
+static int tcp_open (struct serial *scb, const char *name);
+static void tcp_close (struct serial *scb);
 
 void _initialize_ser_tcp (void);
 
 /* Open up a raw tcp socket */
 
 static int
-tcp_open (serial_t scb, const char *name)
+tcp_open (struct serial *scb, const char *name)
 {
   char *port_str;
   int port;
@@ -122,7 +122,7 @@ tcp_open (serial_t scb, const char *name)
 }
 
 static void
-tcp_close (serial_t scb)
+tcp_close (struct serial *scb)
 {
   if (scb->fd < 0)
     return;
index ee17c122c78526259734a9503e1bf5ca321ab6ba..e12e776d59cacb3cb37d78f1f2ad75b0f0587b1e 100644 (file)
@@ -64,32 +64,37 @@ struct hardwire_ttystate
   };
 #endif /* sgtty */
 
-static int hardwire_open (serial_t scb, const char *name);
-static void hardwire_raw (serial_t scb);
-static int wait_for (serial_t scb, int timeout);
-static int hardwire_readchar (serial_t scb, int timeout);
-static int do_hardwire_readchar (serial_t scb, int timeout);
-static int generic_readchar (serial_t scb, int timeout, int (*do_readchar) (serial_t scb, int timeout));
+static int hardwire_open (struct serial *scb, const char *name);
+static void hardwire_raw (struct serial *scb);
+static int wait_for (struct serial *scb, int timeout);
+static int hardwire_readchar (struct serial *scb, int timeout);
+static int do_hardwire_readchar (struct serial *scb, int timeout);
+static int generic_readchar (struct serial *scb, int timeout,
+                            int (*do_readchar) (struct serial *scb,
+                                                int timeout));
 static int rate_to_code (int rate);
-static int hardwire_setbaudrate (serial_t scb, int rate);
-static void hardwire_close (serial_t scb);
-static int get_tty_state (serial_t scb, struct hardwire_ttystate * state);
-static int set_tty_state (serial_t scb, struct hardwire_ttystate * state);
-static serial_ttystate hardwire_get_tty_state (serial_t scb);
-static int hardwire_set_tty_state (serial_t scb, serial_ttystate state);
-static int hardwire_noflush_set_tty_state (serial_t, serial_ttystate,
-                                                  serial_ttystate);
-static void hardwire_print_tty_state (serial_t, serial_ttystate, struct ui_file *);
-static int hardwire_drain_output (serial_t);
-static int hardwire_flush_output (serial_t);
-static int hardwire_flush_input (serial_t);
-static int hardwire_send_break (serial_t);
-static int hardwire_setstopbits (serial_t, int);
-
-static int do_unix_readchar (serial_t scb, int timeout);
+static int hardwire_setbaudrate (struct serial *scb, int rate);
+static void hardwire_close (struct serial *scb);
+static int get_tty_state (struct serial *scb,
+                         struct hardwire_ttystate * state);
+static int set_tty_state (struct serial *scb,
+                         struct hardwire_ttystate * state);
+static serial_ttystate hardwire_get_tty_state (struct serial *scb);
+static int hardwire_set_tty_state (struct serial *scb, serial_ttystate state);
+static int hardwire_noflush_set_tty_state (struct serial *, serial_ttystate,
+                                          serial_ttystate);
+static void hardwire_print_tty_state (struct serial *, serial_ttystate,
+                                     struct ui_file *);
+static int hardwire_drain_output (struct serial *);
+static int hardwire_flush_output (struct serial *);
+static int hardwire_flush_input (struct serial *);
+static int hardwire_send_break (struct serial *);
+static int hardwire_setstopbits (struct serial *, int);
+
+static int do_unix_readchar (struct serial *scb, int timeout);
 static timer_handler_func push_event;
 static handler_func fd_event;
-static void reschedule (serial_t scb);
+static void reschedule (struct serial *scb);
 
 void _initialize_ser_hardwire (void);
 
@@ -98,7 +103,7 @@ extern int (*ui_loop_hook) (int);
 /* Open up a real live device for serial I/O */
 
 static int
-hardwire_open (serial_t scb, const char *name)
+hardwire_open (struct serial *scb, const char *name)
 {
   scb->fd = open (name, O_RDWR);
   if (scb->fd < 0)
@@ -108,7 +113,7 @@ hardwire_open (serial_t scb, const char *name)
 }
 
 static int
-get_tty_state (serial_t scb, struct hardwire_ttystate *state)
+get_tty_state (struct serial *scb, struct hardwire_ttystate *state)
 {
 #ifdef HAVE_TERMIOS
   if (tcgetattr (scb->fd, &state->termios) < 0)
@@ -138,7 +143,7 @@ get_tty_state (serial_t scb, struct hardwire_ttystate *state)
 }
 
 static int
-set_tty_state (serial_t scb, struct hardwire_ttystate *state)
+set_tty_state (struct serial *scb, struct hardwire_ttystate *state)
 {
 #ifdef HAVE_TERMIOS
   if (tcsetattr (scb->fd, TCSANOW, &state->termios) < 0)
@@ -168,7 +173,7 @@ set_tty_state (serial_t scb, struct hardwire_ttystate *state)
 }
 
 static serial_ttystate
-hardwire_get_tty_state (serial_t scb)
+hardwire_get_tty_state (struct serial *scb)
 {
   struct hardwire_ttystate *state;
 
@@ -181,7 +186,7 @@ hardwire_get_tty_state (serial_t scb)
 }
 
 static int
-hardwire_set_tty_state (serial_t scb, serial_ttystate ttystate)
+hardwire_set_tty_state (struct serial *scb, serial_ttystate ttystate)
 {
   struct hardwire_ttystate *state;
 
@@ -191,7 +196,7 @@ hardwire_set_tty_state (serial_t scb, serial_ttystate ttystate)
 }
 
 static int
-hardwire_noflush_set_tty_state (serial_t scb,
+hardwire_noflush_set_tty_state (struct serial *scb,
                                serial_ttystate new_ttystate,
                                serial_ttystate old_ttystate)
 {
@@ -224,7 +229,7 @@ hardwire_noflush_set_tty_state (serial_t scb,
 }
 
 static void
-hardwire_print_tty_state (serial_t scb,
+hardwire_print_tty_state (struct serial *scb,
                          serial_ttystate ttystate,
                          struct ui_file *stream)
 {
@@ -282,7 +287,7 @@ hardwire_print_tty_state (serial_t scb,
 /* Wait for the output to drain away, as opposed to flushing (discarding) it */
 
 static int
-hardwire_drain_output (serial_t scb)
+hardwire_drain_output (struct serial *scb)
 {
 #ifdef HAVE_TERMIOS
   return tcdrain (scb->fd);
@@ -311,7 +316,7 @@ hardwire_drain_output (serial_t scb)
 }
 
 static int
-hardwire_flush_output (serial_t scb)
+hardwire_flush_output (struct serial *scb)
 {
 #ifdef HAVE_TERMIOS
   return tcflush (scb->fd, TCOFLUSH);
@@ -328,7 +333,7 @@ hardwire_flush_output (serial_t scb)
 }
 
 static int
-hardwire_flush_input (serial_t scb)
+hardwire_flush_input (struct serial *scb)
 {
   ser_unix_flush_input (scb);
 
@@ -347,7 +352,7 @@ hardwire_flush_input (serial_t scb)
 }
 
 static int
-hardwire_send_break (serial_t scb)
+hardwire_send_break (struct serial *scb)
 {
 #ifdef HAVE_TERMIOS
   return tcsendbreak (scb->fd, 0);
@@ -377,7 +382,7 @@ hardwire_send_break (serial_t scb)
 }
 
 static void
-hardwire_raw (serial_t scb)
+hardwire_raw (struct serial *scb)
 {
   struct hardwire_ttystate state;
 
@@ -432,7 +437,7 @@ hardwire_raw (serial_t scb)
    an overflowed timer is unnecessary. */
 
 static int
-wait_for (serial_t scb, int timeout)
+wait_for (struct serial *scb, int timeout)
 {
 #ifdef HAVE_SGTTY
   while (1)
@@ -553,7 +558,7 @@ wait_for (serial_t scb, int timeout)
    that. */
 
 static int
-do_hardwire_readchar (serial_t scb, int timeout)
+do_hardwire_readchar (struct serial *scb, int timeout)
 {
   int status, delta;
   int detach = 0;
@@ -621,7 +626,7 @@ do_hardwire_readchar (serial_t scb, int timeout)
 }
 
 static int
-hardwire_readchar (serial_t scb, int timeout)
+hardwire_readchar (struct serial *scb, int timeout)
 {
   return generic_readchar (scb, timeout, do_hardwire_readchar);
 }
@@ -772,7 +777,7 @@ rate_to_code (int rate)
 }
 
 static int
-hardwire_setbaudrate (serial_t scb, int rate)
+hardwire_setbaudrate (struct serial *scb, int rate)
 {
   struct hardwire_ttystate state;
   int baud_code = rate_to_code (rate);
@@ -811,7 +816,7 @@ hardwire_setbaudrate (serial_t scb, int rate)
 }
 
 static int
-hardwire_setstopbits (serial_t scb, int num)
+hardwire_setstopbits (struct serial *scb, int num)
 {
   struct hardwire_ttystate state;
   int newbit;
@@ -854,7 +859,7 @@ hardwire_setstopbits (serial_t scb, int num)
 }
 
 static void
-hardwire_close (serial_t scb)
+hardwire_close (struct serial *scb)
 {
   if (scb->fd < 0)
     return;
@@ -867,20 +872,20 @@ hardwire_close (serial_t scb)
 /* Generic operations used by all UNIX/FD based serial interfaces. */
 
 serial_ttystate
-ser_unix_nop_get_tty_state (serial_t scb)
+ser_unix_nop_get_tty_state (struct serial *scb)
 {
   /* allocate a dummy */
   return (serial_ttystate) XMALLOC (int);
 }
 
 int
-ser_unix_nop_set_tty_state (serial_t scb, serial_ttystate ttystate)
+ser_unix_nop_set_tty_state (struct serial *scb, serial_ttystate ttystate)
 {
   return 0;
 }
 
 void
-ser_unix_nop_raw (serial_t scb)
+ser_unix_nop_raw (struct serial *scb)
 {
   return;                      /* Always in raw mode */
 }
@@ -889,7 +894,7 @@ ser_unix_nop_raw (serial_t scb)
    otherwise SERIAL_TIMEOUT or SERIAL_ERROR. */
 
 int
-ser_unix_wait_for (serial_t scb, int timeout)
+ser_unix_wait_for (struct serial *scb, int timeout)
 {
   while (1)
     {
@@ -934,7 +939,7 @@ ser_unix_wait_for (serial_t scb, int timeout)
    dead, or -3 for any other error (see errno in that case). */
 
 static int
-do_unix_readchar (serial_t scb, int timeout)
+do_unix_readchar (struct serial *scb, int timeout)
 {
   int status;
   int delta;
@@ -1025,8 +1030,8 @@ do_unix_readchar (serial_t scb, int timeout)
    will be called. */
 
 static int
-generic_readchar (serial_t scb, int timeout,
-                 int (do_readchar) (serial_t scb, int timeout))
+generic_readchar (struct serial *scb, int timeout,
+                 int (do_readchar) (struct serial *scb, int timeout))
 {
   int ch;
   if (scb->bufcnt > 0)
@@ -1063,13 +1068,13 @@ generic_readchar (serial_t scb, int timeout,
 }
 
 int
-ser_unix_readchar (serial_t scb, int timeout)
+ser_unix_readchar (struct serial *scb, int timeout)
 {
   return generic_readchar (scb, timeout, do_unix_readchar);
 }
 
 int
-ser_unix_nop_noflush_set_tty_state (serial_t scb,
+ser_unix_nop_noflush_set_tty_state (struct serial *scb,
                                    serial_ttystate new_ttystate,
                                    serial_ttystate old_ttystate)
 {
@@ -1077,7 +1082,7 @@ ser_unix_nop_noflush_set_tty_state (serial_t scb,
 }
 
 void
-ser_unix_nop_print_tty_state (serial_t scb, 
+ser_unix_nop_print_tty_state (struct serial *scb, 
                              serial_ttystate ttystate,
                              struct ui_file *stream)
 {
@@ -1086,19 +1091,19 @@ ser_unix_nop_print_tty_state (serial_t scb,
 }
 
 int
-ser_unix_nop_setbaudrate (serial_t scb, int rate)
+ser_unix_nop_setbaudrate (struct serial *scb, int rate)
 {
   return 0;                    /* Never fails! */
 }
 
 int
-ser_unix_nop_setstopbits (serial_t scb, int num)
+ser_unix_nop_setstopbits (struct serial *scb, int num)
 {
   return 0;                    /* Never fails! */
 }
 
 int
-ser_unix_write (serial_t scb, const char *str, int len)
+ser_unix_write (struct serial *scb, const char *str, int len)
 {
   int cc;
 
@@ -1115,13 +1120,13 @@ ser_unix_write (serial_t scb, const char *str, int len)
 }
 
 int
-ser_unix_nop_flush_output (serial_t scb)
+ser_unix_nop_flush_output (struct serial *scb)
 {
   return 0;
 }
 
 int
-ser_unix_flush_input (serial_t scb)
+ser_unix_flush_input (struct serial *scb)
 {
   if (scb->bufcnt >= 0)
     {
@@ -1134,13 +1139,13 @@ ser_unix_flush_input (serial_t scb)
 }
 
 int
-ser_unix_nop_send_break (serial_t scb)
+ser_unix_nop_send_break (struct serial *scb)
 {
   return 0;
 }
 
 int
-ser_unix_nop_drain_output (serial_t scb)
+ser_unix_nop_drain_output (struct serial *scb)
 {
   return 0;
 }
@@ -1177,7 +1182,7 @@ enum {
    scheduled task is only changed when needed. */
 
 static void
-reschedule (serial_t scb)
+reschedule (struct serial *scb)
 {
   if (SERIAL_IS_ASYNC_P (scb))
     {
@@ -1244,7 +1249,7 @@ reschedule (serial_t scb)
 static void
 fd_event (int error, void *context)
 {
-  serial_t scb = context;
+  struct serial *scb = context;
   if (error != 0)
     {
       scb->bufcnt = SERIAL_ERROR;
@@ -1286,7 +1291,7 @@ fd_event (int error, void *context)
 static void
 push_event (void *context)
 {
-  serial_t scb = context;
+  struct serial *scb = context;
   scb->async_state = NOTHING_SCHEDULED; /* Timers are one-off */
   scb->async_handler (scb, scb->async_context);
   /* re-schedule */
@@ -1296,7 +1301,7 @@ push_event (void *context)
 /* Put the SERIAL device into/out-of ASYNC mode.  */
 
 void
-ser_unix_async (serial_t scb,
+ser_unix_async (struct serial *scb,
                int async_p)
 {
   if (async_p)
index e4b2c167f18a41d69268e4f3ba92ec377d62c459..861694fb8065b024470b6688a44e972167cb6574 100644 (file)
 
 /* Generic UNIX/FD functions */
 
-extern int ser_unix_nop_flush_output (serial_t scb);
-extern int ser_unix_flush_input (serial_t scb);
-extern int ser_unix_nop_send_break (serial_t scb);
-extern void ser_unix_nop_raw (serial_t scb);
-extern serial_ttystate ser_unix_nop_get_tty_state (serial_t scb);
-extern int ser_unix_nop_set_tty_state (serial_t scb, serial_ttystate ttystate);
-extern void ser_unix_nop_print_tty_state (serial_t scb, serial_ttystate ttystate, struct ui_file *stream);
-extern int ser_unix_nop_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate);
-extern int ser_unix_nop_setbaudrate (serial_t scb, int rate);
-extern int ser_unix_nop_setstopbits (serial_t scb, int rate);
-extern int ser_unix_nop_drain_output (serial_t scb);
-
-extern int ser_unix_wait_for (serial_t scb, int timeout);
-extern int ser_unix_readchar (serial_t scb, int timeout);
-
-extern int ser_unix_write (serial_t scb, const char *str, int len);
-
-extern void ser_unix_async (serial_t scb, int async_p);
+extern int ser_unix_nop_flush_output (struct serial *scb);
+extern int ser_unix_flush_input (struct serial *scb);
+extern int ser_unix_nop_send_break (struct serial *scb);
+extern void ser_unix_nop_raw (struct serial *scb);
+extern serial_ttystate ser_unix_nop_get_tty_state (struct serial *scb);
+extern int ser_unix_nop_set_tty_state (struct serial *scb,
+                                      serial_ttystate ttystate);
+extern void ser_unix_nop_print_tty_state (struct serial *scb,
+                                         serial_ttystate ttystate,
+                                         struct ui_file *stream);
+extern int ser_unix_nop_noflush_set_tty_state (struct serial *scb,
+                                              serial_ttystate new_ttystate,
+                                              serial_ttystate old_ttystate);
+extern int ser_unix_nop_setbaudrate (struct serial *scb, int rate);
+extern int ser_unix_nop_setstopbits (struct serial *scb, int rate);
+extern int ser_unix_nop_drain_output (struct serial *scb);
+
+extern int ser_unix_wait_for (struct serial *scb, int timeout);
+extern int ser_unix_readchar (struct serial *scb, int timeout);
+
+extern int ser_unix_write (struct serial *scb, const char *str, int len);
+
+extern void ser_unix_async (struct serial *scb, int async_p);
 
 #endif
index 4dd66fc7f352481c7d7f701615145011fac66d06..38e1e0e0cfd42f127a99e1b4bf9eeaa0f4180786 100644 (file)
@@ -38,11 +38,11 @@ static struct serial_ops *serial_ops_list = NULL;
 
 /* This is the last serial stream opened.  Used by connect command. */
 
-static serial_t last_serial_opened = NULL;
+static struct serial *last_serial_opened = NULL;
 
 /* Pointer to list of scb's. */
 
-static serial_t scb_base;
+static struct serial *scb_base;
 
 /* Non-NULL gives filename which contains a recording of the remote session,
    suitable for playback by gdbserver. */
@@ -63,7 +63,6 @@ static const char *serial_logbase = logbase_ascii;
 #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
 \f
 
-
 static int serial_current_type = 0;
 
 /* Log char CH of type CHTYPE, with TIMEOUT */
@@ -172,10 +171,10 @@ serial_add_interface (struct serial_ops *optable)
 
 /* Open up a device or a network socket, depending upon the syntax of NAME. */
 
-serial_t
+struct serial *
 serial_open (const char *name)
 {
-  serial_t scb;
+  struct serial *scb;
   struct serial_ops *ops;
   const char *open_name = name;
 
@@ -239,10 +238,10 @@ serial_open (const char *name)
   return scb;
 }
 
-serial_t
+struct serial *
 serial_fdopen (const int fd)
 {
-  serial_t scb;
+  struct serial *scb;
   struct serial_ops *ops;
 
   for (scb = scb_base; scb; scb = scb->next)
@@ -281,9 +280,9 @@ serial_fdopen (const int fd)
 }
 
 static void
-do_serial_close (serial_t scb, int really_close)
+do_serial_close (struct serial *scb, int really_close)
 {
-  serial_t tmp_scb;
+  struct serial *tmp_scb;
 
   last_serial_opened = NULL;
 
@@ -333,19 +332,19 @@ do_serial_close (serial_t scb, int really_close)
 }
 
 void
-serial_close (serial_t scb)
+serial_close (struct serial *scb)
 {
   do_serial_close (scb, 1);
 }
 
 void
-serial_un_fdopen (serial_t scb)
+serial_un_fdopen (struct serial *scb)
 {
   do_serial_close (scb, 0);
 }
 
 int
-serial_readchar (serial_t scb, int timeout)
+serial_readchar (struct serial *scb, int timeout)
 {
   int ch;
 
@@ -376,7 +375,7 @@ serial_readchar (serial_t scb, int timeout)
 }
 
 int
-serial_write (serial_t scb, const char *str, int len)
+serial_write (struct serial *scb, const char *str, int len)
 {
   if (serial_logfp != NULL)
     {
@@ -394,7 +393,7 @@ serial_write (serial_t scb, const char *str, int len)
 }
 
 void
-serial_printf (serial_t desc, const char *format,...)
+serial_printf (struct serial *desc, const char *format,...)
 {
   va_list args;
   char *buf;
@@ -408,25 +407,25 @@ serial_printf (serial_t desc, const char *format,...)
 }
 
 int
-serial_drain_output (serial_t scb)
+serial_drain_output (struct serial *scb)
 {
   return scb->ops->drain_output (scb);
 }
 
 int
-serial_flush_output (serial_t scb)
+serial_flush_output (struct serial *scb)
 {
   return scb->ops->flush_output (scb);
 }
 
 int
-serial_flush_input (serial_t scb)
+serial_flush_input (struct serial *scb)
 {
   return scb->ops->flush_input (scb);
 }
 
 int
-serial_send_break (serial_t scb)
+serial_send_break (struct serial *scb)
 {
   if (serial_logfp != NULL)
     serial_logchar (serial_logfp, 'w', SERIAL_BREAK, 0);
@@ -435,25 +434,25 @@ serial_send_break (serial_t scb)
 }
 
 void
-serial_raw (serial_t scb)
+serial_raw (struct serial *scb)
 {
   scb->ops->go_raw (scb);
 }
 
 serial_ttystate
-serial_get_tty_state (serial_t scb)
+serial_get_tty_state (struct serial *scb)
 {
   return scb->ops->get_tty_state (scb);
 }
 
 int
-serial_set_tty_state (serial_t scb, serial_ttystate ttystate)
+serial_set_tty_state (struct serial *scb, serial_ttystate ttystate)
 {
   return scb->ops->set_tty_state (scb, ttystate);
 }
 
 void
-serial_print_tty_state (serial_t scb,
+serial_print_tty_state (struct serial *scb,
                        serial_ttystate ttystate,
                        struct ui_file *stream)
 {
@@ -461,7 +460,7 @@ serial_print_tty_state (serial_t scb,
 }
 
 int
-serial_noflush_set_tty_state (serial_t scb,
+serial_noflush_set_tty_state (struct serial *scb,
                              serial_ttystate new_ttystate,
                              serial_ttystate old_ttystate)
 {
@@ -469,31 +468,31 @@ serial_noflush_set_tty_state (serial_t scb,
 }
 
 int
-serial_setbaudrate (serial_t scb, int rate)
+serial_setbaudrate (struct serial *scb, int rate)
 {
   return scb->ops->setbaudrate (scb, rate);
 }
 
 int
-serial_setstopbits (serial_t scb, int num)
+serial_setstopbits (struct serial *scb, int num)
 {
   return scb->ops->setstopbits (scb, num);
 }
 
 int
-serial_can_async_p (serial_t scb)
+serial_can_async_p (struct serial *scb)
 {
   return (scb->ops->async != NULL);
 }
 
 int
-serial_is_async_p (serial_t scb)
+serial_is_async_p (struct serial *scb)
 {
   return (scb->ops->async != NULL) && (scb->async_handler != NULL);
 }
 
 void
-serial_async (serial_t scb,
+serial_async (struct serial *scb,
              serial_event_ftype *handler,
              void *context)
 {
@@ -506,7 +505,7 @@ serial_async (serial_t scb,
 }
 
 int
-deprecated_serial_fd (serial_t scb)
+deprecated_serial_fd (struct serial *scb)
 {
   /* FIXME: should this output a warning that deprecated code is being
      called? */
@@ -519,23 +518,22 @@ deprecated_serial_fd (serial_t scb)
 }
 
 void
-serial_debug (serial_t scb, int debug_p)
+serial_debug (struct serial *scb, int debug_p)
 {
   scb->debug_p = debug_p;
 }
 
 int
-serial_debug_p (serial_t scb)
+serial_debug_p (struct serial *scb)
 {
   return scb->debug_p || global_serial_debug_p;
 }
 
 
 #if 0
-/*
-   The connect command is #if 0 because I hadn't thought of an elegant
-   way to wait for I/O on two serial_t's simultaneously.  Two solutions
-   came to mind:
+/* The connect command is #if 0 because I hadn't thought of an elegant
+   way to wait for I/O on two `struct serial *'s simultaneously.  Two
+   solutions came to mind:
 
    1) Fork, and have have one fork handle the to user direction,
    and have the other hand the to target direction.  This
@@ -545,13 +543,12 @@ serial_debug_p (serial_t scb)
    the target side can both be waited on via the same
    mechanism.  This may not be true for DOS, if GDB is
    talking to the target via a TCP socket.
-   -grossman, 8 Jun 93
- */
+   -grossman, 8 Jun 93 */
 
 /* Connect the user directly to the remote system.  This command acts just like
    the 'cu' or 'tip' command.  Use <CR>~. or <CR>~^D to break out.  */
 
-static serial_t tty_desc;      /* Controlling terminal */
+static struct serial *tty_desc;        /* Controlling terminal */
 
 static void
 cleanup_tty (serial_ttystate ttystate)
@@ -568,7 +565,7 @@ connect_command (char *args, int fromtty)
   int c;
   char cur_esc = 0;
   serial_ttystate ttystate;
-  serial_t port_desc;          /* TTY port */
+  struct serial *port_desc;            /* TTY port */
 
   dont_repeat ();
 
index 0a8df3cfb7501293efce1014b1ada3add0d98e92..1863d21cab1054966fec6e6806762493889a827b 100644 (file)
 
 typedef void *serial_ttystate;
 struct serial;
-typedef struct serial *serial_t;
 
-/* Try to open NAME.  Returns a new serial_t on success, NULL on
-   failure. */
+/* Try to open NAME.  Returns a new `struct serial *' on success, NULL
+   on failure. */
 
-extern serial_t serial_open (const char *name);
+extern struct serial *serial_open (const char *name);
 #define SERIAL_OPEN(NAME) serial_open(NAME)
 
 /* Open a new serial stream using a file handle.  */
 
-extern serial_t serial_fdopen (const int fd);
+extern struct serial *serial_fdopen (const int fd);
 #define SERIAL_FDOPEN(FD) serial_fdopen(FD)
 
-/* Push out all buffers, close the device and destroy SERIAL_T. */
+/* Push out all buffers, close the device and destroy SCB. */
 
-extern void serial_close (serial_t);
+extern void serial_close (struct serial *scb);
 #define SERIAL_CLOSE(SERIAL_T) serial_close ((SERIAL_T))
 
-/* Push out all buffers and destroy SERIAL_T without closing the
-   device.  */
+/* Push out all buffers and destroy SCB without closing the device.  */
 
-extern void serial_un_fdopen (serial_t scb);
+extern void serial_un_fdopen (struct serial *scb);
 #define SERIAL_UN_FDOPEN(SERIAL_T) serial_un_fdopen ((SERIAL_T))
 
 /* Read one char from the serial device with TIMEOUT seconds to wait
@@ -70,50 +68,50 @@ enum serial_rc {
                           things like the line dropping dead. */
 };
 
-extern int serial_readchar (serial_t scb, int timeout);
+extern int serial_readchar (struct serial *scb, int timeout);
 #define SERIAL_READCHAR(SERIAL_T, TIMEOUT) serial_readchar ((SERIAL_T), (TIMEOUT))
 
-/* Write LEN chars from STRING to the port SERIAL_T.  Returns 0 for
+/* Write LEN chars from STRING to the port SCB.  Returns 0 for
    success, non-zero for failure.  */
 
-extern int serial_write (serial_t scb, const char *str, int len);
+extern int serial_write (struct serial *scb, const char *str, int len);
 #define SERIAL_WRITE(SERIAL_T, STRING,LEN)  serial_write (SERIAL_T, STRING, LEN)
 
 /* Write a printf style string onto the serial port. */
 
-extern void serial_printf (serial_t desc, const char *,...) ATTR_FORMAT (printf, 2, 3);
+extern void serial_printf (struct serial *desc, const char *,...) ATTR_FORMAT (printf, 2, 3);
 
 /* Allow pending output to drain. */
 
-extern int serial_drain_output (serial_t);
+extern int serial_drain_output (struct serial *);
 #define SERIAL_DRAIN_OUTPUT(SERIAL_T) serial_drain_output ((SERIAL_T))
 
 /* Flush (discard) pending output.  Might also flush input (if this
    system can't flush only output).  */
 
-extern int serial_flush_output (serial_t);
+extern int serial_flush_output (struct serial *);
 #define SERIAL_FLUSH_OUTPUT(SERIAL_T) serial_flush_output ((SERIAL_T))
 
 /* Flush pending input.  Might also flush output (if this system can't
    flush only input).  */
 
-extern int serial_flush_input (serial_t);
+extern int serial_flush_input (struct serial *);
 #define SERIAL_FLUSH_INPUT(SERIAL_T) serial_flush_input ((SERIAL_T))
 
 /* Send a break between 0.25 and 0.5 seconds long.  */
 
-extern int serial_send_break (serial_t scb);
+extern int serial_send_break (struct serial *scb);
 #define SERIAL_SEND_BREAK(SERIAL_T) serial_send_break (SERIAL_T)
 
 /* Turn the port into raw mode. */
 
-extern void serial_raw (serial_t scb);
+extern void serial_raw (struct serial *scb);
 #define SERIAL_RAW(SERIAL_T) serial_raw ((SERIAL_T))
 
 /* Return a pointer to a newly malloc'd ttystate containing the state
    of the tty.  */
 
-extern serial_ttystate serial_get_tty_state (serial_t scb);
+extern serial_ttystate serial_get_tty_state (struct serial *scb);
 #define SERIAL_GET_TTY_STATE(SERIAL_T) serial_get_tty_state ((SERIAL_T))
 
 /* Set the state of the tty to TTYSTATE.  The change is immediate.
@@ -121,14 +119,14 @@ extern serial_ttystate serial_get_tty_state (serial_t scb);
    Returns 0 for success, negative value for error (in which case
    errno contains the error).  */
 
-extern int serial_set_tty_state (serial_t scb, serial_ttystate ttystate);
+extern int serial_set_tty_state (struct serial *scb, serial_ttystate ttystate);
 #define SERIAL_SET_TTY_STATE(SERIAL_T, TTYSTATE) serial_set_tty_state ((SERIAL_T), (TTYSTATE))
 
 /* printf_filtered a user-comprehensible description of ttystate on
    the specified STREAM. FIXME: At present this sends output to the
    default stream - GDB_STDOUT. */
 
-extern void serial_print_tty_state (serial_t scb, serial_ttystate ttystate, struct ui_file *);
+extern void serial_print_tty_state (struct serial *scb, serial_ttystate ttystate, struct ui_file *);
 #define SERIAL_PRINT_TTY_STATE(SERIAL_T, TTYSTATE, STREAM) serial_print_tty_state ((SERIAL_T), (TTYSTATE), (STREAM))
 
 /* Set the tty state to NEW_TTYSTATE, where OLD_TTYSTATE is the
@@ -137,14 +135,14 @@ extern void serial_print_tty_state (serial_t scb, serial_ttystate ttystate, stru
    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 (serial_t scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate);
+extern int serial_noflush_set_tty_state (struct serial *scb, serial_ttystate new_ttystate, serial_ttystate old_ttystate);
 #define SERIAL_NOFLUSH_SET_TTY_STATE(SERIAL_T, NEW_TTYSTATE, OLD_TTYSTATE) \
 serial_noflush_set_tty_state ((SERIAL_T), (NEW_TTYSTATE), (OLD_TTYSTATE))
 
 /* Set the baudrate to the decimal value supplied.  Returns 0 for
    success, -1 for failure.  */
 
-extern int serial_setbaudrate (serial_t scb, int rate);
+extern int serial_setbaudrate (struct serial *scb, int rate);
 #define SERIAL_SETBAUDRATE(SERIAL_T, RATE) serial_setbaudrate ((SERIAL_T), (RATE))
 
 /* Set the number of stop bits to the value specified.  Returns 0 for
@@ -154,27 +152,27 @@ extern int serial_setbaudrate (serial_t scb, int rate);
 #define SERIAL_1_AND_A_HALF_STOPBITS 2 /* 1.5 bits, snicker... */
 #define SERIAL_2_STOPBITS 3
 
-extern int serial_setstopbits (serial_t scb, int num);
+extern int serial_setstopbits (struct serial *scb, int num);
 #define SERIAL_SETSTOPBITS(SERIAL_T, NUM) serial_setstopbits ((SERIAL_T), (NUM))
 
 /* Asynchronous serial interface: */
 
 /* Can the serial device support asynchronous mode? */
 
-extern int serial_can_async_p (serial_t scb);
+extern int serial_can_async_p (struct serial *scb);
 #define SERIAL_CAN_ASYNC_P(SERIAL_T) serial_can_async_p ((SERIAL_T))
 
 /* Has the serial device been put in asynchronous mode? */
 
-extern int serial_is_async_p (serial_t scb);
+extern int serial_is_async_p (struct serial *scb);
 #define SERIAL_IS_ASYNC_P(SERIAL_T) serial_is_async_p ((SERIAL_T))
 
 /* For ASYNC enabled devices, register a callback and enable
    asynchronous mode.  To disable asynchronous mode, register a NULL
    callback. */
 
-typedef void (serial_event_ftype) (serial_t scb, void *context);
-extern void serial_async (serial_t scb, serial_event_ftype *handler, void *context);
+typedef void (serial_event_ftype) (struct serial *scb, void *context);
+extern void serial_async (struct serial *scb, serial_event_ftype *handler, void *context);
 #define SERIAL_ASYNC(SERIAL_T, HANDLER, CONTEXT) serial_async ((SERIAL_T), (HANDLER), (CONTEXT)) 
 
 /* Provide direct access to the underlying FD (if any) used to
@@ -182,7 +180,7 @@ extern void serial_async (serial_t scb, serial_event_ftype *handler, void *conte
    deprecated. Will call internal_error() if the operation isn't
    applicable to the current serial device. */
 
-extern int deprecated_serial_fd (serial_t scb);
+extern int deprecated_serial_fd (struct serial *scb);
 #define DEPRECATED_SERIAL_FD(SERIAL_T) deprecated_serial_fd ((SERIAL_T))
 
 /* Trace/debug mechanism.
@@ -190,10 +188,10 @@ extern int deprecated_serial_fd (serial_t scb);
    SERIAL_DEBUG() enables/disables internal debugging.
    SERIAL_DEBUG_P() indicates the current debug state. */
 
-extern void serial_debug (serial_t scb, int debug_p);
+extern void serial_debug (struct serial *scb, int debug_p);
 #define SERIAL_DEBUG(SERIAL_T, DEBUG_P) serial_debug ((SERIAL_T), (DEBUG_P))
 
-extern int serial_debug_p (serial_t scb);
+extern int serial_debug_p (struct serial *scb);
 #define SERIAL_DEBUG_P(SERIAL_T) serial_debug_p ((SERIAL_T))
 
 
@@ -215,7 +213,7 @@ struct serial
                                   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 serial_t */
+    struct serial *next;       /* Pointer to the next `struct serial *' */
     int refcnt;                        /* Number of pointers to this block */
     int debug_p;               /* Trace this serial devices operation. */
     int async_state;           /* Async internal state. */
@@ -227,28 +225,30 @@ struct serial_ops
   {
     char *name;
     struct serial_ops *next;
-    int (*open) (serial_t, const char *name);
-    void (*close) (serial_t);
-    int (*readchar) (serial_t, int timeout);
-    int (*write) (serial_t, const char *str, int len);
+    int (*open) (struct serial *, const char *name);
+    void (*close) (struct serial *);
+    int (*readchar) (struct serial *, int timeout);
+    int (*write) (struct serial *, const char *str, int len);
     /* Discard pending output */
-    int (*flush_output) (serial_t);
+    int (*flush_output) (struct serial *);
     /* Discard pending input */
-    int (*flush_input) (serial_t);
-    int (*send_break) (serial_t);
-    void (*go_raw) (serial_t);
-    serial_ttystate (*get_tty_state) (serial_t);
-    int (*set_tty_state) (serial_t, serial_ttystate);
-    void (*print_tty_state) (serial_t, serial_ttystate, struct ui_file *);
-    int (*noflush_set_tty_state) (serial_t, serial_ttystate, serial_ttystate);
-    int (*setbaudrate) (serial_t, int rate);
-    int (*setstopbits) (serial_t, int num);
+    int (*flush_input) (struct serial *);
+    int (*send_break) (struct serial *);
+    void (*go_raw) (struct serial *);
+    serial_ttystate (*get_tty_state) (struct serial *);
+    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);
     /* Wait for output to drain */
-    int (*drain_output) (serial_t);
+    int (*drain_output) (struct serial *);
     /* Change the serial device into/out of asynchronous mode, call
        the specified function when ever there is something
        interesting. */
-    void (*async) (serial_t scb, int async_p);
+    void (*async) (struct serial *scb, int async_p);
   };
 
 /* Add a new serial interface to the interface list */
index c0f26df38a689476c65aad2363a63f2b350afca1..b47031e34be6aec922ecbe8ef4267b27e4627362 100644 (file)
@@ -28,7 +28,7 @@
 #include "arch-utils.h"
 #include "regcache.h"
 
-static serial_t parallel;
+static struct serial *parallel;
 static int parallel_in_use;
 
 static void sh3_open (char *args, int from_tty);
@@ -120,7 +120,7 @@ sh3_supply_register (char *regname, int regnamelen, char *val, int vallen)
 }
 
 static void
-sh3_load (serial_t desc, char *file, int hashmark)
+sh3_load (struct serial *desc, char *file, int hashmark)
 {
   if (parallel_in_use)
     {
index a910d0c7cde124d963f88d5bbd9722a07c2bb6d3..9c2cb6bf751af792ea57be73c508754e347fa5a9 100644 (file)
 static struct target_ops sparclite_ops;
 
 static char *remote_target_name = NULL;
-static serial_t remote_desc = NULL;
+static struct serial *remote_desc = NULL;
 static int serial_flag;
 #ifdef HAVE_SOCKETS
 static int udp_fd = -1;
 #endif
 
-static serial_t open_tty (char *name);
-static int send_resp (serial_t desc, char c);
+static struct serial *open_tty (char *name);
+static int send_resp (struct serial *desc, char c);
 static void close_tty (void * ignore);
 #ifdef HAVE_SOCKETS
 static int recv_udp_buf (int fd, unsigned char *buf, int len, int timeout);
@@ -259,10 +259,10 @@ sparclite_stopped_data_address (void)
     return 0;
 }
 \f
-static serial_t
+static struct serial *
 open_tty (char *name)
 {
-  serial_t desc;
+  struct serial *desc;
 
   desc = SERIAL_OPEN (name);
   if (!desc)
@@ -287,7 +287,7 @@ open_tty (char *name)
 /* Read a single character from the remote end, masking it down to 7 bits. */
 
 static int
-readchar (serial_t desc, int timeout)
+readchar (struct serial *desc, int timeout)
 {
   int ch;
   char s[10];
@@ -313,7 +313,7 @@ readchar (serial_t desc, int timeout)
 }
 
 static void
-debug_serial_write (serial_t desc, char *buf, int len)
+debug_serial_write (struct serial *desc, char *buf, int len)
 {
   char s[10];
 
@@ -331,7 +331,7 @@ debug_serial_write (serial_t desc, char *buf, int len)
 
 
 static int
-send_resp (serial_t desc, char c)
+send_resp (struct serial *desc, char c)
 {
   debug_serial_write (desc, &c, 1);
   return readchar (desc, remote_timeout);
index 937e57c4e168fe5c41d37edceab5672734749948..ea2c1580cedd3b84993c59ba95b901e8cbd64cfd 100644 (file)
@@ -105,7 +105,7 @@ sparclet_supply_register (char *regname, int regnamelen, char *val, int vallen)
 }
 
 static void
-sparclet_load (serial_t desc, char *file, int hashmark)
+sparclet_load (struct serial *desc, char *file, int hashmark)
 {
   bfd *abfd;
   asection *s;
index 97c39261e53307f686b48bf16299c39d2ee8f241..d2d9876da4c1c5bd86750885db988fcd7d24aad4 100644 (file)
@@ -18,7 +18,7 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-void load_srec (serial_t desc, const char *file, bfd_vma load_offset,
+void load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
                int maxrecsize, int flags, int hashmark,
                int (*waitack) (void));
 
index 855f474c9f523774bf3acb69ca73f13d27f3543d..a4adb86c79ab7dc88bbc7f27b60eb7ca806adeb2 100644 (file)
@@ -825,7 +825,7 @@ print_sys_errmsg (char *string, int errcode)
 void
 quit (void)
 {
-  serial_t gdb_stdout_serial = serial_fdopen (1);
+  struct serial *gdb_stdout_serial = serial_fdopen (1);
 
   target_terminal_ours ();
 
index ec9e2e75e1e22cb965ef079d4e5fea016749f6dd..331358bce2185dc50f3b140a26b1192c93802511 100644 (file)
@@ -160,7 +160,7 @@ static int hashmark = 1;    /* flag set by "set hash" */
 extern struct monitor_ops w89k_cmds;   /* fwd decl */
 
 static void
-w89k_load (serial_t desc, char *file, int hashmark)
+w89k_load (struct serial *desc, char *file, int hashmark)
 {
   bfd *abfd;
   asection *s;
index 1ed9138f9c6dc5cc7324eb817924ffc36b372b59..c428bc8e8e15b07b258856d4745375ab65b8e710 100644 (file)
@@ -36,7 +36,7 @@ static int blknum;            /* XMODEM block number */
 static int crcflag;            /* Sez we are using CRC's instead of cksums */
 
 static int
-readchar (serial_t desc, int timeout)
+readchar (struct serial *desc, int timeout)
 {
   int c;
 
@@ -109,7 +109,7 @@ docrc (unsigned char *p, int len)
    send NAK or CRC request.  */
 
 int
-xmodem_init_xfer (serial_t desc)
+xmodem_init_xfer (struct serial *desc)
 {
   int c;
   int i;
@@ -160,7 +160,7 @@ xmodem_init_xfer (serial_t desc)
  */
 
 void
-xmodem_send_packet (serial_t desc, unsigned char *packet, int len, int hashmark)
+xmodem_send_packet (struct serial *desc, unsigned char *packet, int len, int hashmark)
 {
   int i;
   int retries;
@@ -246,7 +246,7 @@ xmodem_send_packet (serial_t desc, unsigned char *packet, int len, int hashmark)
 /* Finish off the transfer.  Send out the EOT, and wait for an ACK.  */
 
 void
-xmodem_finish_xfer (serial_t desc)
+xmodem_finish_xfer (struct serial *desc)
 {
   int retries;
 
index e753c5128433385dc6e1679b79e00b24e62330c2..86c5008d159a2ba899b71fbeaeb8a6fffef0aab6 100644 (file)
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-int xmodem_init_xfer (serial_t desc);
-void send_xmodem_packet (serial_t desc, unsigned char *packet, int len,
+int xmodem_init_xfer (struct serial *desc);
+void send_xmodem_packet (struct serial *desc, unsigned char *packet, int len,
                         int hashmark);
-void xmodem_finish_xfer (serial_t desc);
+void xmodem_finish_xfer (struct serial *desc);
 
 #define XMODEM_DATASIZE        128     /* The data size is ALWAYS 128 */
 #define XMODEM_1KDATASIZE 1024 /* Unless it's 1024!!! */