xref: /original-bsd/libexec/getty/init.c (revision 3d751ffd)
1 /*
2  * Copyright (c) 1983 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  */
17 
18 #ifndef lint
19 static char sccsid[] = "@(#)init.c	5.3 (Berkeley) 02/27/89";
20 #endif /* not lint */
21 
22 /*
23  * Getty table initializations.
24  *
25  * Melbourne getty.
26  */
27 #include <sgtty.h>
28 #include "gettytab.h"
29 
30 extern	struct sgttyb tmode;
31 extern	struct tchars tc;
32 extern	struct ltchars ltc;
33 extern	char hostname[];
34 
35 struct	gettystrs gettystrs[] = {
36 	{ "nx" },			/* next table */
37 	{ "cl" },			/* screen clear characters */
38 	{ "im" },			/* initial message */
39 	{ "lm", "login: " },		/* login message */
40 	{ "er", &tmode.sg_erase },	/* erase character */
41 	{ "kl", &tmode.sg_kill },	/* kill character */
42 	{ "et", &tc.t_eofc },		/* eof chatacter (eot) */
43 	{ "pc", "" },			/* pad character */
44 	{ "tt" },			/* terminal type */
45 	{ "ev" },			/* enviroment */
46 	{ "lo", "/bin/login" },		/* login program */
47 	{ "hn", hostname },		/* host name */
48 	{ "he" },			/* host name edit */
49 	{ "in", &tc.t_intrc },		/* interrupt char */
50 	{ "qu", &tc.t_quitc },		/* quit char */
51 	{ "xn", &tc.t_startc },		/* XON (start) char */
52 	{ "xf", &tc.t_stopc },		/* XOFF (stop) char */
53 	{ "bk", &tc.t_brkc },		/* brk char (alt \n) */
54 	{ "su", &ltc.t_suspc },		/* suspend char */
55 	{ "ds", &ltc.t_dsuspc },	/* delayed suspend */
56 	{ "rp", &ltc.t_rprntc },	/* reprint char */
57 	{ "fl", &ltc.t_flushc },	/* flush output */
58 	{ "we", &ltc.t_werasc },	/* word erase */
59 	{ "ln", &ltc.t_lnextc },	/* literal next */
60 	{ 0 }
61 };
62 
63 struct	gettynums gettynums[] = {
64 	{ "is" },			/* input speed */
65 	{ "os" },			/* output speed */
66 	{ "sp" },			/* both speeds */
67 	{ "nd" },			/* newline delay */
68 	{ "cd" },			/* carriage-return delay */
69 	{ "td" },			/* tab delay */
70 	{ "fd" },			/* form-feed delay */
71 	{ "bd" },			/* backspace delay */
72 	{ "to" },			/* timeout */
73 	{ "f0" },			/* output flags */
74 	{ "f1" },			/* input flags */
75 	{ "f2" },			/* user mode flags */
76 	{ "pf" },			/* delay before flush at 1st prompt */
77 	{ 0 }
78 };
79 
80 struct	gettyflags gettyflags[] = {
81 	{ "ht",	0 },			/* has tabs */
82 	{ "nl",	1 },			/* has newline char */
83 	{ "ep",	0 },			/* even parity */
84 	{ "op",	0 },			/* odd parity */
85 	{ "ap",	0 },			/* any parity */
86 	{ "ec",	1 },			/* no echo */
87 	{ "co",	0 },			/* console special */
88 	{ "cb",	0 },			/* crt backspace */
89 	{ "ck",	0 },			/* crt kill */
90 	{ "ce",	0 },			/* crt erase */
91 	{ "pe",	0 },			/* printer erase */
92 	{ "rw",	1 },			/* don't use raw */
93 	{ "xc",	1 },			/* don't ^X ctl chars */
94 	{ "lc",	0 },			/* terminal las lower case */
95 	{ "uc",	0 },			/* terminal has no lower case */
96 	{ "ig",	0 },			/* ignore garbage */
97 	{ "ps",	0 },			/* do port selector speed select */
98 	{ "hc",	1 },			/* don't set hangup on close */
99 	{ "ub", 0 },			/* unbuffered output */
100 	{ "ab", 0 },			/* auto-baud detect with '\r' */
101 	{ "dx", 0 },			/* set decctlq */
102 	{ 0 }
103 };
104