- /* Now register the serial port driver. */
- ops = XMALLOC (struct serial_ops);
- memset (ops, 0, sizeof (struct serial_ops));
- ops->name = "hardwire";
- ops->next = 0;
- ops->open = ser_windows_open;
- ops->close = ser_windows_close;
-
- ops->flush_output = ser_windows_flush_output;
- ops->flush_input = ser_windows_flush_input;
- ops->send_break = ser_windows_send_break;
-
- /* These are only used for stdin; we do not need them for serial
- ports, so supply the standard dummies. */
- 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->go_raw = ser_windows_raw;
- ops->setbaudrate = ser_windows_setbaudrate;
- ops->setstopbits = ser_windows_setstopbits;
- ops->drain_output = ser_windows_drain_output;
- ops->readchar = ser_base_readchar;
- ops->write = ser_base_write;
- ops->async = ser_base_async;
- ops->read_prim = ser_windows_read_prim;
- ops->write_prim = ser_windows_write_prim;
- ops->wait_handle = ser_windows_wait_handle;
-
- serial_add_interface (ops);
-
- /* Next create the dummy serial driver used for terminals. We only
- provide the TTY-related methods. */
-
- ops = XMALLOC (struct serial_ops);
- memset (ops, 0, sizeof (struct serial_ops));
-
- ops->name = "terminal";
- ops->next = 0;
-
- ops->close = ser_console_close;
- ops->get_tty_state = ser_console_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->drain_output = ser_base_drain_output;
- ops->wait_handle = ser_console_wait_handle;
- ops->done_wait_handle = ser_console_done_wait_handle;
-
- serial_add_interface (ops);
-
- /* The pipe interface. */
-
- ops = XMALLOC (struct serial_ops);
- memset (ops, 0, sizeof (struct serial_ops));
- ops->name = "pipe";
- ops->next = 0;
- ops->open = pipe_windows_open;
- ops->close = pipe_windows_close;
- ops->fdopen = pipe_windows_fdopen;
- ops->readchar = ser_base_readchar;
- 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;
- ops->read_prim = pipe_windows_read;
- ops->write_prim = pipe_windows_write;
- ops->wait_handle = pipe_wait_handle;
- ops->done_wait_handle = pipe_done_wait_handle;
- ops->avail = pipe_avail;
-
- serial_add_interface (ops);