* ser-base.c (ser_unix_write): Rename to ...
(ser_base_write): ... this. (ser_unix_nop_flush_output): Rename to ... (ser_base_flush_output): ... this. (ser_unix_flush_input): Rename to ... (ser_base_flush_input): ... this. (ser_unix_nop_send_break): Rename to ... (ser_base_send_break): ... this. (ser_unix_nop_drain_output): Rename to ... (ser_base_drain_output): ... this. (ser_unix_nop_raw): Rename to ... (ser_base_raw): ... this. (ser_unix_nop_get_tty_state): Rename to ... (ser_base_set_tty_state): ... this. (ser_unix_nop_noflush_set_tty_state): Rename to ... (ser_base_noflush_set_tty_state): ... this. (ser_unix_nop_print_tty_state): Rename to ... (ser_base_print_tty_state): ... this. (ser_unix_nop_setbaudrate): Rename to ... (ser_base_setbaudrate): ... this. (ser_unix_nop_setstopbits): Rename to ... (ser_base_setstopbits): ... this. (ser_unix_async): Rename to ... (ser_base_async): ... this. * ser-base.h (ser_unix_write): Rename to ... (ser_base_write): ... this. (ser_unix_nop_flush_output): Rename to ... (ser_base_flush_output): ... this. (ser_unix_flush_input): Rename to ... (ser_base_flush_input): ... this. (ser_unix_nop_send_break): Rename to ... (ser_base_send_break): ... this. (ser_unix_nop_drain_output): Rename to ... (ser_base_drain_output): ... this. (ser_unix_nop_raw): Rename to ... (ser_base_raw): ... this. (ser_unix_nop_get_tty_state): Rename to ... (ser_base_set_tty_state): ... this. (ser_unix_nop_noflush_set_tty_state): Rename to ... (ser_base_noflush_set_tty_state): ... this. (ser_unix_nop_print_tty_state): Rename to ... (ser_base_print_tty_state): ... this. (ser_unix_nop_setbaudrate): Rename to ... (ser_base_setbaudrate): ... this. (ser_unix_nop_setstopbits): Rename to ... (ser_base_setstopbits): ... this. (ser_unix_async): Rename to ... (ser_base_async): ... this. * ser-pipe.c (_initialize_ser_pipe): Update accordingly. * ser-tcp.c (_initialize_ser_tcp): Likewise. * ser-unix.c (hardwire_flush_input): Likewise. (_initializer_ser_hardwire): Likewise.
This commit is contained in:
parent
3eb25fda5d
commit
dd5da072a1
6 changed files with 117 additions and 64 deletions
|
@ -1,5 +1,58 @@
|
|||
2005-03-25 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* ser-base.c (ser_unix_write): Rename to ...
|
||||
(ser_base_write): ... this.
|
||||
(ser_unix_nop_flush_output): Rename to ...
|
||||
(ser_base_flush_output): ... this.
|
||||
(ser_unix_flush_input): Rename to ...
|
||||
(ser_base_flush_input): ... this.
|
||||
(ser_unix_nop_send_break): Rename to ...
|
||||
(ser_base_send_break): ... this.
|
||||
(ser_unix_nop_drain_output): Rename to ...
|
||||
(ser_base_drain_output): ... this.
|
||||
(ser_unix_nop_raw): Rename to ...
|
||||
(ser_base_raw): ... this.
|
||||
(ser_unix_nop_get_tty_state): Rename to ...
|
||||
(ser_base_set_tty_state): ... this.
|
||||
(ser_unix_nop_noflush_set_tty_state): Rename to ...
|
||||
(ser_base_noflush_set_tty_state): ... this.
|
||||
(ser_unix_nop_print_tty_state): Rename to ...
|
||||
(ser_base_print_tty_state): ... this.
|
||||
(ser_unix_nop_setbaudrate): Rename to ...
|
||||
(ser_base_setbaudrate): ... this.
|
||||
(ser_unix_nop_setstopbits): Rename to ...
|
||||
(ser_base_setstopbits): ... this.
|
||||
(ser_unix_async): Rename to ...
|
||||
(ser_base_async): ... this.
|
||||
* ser-base.h (ser_unix_write): Rename to ...
|
||||
(ser_base_write): ... this.
|
||||
(ser_unix_nop_flush_output): Rename to ...
|
||||
(ser_base_flush_output): ... this.
|
||||
(ser_unix_flush_input): Rename to ...
|
||||
(ser_base_flush_input): ... this.
|
||||
(ser_unix_nop_send_break): Rename to ...
|
||||
(ser_base_send_break): ... this.
|
||||
(ser_unix_nop_drain_output): Rename to ...
|
||||
(ser_base_drain_output): ... this.
|
||||
(ser_unix_nop_raw): Rename to ...
|
||||
(ser_base_raw): ... this.
|
||||
(ser_unix_nop_get_tty_state): Rename to ...
|
||||
(ser_base_set_tty_state): ... this.
|
||||
(ser_unix_nop_noflush_set_tty_state): Rename to ...
|
||||
(ser_base_noflush_set_tty_state): ... this.
|
||||
(ser_unix_nop_print_tty_state): Rename to ...
|
||||
(ser_base_print_tty_state): ... this.
|
||||
(ser_unix_nop_setbaudrate): Rename to ...
|
||||
(ser_base_setbaudrate): ... this.
|
||||
(ser_unix_nop_setstopbits): Rename to ...
|
||||
(ser_base_setstopbits): ... this.
|
||||
(ser_unix_async): Rename to ...
|
||||
(ser_base_async): ... this.
|
||||
* ser-pipe.c (_initialize_ser_pipe): Update accordingly.
|
||||
* ser-tcp.c (_initialize_ser_tcp): Likewise.
|
||||
* ser-unix.c (hardwire_flush_input): Likewise.
|
||||
(_initializer_ser_hardwire): Likewise.
|
||||
|
||||
* Makefile.in (SFILES): Add ser-base.c.
|
||||
(ser_base_h): New variable.
|
||||
(ser-base.o): New target.
|
||||
|
|
|
@ -175,7 +175,7 @@ push_event (void *context)
|
|||
}
|
||||
|
||||
int
|
||||
ser_unix_write (struct serial *scb, const char *str, int len)
|
||||
ser_base_write (struct serial *scb, const char *str, int len)
|
||||
{
|
||||
int cc;
|
||||
|
||||
|
@ -192,13 +192,13 @@ ser_unix_write (struct serial *scb, const char *str, int len)
|
|||
}
|
||||
|
||||
int
|
||||
ser_unix_nop_flush_output (struct serial *scb)
|
||||
ser_base_flush_output (struct serial *scb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ser_unix_flush_input (struct serial *scb)
|
||||
ser_base_flush_input (struct serial *scb)
|
||||
{
|
||||
if (scb->bufcnt >= 0)
|
||||
{
|
||||
|
@ -211,38 +211,38 @@ ser_unix_flush_input (struct serial *scb)
|
|||
}
|
||||
|
||||
int
|
||||
ser_unix_nop_send_break (struct serial *scb)
|
||||
ser_base_send_break (struct serial *scb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ser_unix_nop_drain_output (struct serial *scb)
|
||||
ser_base_drain_output (struct serial *scb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
ser_unix_nop_raw (struct serial *scb)
|
||||
ser_base_raw (struct serial *scb)
|
||||
{
|
||||
return; /* Always in raw mode */
|
||||
}
|
||||
|
||||
serial_ttystate
|
||||
ser_unix_nop_get_tty_state (struct serial *scb)
|
||||
ser_base_get_tty_state (struct serial *scb)
|
||||
{
|
||||
/* allocate a dummy */
|
||||
return (serial_ttystate) XMALLOC (int);
|
||||
}
|
||||
|
||||
int
|
||||
ser_unix_nop_set_tty_state (struct serial *scb, serial_ttystate ttystate)
|
||||
ser_base_set_tty_state (struct serial *scb, serial_ttystate ttystate)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ser_unix_nop_noflush_set_tty_state (struct serial *scb,
|
||||
ser_base_noflush_set_tty_state (struct serial *scb,
|
||||
serial_ttystate new_ttystate,
|
||||
serial_ttystate old_ttystate)
|
||||
{
|
||||
|
@ -250,7 +250,7 @@ ser_unix_nop_noflush_set_tty_state (struct serial *scb,
|
|||
}
|
||||
|
||||
void
|
||||
ser_unix_nop_print_tty_state (struct serial *scb,
|
||||
ser_base_print_tty_state (struct serial *scb,
|
||||
serial_ttystate ttystate,
|
||||
struct ui_file *stream)
|
||||
{
|
||||
|
@ -259,13 +259,13 @@ ser_unix_nop_print_tty_state (struct serial *scb,
|
|||
}
|
||||
|
||||
int
|
||||
ser_unix_nop_setbaudrate (struct serial *scb, int rate)
|
||||
ser_base_setbaudrate (struct serial *scb, int rate)
|
||||
{
|
||||
return 0; /* Never fails! */
|
||||
}
|
||||
|
||||
int
|
||||
ser_unix_nop_setstopbits (struct serial *scb, int num)
|
||||
ser_base_setstopbits (struct serial *scb, int num)
|
||||
{
|
||||
return 0; /* Never fails! */
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ ser_unix_nop_setstopbits (struct serial *scb, int num)
|
|||
/* Put the SERIAL device into/out-of ASYNC mode. */
|
||||
|
||||
void
|
||||
ser_unix_async (struct serial *scb,
|
||||
ser_base_async (struct serial *scb,
|
||||
int async_p)
|
||||
{
|
||||
if (async_p)
|
||||
|
|
|
@ -26,25 +26,25 @@ struct serial;
|
|||
struct ui_file;
|
||||
|
||||
extern void reschedule (struct serial *scb);
|
||||
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,
|
||||
extern int ser_base_flush_output (struct serial *scb);
|
||||
extern int ser_base_flush_input (struct serial *scb);
|
||||
extern int ser_base_send_break (struct serial *scb);
|
||||
extern void ser_base_raw (struct serial *scb);
|
||||
extern serial_ttystate ser_base_get_tty_state (struct serial *scb);
|
||||
extern int ser_base_set_tty_state (struct serial *scb,
|
||||
serial_ttystate ttystate);
|
||||
extern void ser_unix_nop_print_tty_state (struct serial *scb,
|
||||
extern void ser_base_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,
|
||||
extern int ser_base_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_base_setbaudrate (struct serial *scb, int rate);
|
||||
extern int ser_base_setstopbits (struct serial *scb, int rate);
|
||||
extern int ser_base_drain_output (struct serial *scb);
|
||||
|
||||
extern int ser_unix_write (struct serial *scb, const char *str, int len);
|
||||
extern int ser_base_write (struct serial *scb, const char *str, int len);
|
||||
|
||||
extern void ser_unix_async (struct serial *scb, int async_p);
|
||||
extern void ser_base_async (struct serial *scb, int async_p);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -145,18 +145,18 @@ _initialize_ser_pipe (void)
|
|||
ops->open = pipe_open;
|
||||
ops->close = pipe_close;
|
||||
ops->readchar = ser_unix_readchar;
|
||||
ops->write = ser_unix_write;
|
||||
ops->flush_output = ser_unix_nop_flush_output;
|
||||
ops->flush_input = ser_unix_flush_input;
|
||||
ops->send_break = ser_unix_nop_send_break;
|
||||
ops->go_raw = ser_unix_nop_raw;
|
||||
ops->get_tty_state = ser_unix_nop_get_tty_state;
|
||||
ops->set_tty_state = ser_unix_nop_set_tty_state;
|
||||
ops->print_tty_state = ser_unix_nop_print_tty_state;
|
||||
ops->noflush_set_tty_state = ser_unix_nop_noflush_set_tty_state;
|
||||
ops->setbaudrate = ser_unix_nop_setbaudrate;
|
||||
ops->setstopbits = ser_unix_nop_setstopbits;
|
||||
ops->drain_output = ser_unix_nop_drain_output;
|
||||
ops->async = ser_unix_async;
|
||||
ops->write = ser_base_write;
|
||||
ops->flush_output = ser_base_flush_output;
|
||||
ops->flush_input = ser_base_flush_input;
|
||||
ops->send_break = ser_base_send_break;
|
||||
ops->go_raw = ser_base_raw;
|
||||
ops->get_tty_state = ser_base_get_tty_state;
|
||||
ops->set_tty_state = ser_base_set_tty_state;
|
||||
ops->print_tty_state = ser_base_print_tty_state;
|
||||
ops->noflush_set_tty_state = ser_base_noflush_set_tty_state;
|
||||
ops->setbaudrate = ser_base_setbaudrate;
|
||||
ops->setstopbits = ser_base_setstopbits;
|
||||
ops->drain_output = ser_base_drain_output;
|
||||
ops->async = ser_base_async;
|
||||
serial_add_interface (ops);
|
||||
}
|
||||
|
|
|
@ -216,18 +216,18 @@ _initialize_ser_tcp (void)
|
|||
ops->open = net_open;
|
||||
ops->close = net_close;
|
||||
ops->readchar = ser_unix_readchar;
|
||||
ops->write = ser_unix_write;
|
||||
ops->flush_output = ser_unix_nop_flush_output;
|
||||
ops->flush_input = ser_unix_flush_input;
|
||||
ops->send_break = ser_unix_nop_send_break;
|
||||
ops->go_raw = ser_unix_nop_raw;
|
||||
ops->get_tty_state = ser_unix_nop_get_tty_state;
|
||||
ops->set_tty_state = ser_unix_nop_set_tty_state;
|
||||
ops->print_tty_state = ser_unix_nop_print_tty_state;
|
||||
ops->noflush_set_tty_state = ser_unix_nop_noflush_set_tty_state;
|
||||
ops->setbaudrate = ser_unix_nop_setbaudrate;
|
||||
ops->setstopbits = ser_unix_nop_setstopbits;
|
||||
ops->drain_output = ser_unix_nop_drain_output;
|
||||
ops->async = ser_unix_async;
|
||||
ops->write = ser_base_write;
|
||||
ops->flush_output = ser_base_flush_output;
|
||||
ops->flush_input = ser_base_flush_input;
|
||||
ops->send_break = ser_base_send_break;
|
||||
ops->go_raw = ser_base_raw;
|
||||
ops->get_tty_state = ser_base_get_tty_state;
|
||||
ops->set_tty_state = ser_base_set_tty_state;
|
||||
ops->print_tty_state = ser_base_print_tty_state;
|
||||
ops->noflush_set_tty_state = ser_base_noflush_set_tty_state;
|
||||
ops->setbaudrate = ser_base_setbaudrate;
|
||||
ops->setstopbits = ser_base_setstopbits;
|
||||
ops->drain_output = ser_base_drain_output;
|
||||
ops->async = ser_base_async;
|
||||
serial_add_interface (ops);
|
||||
}
|
||||
|
|
|
@ -329,7 +329,7 @@ hardwire_flush_output (struct serial *scb)
|
|||
static int
|
||||
hardwire_flush_input (struct serial *scb)
|
||||
{
|
||||
ser_unix_flush_input (scb);
|
||||
ser_base_flush_input (scb);
|
||||
|
||||
#ifdef HAVE_TERMIOS
|
||||
return tcflush (scb->fd, TCIFLUSH);
|
||||
|
@ -1062,7 +1062,7 @@ _initialize_ser_hardwire (void)
|
|||
the old TERMIOS/SGTTY/... timer code has been flushed. cagney
|
||||
1999-09-16. */
|
||||
ops->readchar = hardwire_readchar;
|
||||
ops->write = ser_unix_write;
|
||||
ops->write = ser_base_write;
|
||||
ops->flush_output = hardwire_flush_output;
|
||||
ops->flush_input = hardwire_flush_input;
|
||||
ops->send_break = hardwire_send_break;
|
||||
|
@ -1074,6 +1074,6 @@ _initialize_ser_hardwire (void)
|
|||
ops->setbaudrate = hardwire_setbaudrate;
|
||||
ops->setstopbits = hardwire_setstopbits;
|
||||
ops->drain_output = hardwire_drain_output;
|
||||
ops->async = ser_unix_async;
|
||||
ops->async = ser_base_async;
|
||||
serial_add_interface (ops);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue