summaryrefslogtreecommitdiff
path: root/term/main.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-02-10 18:05:56 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-02-10 18:05:56 +0000
commit15395557e2aaf3ec9c86ba15d14e0c08a9a86405 (patch)
tree67094453cf3eb3139d0bea4fb30f03fcb330b39d /term/main.c
parentaf107a198dce152da74590f2eec5a320002c0f82 (diff)
2002-02-10 Marcus Brinkmann <marcus@gnu.org>
* 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.
Diffstat (limited to 'term/main.c')
-rw-r--r--term/main.c15
1 files changed, 14 insertions, 1 deletions
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;