xref: /illumos-gate/usr/src/cmd/vi/port/ex_data.c (revision 08855964b9970604433f7b19dcd71cf5af5e5f14)
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 #include "ex.h"
34 #include "ex_tty.h"
35 
36 /*
37  * Initialization of option values.
38  * The option #defines in ex_vars.h are made
39  * from this file by the script makeoptions.
40  *
41  * These initializations are done char by char instead of as strings
42  * to confuse xstr so it will leave them alone.
43  */
44 unsigned char	direct[ONMSZ] =
45 	{'/', 'v', 'a', 'r', '/', 't', 'm', 'p'};
46 unsigned char	paragraphs[ONMSZ] = {
47 #ifdef XPG4
48 	'I', 'P', 'L', 'P', 'P', 'P', 'Q', 'P',		/* -ms macros */
49 	'P', ' ', 'L', 'I',				/* -mm macros */
50 	'p', 'p', 'l', 'p', 'i', 'p',			/* -me macros */
51 	'b', 'p'					/* bare nroff */
52 #else /* ! XPG4 */
53 	'I', 'P', 'L', 'P', 'P', 'P', 'Q', 'P',		/* -ms macros */
54 	'P', ' ', 'L', 'I',				/* -mm macros */
55 	'p', 'p', 'l', 'p', 'i', 'p', 'n', 'p',		/* -me macros */
56 	'p', 'p', 'l', 'p', 'i', 'p',			/* -me macros */
57 	'b', 'p'					/* bare nroff */
58 #endif
59 };
60 unsigned char	sections[ONMSZ] = {
61 #ifdef XPG4
62 	'N', 'H', 'S', 'H',				/* -ms macros */
63 	'H', ' ', 'H', 'U',				/* -mm macros */
64 	'u', 'h', 's', 'h'				/* -me macros */
65 #else /* ! XPG4 */
66 	'N', 'H', 'S', 'H',				/* -ms macros */
67 	'H', ' ', 'H', 'U',				/* -mm macros */
68 	'u', 'h', 's', 'h', '+', 'c'			/* -me macros */
69 #endif
70 };
71 unsigned char	shell[ONMSZ] = {
72 #ifdef XPG4
73 	'/', 'u', 's', 'r', '/', 'x', 'p', 'g', '4', '/',
74 	'b', 'i', 'n', '/', 's', 'h'
75 };
76 #else /* ! XPG4 */
77 	'/', 'b', 'i', 'n', '/', 's', 'h'
78 };
79 #endif /* XPG4 */
80 unsigned char	tags[ONMSZ] = {
81 	't', 'a', 'g', 's', ' ',
82 	'/', 'u', 's', 'r', '/', 'l', 'i', 'b', '/', 't', 'a', 'g', 's'
83 };
84 unsigned char termtype[ONMSZ];
85 
86 struct	option options[vi_NOPTS + 1] = {
87 	(unsigned char *)"autoindent",	(unsigned char *)"ai",	ONOFF,		0,	0,	0,
88 	(unsigned char *)"autoprint",	(unsigned char *)"ap",	ONOFF,		1,	1,	0,
89 	(unsigned char *)"autowrite",	(unsigned char *)"aw",	ONOFF,		0,	0,	0,
90 	(unsigned char *)"beautify",	(unsigned char *)"bf",	ONOFF,		0,	0,	0,
91 	(unsigned char *)"directory",	(unsigned char *)"dir",	STRING,		0,	0,	direct,
92 	(unsigned char *)"edcompatible",	(unsigned char *)"ed",	ONOFF,		0,	0,	0,
93 	(unsigned char *)"errorbells",	(unsigned char *)"eb",	ONOFF,		0,	0,	0,
94 	(unsigned char *)"exrc",	(unsigned char *)"ex",	ONOFF,		0,	0,	0,
95 	(unsigned char *)"flash",	(unsigned char *)"fl",	ONOFF,		1,	1,	0,
96 	(unsigned char *)"hardtabs",	(unsigned char *)"ht",	NUMERIC,	8,	8,	0,
97 	(unsigned char *)"ignorecase",	(unsigned char *)"ic",	ONOFF,		0,	0,	0,
98 	(unsigned char *)"lisp",		0,	ONOFF,		0,	0,	0,
99 	(unsigned char *)"list",		0,	ONOFF,		0,	0,	0,
100 	(unsigned char *)"magic",	0,	ONOFF,		1,	1,	0,
101 	(unsigned char *)"mesg",		0,	ONOFF,		1,	1,	0,
102 	(unsigned char *)"modelines",	(unsigned char *)"ml",	ONOFF,		0,	0,	0,
103 	(unsigned char *)"number",	(unsigned char *)"nu",	ONOFF,		0,	0,	0,
104 	(unsigned char *)"novice",	0,	ONOFF,		0,	0,	0,
105 	(unsigned char *)"optimize",	(unsigned char *)"opt",	ONOFF,		0,	0,	0,
106 	(unsigned char *)"paragraphs",	(unsigned char *)"para",	STRING,		0,	0,	paragraphs,
107 	(unsigned char *)"prompt",	0,	ONOFF,		1,	1,	0,
108 	(unsigned char *)"readonly",	(unsigned char *)"ro",	ONOFF,		0,	0,	0,
109 	(unsigned char *)"redraw",	0,	ONOFF,		0,	0,	0,
110 	(unsigned char *)"remap",	0,	ONOFF,		1,	1,	0,
111 	(unsigned char *)"report",	0,	NUMERIC,	5,	5,	0,
112 	(unsigned char *)"scroll",	(unsigned char *)"scr",	NUMERIC,	12,	12,	0,
113 	(unsigned char *)"sections",	(unsigned char *)"sect",	STRING,		0,	0,	sections,
114 	(unsigned char *)"shell",	(unsigned char *)"sh",	STRING,		0,	0,	shell,
115 	(unsigned char *)"shiftwidth",	(unsigned char *)"sw",	NUMERIC,	TABS,	TABS,	0,
116 	(unsigned char *)"showmatch",	(unsigned char *)"sm",	ONOFF,		0,	0,	0,
117 	(unsigned char *)"showmode",	(unsigned char *)"smd",	ONOFF,		0,	0,	0,
118 	(unsigned char *)"slowopen",	(unsigned char *)"slow",	ONOFF,		0,	0,	0,
119 	(unsigned char *)"tabstop",	(unsigned char *)"ts",	NUMERIC,	TABS,	TABS,	0,
120 	(unsigned char *)"taglength",	(unsigned char *)"tl",	NUMERIC,	0,	0,	0,
121 	(unsigned char *)"tags",		(unsigned char *)"tag",	STRING,		0,	0,	tags,
122 #ifdef TAG_STACK
123         (unsigned char *)"tagstack",     (unsigned char *)"tgst", ONOFF,          1,      1,      0,
124 #endif
125 	(unsigned char *)"term",		0,	OTERM,		0,	0,	termtype,
126 	(unsigned char *)"terse",	0,	ONOFF,		0,	0,	0,
127 	(unsigned char *)"timeout",	(unsigned char *)"to",	ONOFF,		1,	1,	0,
128 	(unsigned char *)"ttytype",	(unsigned char *)"tty",	OTERM,		0,	0,	termtype,
129 	(unsigned char *)"warn",		0,	ONOFF,		1,	1,	0,
130 	(unsigned char *)"window",	(unsigned char *)"wi",	NUMERIC,	23,	23,	0,
131 	(unsigned char *)"wrapscan",	(unsigned char *)"ws",	ONOFF,		1,	1,	0,
132 	(unsigned char *)"wrapmargin",	(unsigned char *)"wm",	NUMERIC,	0,	0,	0,
133 	(unsigned char *)"writeany",	(unsigned char *)"wa",	ONOFF,		0,	0,	0,
134 	0,		0,	0,		0,	0,	0,
135 };
136