xref: /freebsd/libexec/getty/init.c (revision ea022d1687fe11220adeb9cacec1f8d0333e970a)
1ea022d16SRodney W. Grimes /*
2ea022d16SRodney W. Grimes  * Copyright (c) 1983, 1993
3ea022d16SRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
4ea022d16SRodney W. Grimes  *
5ea022d16SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
6ea022d16SRodney W. Grimes  * modification, are permitted provided that the following conditions
7ea022d16SRodney W. Grimes  * are met:
8ea022d16SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
9ea022d16SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
10ea022d16SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
11ea022d16SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
12ea022d16SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
13ea022d16SRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
14ea022d16SRodney W. Grimes  *    must display the following acknowledgement:
15ea022d16SRodney W. Grimes  *	This product includes software developed by the University of
16ea022d16SRodney W. Grimes  *	California, Berkeley and its contributors.
17ea022d16SRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
18ea022d16SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
19ea022d16SRodney W. Grimes  *    without specific prior written permission.
20ea022d16SRodney W. Grimes  *
21ea022d16SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22ea022d16SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23ea022d16SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24ea022d16SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25ea022d16SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26ea022d16SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27ea022d16SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28ea022d16SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29ea022d16SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30ea022d16SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31ea022d16SRodney W. Grimes  * SUCH DAMAGE.
32ea022d16SRodney W. Grimes  */
33ea022d16SRodney W. Grimes 
34ea022d16SRodney W. Grimes #ifndef lint
35ea022d16SRodney W. Grimes static char sccsid[] = "@(#)init.c	8.1 (Berkeley) 6/4/93";
36ea022d16SRodney W. Grimes #endif /* not lint */
37ea022d16SRodney W. Grimes 
38ea022d16SRodney W. Grimes /*
39ea022d16SRodney W. Grimes  * Getty table initializations.
40ea022d16SRodney W. Grimes  *
41ea022d16SRodney W. Grimes  * Melbourne getty.
42ea022d16SRodney W. Grimes  */
43ea022d16SRodney W. Grimes #include <sgtty.h>
44ea022d16SRodney W. Grimes #include "gettytab.h"
45ea022d16SRodney W. Grimes #include "pathnames.h"
46ea022d16SRodney W. Grimes 
47ea022d16SRodney W. Grimes extern	struct sgttyb tmode;
48ea022d16SRodney W. Grimes extern	struct tchars tc;
49ea022d16SRodney W. Grimes extern	struct ltchars ltc;
50ea022d16SRodney W. Grimes extern	char hostname[];
51ea022d16SRodney W. Grimes 
52ea022d16SRodney W. Grimes struct	gettystrs gettystrs[] = {
53ea022d16SRodney W. Grimes 	{ "nx" },			/* next table */
54ea022d16SRodney W. Grimes 	{ "cl" },			/* screen clear characters */
55ea022d16SRodney W. Grimes 	{ "im" },			/* initial message */
56ea022d16SRodney W. Grimes 	{ "lm", "login: " },		/* login message */
57ea022d16SRodney W. Grimes 	{ "er", &tmode.sg_erase },	/* erase character */
58ea022d16SRodney W. Grimes 	{ "kl", &tmode.sg_kill },	/* kill character */
59ea022d16SRodney W. Grimes 	{ "et", &tc.t_eofc },		/* eof chatacter (eot) */
60ea022d16SRodney W. Grimes 	{ "pc", "" },			/* pad character */
61ea022d16SRodney W. Grimes 	{ "tt" },			/* terminal type */
62ea022d16SRodney W. Grimes 	{ "ev" },			/* enviroment */
63ea022d16SRodney W. Grimes 	{ "lo", _PATH_LOGIN },		/* login program */
64ea022d16SRodney W. Grimes 	{ "hn", hostname },		/* host name */
65ea022d16SRodney W. Grimes 	{ "he" },			/* host name edit */
66ea022d16SRodney W. Grimes 	{ "in", &tc.t_intrc },		/* interrupt char */
67ea022d16SRodney W. Grimes 	{ "qu", &tc.t_quitc },		/* quit char */
68ea022d16SRodney W. Grimes 	{ "xn", &tc.t_startc },		/* XON (start) char */
69ea022d16SRodney W. Grimes 	{ "xf", &tc.t_stopc },		/* XOFF (stop) char */
70ea022d16SRodney W. Grimes 	{ "bk", &tc.t_brkc },		/* brk char (alt \n) */
71ea022d16SRodney W. Grimes 	{ "su", &ltc.t_suspc },		/* suspend char */
72ea022d16SRodney W. Grimes 	{ "ds", &ltc.t_dsuspc },	/* delayed suspend */
73ea022d16SRodney W. Grimes 	{ "rp", &ltc.t_rprntc },	/* reprint char */
74ea022d16SRodney W. Grimes 	{ "fl", &ltc.t_flushc },	/* flush output */
75ea022d16SRodney W. Grimes 	{ "we", &ltc.t_werasc },	/* word erase */
76ea022d16SRodney W. Grimes 	{ "ln", &ltc.t_lnextc },	/* literal next */
77ea022d16SRodney W. Grimes 	{ 0 }
78ea022d16SRodney W. Grimes };
79ea022d16SRodney W. Grimes 
80ea022d16SRodney W. Grimes struct	gettynums gettynums[] = {
81ea022d16SRodney W. Grimes 	{ "is" },			/* input speed */
82ea022d16SRodney W. Grimes 	{ "os" },			/* output speed */
83ea022d16SRodney W. Grimes 	{ "sp" },			/* both speeds */
84ea022d16SRodney W. Grimes 	{ "nd" },			/* newline delay */
85ea022d16SRodney W. Grimes 	{ "cd" },			/* carriage-return delay */
86ea022d16SRodney W. Grimes 	{ "td" },			/* tab delay */
87ea022d16SRodney W. Grimes 	{ "fd" },			/* form-feed delay */
88ea022d16SRodney W. Grimes 	{ "bd" },			/* backspace delay */
89ea022d16SRodney W. Grimes 	{ "to" },			/* timeout */
90ea022d16SRodney W. Grimes 	{ "f0" },			/* output flags */
91ea022d16SRodney W. Grimes 	{ "f1" },			/* input flags */
92ea022d16SRodney W. Grimes 	{ "f2" },			/* user mode flags */
93ea022d16SRodney W. Grimes 	{ "pf" },			/* delay before flush at 1st prompt */
94ea022d16SRodney W. Grimes 	{ 0 }
95ea022d16SRodney W. Grimes };
96ea022d16SRodney W. Grimes 
97ea022d16SRodney W. Grimes struct	gettyflags gettyflags[] = {
98ea022d16SRodney W. Grimes 	{ "ht",	0 },			/* has tabs */
99ea022d16SRodney W. Grimes 	{ "nl",	1 },			/* has newline char */
100ea022d16SRodney W. Grimes 	{ "ep",	0 },			/* even parity */
101ea022d16SRodney W. Grimes 	{ "op",	0 },			/* odd parity */
102ea022d16SRodney W. Grimes 	{ "ap",	0 },			/* any parity */
103ea022d16SRodney W. Grimes 	{ "ec",	1 },			/* no echo */
104ea022d16SRodney W. Grimes 	{ "co",	0 },			/* console special */
105ea022d16SRodney W. Grimes 	{ "cb",	0 },			/* crt backspace */
106ea022d16SRodney W. Grimes 	{ "ck",	0 },			/* crt kill */
107ea022d16SRodney W. Grimes 	{ "ce",	0 },			/* crt erase */
108ea022d16SRodney W. Grimes 	{ "pe",	0 },			/* printer erase */
109ea022d16SRodney W. Grimes 	{ "rw",	1 },			/* don't use raw */
110ea022d16SRodney W. Grimes 	{ "xc",	1 },			/* don't ^X ctl chars */
111ea022d16SRodney W. Grimes 	{ "lc",	0 },			/* terminal las lower case */
112ea022d16SRodney W. Grimes 	{ "uc",	0 },			/* terminal has no lower case */
113ea022d16SRodney W. Grimes 	{ "ig",	0 },			/* ignore garbage */
114ea022d16SRodney W. Grimes 	{ "ps",	0 },			/* do port selector speed select */
115ea022d16SRodney W. Grimes 	{ "hc",	1 },			/* don't set hangup on close */
116ea022d16SRodney W. Grimes 	{ "ub", 0 },			/* unbuffered output */
117ea022d16SRodney W. Grimes 	{ "ab", 0 },			/* auto-baud detect with '\r' */
118ea022d16SRodney W. Grimes 	{ "dx", 0 },			/* set decctlq */
119ea022d16SRodney W. Grimes 	{ "np", 0 },			/* no parity at all (8bit chars) */
120ea022d16SRodney W. Grimes 	{ 0 }
121ea022d16SRodney W. Grimes };
122