xref: /titanic_52/usr/src/cmd/vi/port/ex_data.c (revision 3c112a2b34403220c06c3e2fcac403358cfba168)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 /* Copyright (c) 1981 Regents of the University of California */
27 
28 /*
29  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
30  * Use is subject to license terms.
31  */
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 #include "ex.h"
36 #include "ex_tty.h"
37 
38 /*
39  * Initialization of option values.
40  * The option #defines in ex_vars.h are made
41  * from this file by the script makeoptions.
42  *
43  * These initializations are done char by char instead of as strings
44  * to confuse xstr so it will leave them alone.
45  */
46 unsigned char	direct[ONMSZ] =
47 	{'/', 'v', 'a', 'r', '/', 't', 'm', 'p'};
48 unsigned char	paragraphs[ONMSZ] = {
49 #ifdef XPG4
50 	'I', 'P', 'L', 'P', 'P', 'P', 'Q', 'P',		/* -ms macros */
51 	'P', ' ', 'L', 'I',				/* -mm macros */
52 	'p', 'p', 'l', 'p', 'i', 'p',			/* -me macros */
53 	'b', 'p'					/* bare nroff */
54 #else /* ! XPG4 */
55 	'I', 'P', 'L', 'P', 'P', 'P', 'Q', 'P',		/* -ms macros */
56 	'P', ' ', 'L', 'I',				/* -mm macros */
57 	'p', 'p', 'l', 'p', 'i', 'p', 'n', 'p',		/* -me macros */
58 	'p', 'p', 'l', 'p', 'i', 'p',			/* -me macros */
59 	'b', 'p'					/* bare nroff */
60 #endif
61 };
62 unsigned char	sections[ONMSZ] = {
63 #ifdef XPG4
64 	'N', 'H', 'S', 'H',				/* -ms macros */
65 	'H', ' ', 'H', 'U',				/* -mm macros */
66 	'u', 'h', 's', 'h'				/* -me macros */
67 #else /* ! XPG4 */
68 	'N', 'H', 'S', 'H',				/* -ms macros */
69 	'H', ' ', 'H', 'U',				/* -mm macros */
70 	'u', 'h', 's', 'h', '+', 'c'			/* -me macros */
71 #endif
72 };
73 unsigned char	shell[ONMSZ] = {
74 #ifdef XPG4
75 	'/', 'u', 's', 'r', '/', 'x', 'p', 'g', '4', '/',
76 	'b', 'i', 'n', '/', 's', 'h'
77 };
78 #else /* ! XPG4 */
79 	'/', 'b', 'i', 'n', '/', 's', 'h'
80 };
81 #endif /* XPG4 */
82 unsigned char	tags[ONMSZ] = {
83 	't', 'a', 'g', 's', ' ',
84 	'/', 'u', 's', 'r', '/', 'l', 'i', 'b', '/', 't', 'a', 'g', 's'
85 };
86 unsigned char termtype[ONMSZ];
87 
88 struct	option options[vi_NOPTS + 1] = {
89 	(unsigned char *)"autoindent",	(unsigned char *)"ai",	ONOFF,		0,	0,	0,
90 	(unsigned char *)"autoprint",	(unsigned char *)"ap",	ONOFF,		1,	1,	0,
91 	(unsigned char *)"autowrite",	(unsigned char *)"aw",	ONOFF,		0,	0,	0,
92 	(unsigned char *)"beautify",	(unsigned char *)"bf",	ONOFF,		0,	0,	0,
93 	(unsigned char *)"directory",	(unsigned char *)"dir",	STRING,		0,	0,	direct,
94 	(unsigned char *)"edcompatible",	(unsigned char *)"ed",	ONOFF,		0,	0,	0,
95 	(unsigned char *)"errorbells",	(unsigned char *)"eb",	ONOFF,		0,	0,	0,
96 	(unsigned char *)"exrc",	(unsigned char *)"ex",	ONOFF,		0,	0,	0,
97 	(unsigned char *)"flash",	(unsigned char *)"fl",	ONOFF,		1,	1,	0,
98 	(unsigned char *)"hardtabs",	(unsigned char *)"ht",	NUMERIC,	8,	8,	0,
99 	(unsigned char *)"ignorecase",	(unsigned char *)"ic",	ONOFF,		0,	0,	0,
100 	(unsigned char *)"lisp",		0,	ONOFF,		0,	0,	0,
101 	(unsigned char *)"list",		0,	ONOFF,		0,	0,	0,
102 	(unsigned char *)"magic",	0,	ONOFF,		1,	1,	0,
103 	(unsigned char *)"mesg",		0,	ONOFF,		1,	1,	0,
104 	(unsigned char *)"modelines",	(unsigned char *)"ml",	ONOFF,		0,	0,	0,
105 	(unsigned char *)"number",	(unsigned char *)"nu",	ONOFF,		0,	0,	0,
106 	(unsigned char *)"novice",	0,	ONOFF,		0,	0,	0,
107 	(unsigned char *)"optimize",	(unsigned char *)"opt",	ONOFF,		0,	0,	0,
108 	(unsigned char *)"paragraphs",	(unsigned char *)"para",	STRING,		0,	0,	paragraphs,
109 	(unsigned char *)"prompt",	0,	ONOFF,		1,	1,	0,
110 	(unsigned char *)"readonly",	(unsigned char *)"ro",	ONOFF,		0,	0,	0,
111 	(unsigned char *)"redraw",	0,	ONOFF,		0,	0,	0,
112 	(unsigned char *)"remap",	0,	ONOFF,		1,	1,	0,
113 	(unsigned char *)"report",	0,	NUMERIC,	5,	5,	0,
114 	(unsigned char *)"scroll",	(unsigned char *)"scr",	NUMERIC,	12,	12,	0,
115 	(unsigned char *)"sections",	(unsigned char *)"sect",	STRING,		0,	0,	sections,
116 	(unsigned char *)"shell",	(unsigned char *)"sh",	STRING,		0,	0,	shell,
117 	(unsigned char *)"shiftwidth",	(unsigned char *)"sw",	NUMERIC,	TABS,	TABS,	0,
118 	(unsigned char *)"showmatch",	(unsigned char *)"sm",	ONOFF,		0,	0,	0,
119 	(unsigned char *)"showmode",	(unsigned char *)"smd",	ONOFF,		0,	0,	0,
120 	(unsigned char *)"slowopen",	(unsigned char *)"slow",	ONOFF,		0,	0,	0,
121 	(unsigned char *)"tabstop",	(unsigned char *)"ts",	NUMERIC,	TABS,	TABS,	0,
122 	(unsigned char *)"taglength",	(unsigned char *)"tl",	NUMERIC,	0,	0,	0,
123 	(unsigned char *)"tags",		(unsigned char *)"tag",	STRING,		0,	0,	tags,
124 #ifdef TAG_STACK
125         (unsigned char *)"tagstack",     (unsigned char *)"tgst", ONOFF,          1,      1,      0,
126 #endif
127 	(unsigned char *)"term",		0,	OTERM,		0,	0,	termtype,
128 	(unsigned char *)"terse",	0,	ONOFF,		0,	0,	0,
129 	(unsigned char *)"timeout",	(unsigned char *)"to",	ONOFF,		1,	1,	0,
130 	(unsigned char *)"ttytype",	(unsigned char *)"tty",	OTERM,		0,	0,	termtype,
131 	(unsigned char *)"warn",		0,	ONOFF,		1,	1,	0,
132 	(unsigned char *)"window",	(unsigned char *)"wi",	NUMERIC,	23,	23,	0,
133 	(unsigned char *)"wrapscan",	(unsigned char *)"ws",	ONOFF,		1,	1,	0,
134 	(unsigned char *)"wrapmargin",	(unsigned char *)"wm",	NUMERIC,	0,	0,	0,
135 	(unsigned char *)"writeany",	(unsigned char *)"wa",	ONOFF,		0,	0,	0,
136 	0,		0,	0,		0,	0,	0,
137 };
138