From 15395557e2aaf3ec9c86ba15d14e0c08a9a86405 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sun, 10 Feb 2002 18:05:56 +0000 Subject: 2002-02-10 Marcus Brinkmann * hurdio.c: New file. * Makefile (SRCS): Add hurdio.c. * term.h: Add hurdio_bottom declaration. * main.c: Add T_HURDIO to enum of tty_type. (parse_opt): Add case for hurdio bottom handler. (term_argp): Likewise. (main): Likewise. --- term/main.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'term/main.c') diff --git a/term/main.c b/term/main.c index 5e90e28e..b0a80658 100644 --- a/term/main.c +++ b/term/main.c @@ -41,7 +41,7 @@ int trivfs_allow_open = O_READ|O_WRITE; /* The argument line options. */ char *tty_name; -enum { T_NONE = 0, T_DEVICE, T_PTYMASTER, T_PTYSLAVE } tty_type; +enum { T_NONE = 0, T_DEVICE, T_HURDIO, T_PTYMASTER, T_PTYSLAVE } tty_type; char *tty_arg; int @@ -76,6 +76,8 @@ parse_opt (int opt, char *arg, struct argp_state *state) { if (!strcmp (arg, "device")) tty_type = T_DEVICE; + else if (!strcmp (arg, "hurdio")) + tty_type = T_HURDIO; else if (!strcmp (arg, "pty-master")) tty_type = T_PTYMASTER; else if (!strcmp (arg, "pty-slave")) @@ -100,6 +102,7 @@ static struct argp term_argp = { 0, parse_opt, "NAME TYPE ARG", "A translator that emulates a terminal.\v"\ "Possible values for TYPE:\n"\ " device Use Mach device ARG as bottom handler.\n"\ + " hurdio Use file port ARG as bottom handler.\n"\ " pty-master Master for slave at ARG.\n"\ " pty-slave Slave for master at ARG.\n"\ "\n"\ @@ -140,6 +143,16 @@ main (int argc, char **argv) peercntl = 0; break; + case T_HURDIO: + bottom = &hurdio_bottom; + ourclass = tty_class; + ourcntlclass = tty_cntl_class; + ourcntl = &termctl; + peerclass = 0; + peercntlclass = 0; + peercntl = 0; + break; + case T_PTYMASTER: bottom = &ptyio_bottom; ourclass = pty_class; -- cgit v1.2.3