xref: /illumos-gate/usr/src/cmd/vi/port/ex_data.c (revision 2a8bcb4e)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
237c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /* Copyright (c) 1981 Regents of the University of California */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*
297c478bd9Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
307c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
317c478bd9Sstevel@tonic-gate  */
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #include "ex.h"
347c478bd9Sstevel@tonic-gate #include "ex_tty.h"
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate /*
377c478bd9Sstevel@tonic-gate  * Initialization of option values.
387c478bd9Sstevel@tonic-gate  * The option #defines in ex_vars.h are made
397c478bd9Sstevel@tonic-gate  * from this file by the script makeoptions.
407c478bd9Sstevel@tonic-gate  *
417c478bd9Sstevel@tonic-gate  * These initializations are done char by char instead of as strings
427c478bd9Sstevel@tonic-gate  * to confuse xstr so it will leave them alone.
437c478bd9Sstevel@tonic-gate  */
447c478bd9Sstevel@tonic-gate unsigned char	direct[ONMSZ] =
45*2a8bcb4eSToomas Soome 	{'/', 'v', 'a', 'r', '/', 't', 'm', 'p'};
467c478bd9Sstevel@tonic-gate unsigned char	paragraphs[ONMSZ] = {
477c478bd9Sstevel@tonic-gate #ifdef XPG4
487c478bd9Sstevel@tonic-gate 	'I', 'P', 'L', 'P', 'P', 'P', 'Q', 'P',		/* -ms macros */
497c478bd9Sstevel@tonic-gate 	'P', ' ', 'L', 'I',				/* -mm macros */
507c478bd9Sstevel@tonic-gate 	'p', 'p', 'l', 'p', 'i', 'p',			/* -me macros */
517c478bd9Sstevel@tonic-gate 	'b', 'p'					/* bare nroff */
527c478bd9Sstevel@tonic-gate #else /* ! XPG4 */
537c478bd9Sstevel@tonic-gate 	'I', 'P', 'L', 'P', 'P', 'P', 'Q', 'P',		/* -ms macros */
547c478bd9Sstevel@tonic-gate 	'P', ' ', 'L', 'I',				/* -mm macros */
557c478bd9Sstevel@tonic-gate 	'p', 'p', 'l', 'p', 'i', 'p', 'n', 'p',		/* -me macros */
567c478bd9Sstevel@tonic-gate 	'p', 'p', 'l', 'p', 'i', 'p',			/* -me macros */
577c478bd9Sstevel@tonic-gate 	'b', 'p'					/* bare nroff */
587c478bd9Sstevel@tonic-gate #endif
597c478bd9Sstevel@tonic-gate };
607c478bd9Sstevel@tonic-gate unsigned char	sections[ONMSZ] = {
617c478bd9Sstevel@tonic-gate #ifdef XPG4
627c478bd9Sstevel@tonic-gate 	'N', 'H', 'S', 'H',				/* -ms macros */
637c478bd9Sstevel@tonic-gate 	'H', ' ', 'H', 'U',				/* -mm macros */
647c478bd9Sstevel@tonic-gate 	'u', 'h', 's', 'h'				/* -me macros */
657c478bd9Sstevel@tonic-gate #else /* ! XPG4 */
667c478bd9Sstevel@tonic-gate 	'N', 'H', 'S', 'H',				/* -ms macros */
677c478bd9Sstevel@tonic-gate 	'H', ' ', 'H', 'U',				/* -mm macros */
687c478bd9Sstevel@tonic-gate 	'u', 'h', 's', 'h', '+', 'c'			/* -me macros */
697c478bd9Sstevel@tonic-gate #endif
707c478bd9Sstevel@tonic-gate };
717c478bd9Sstevel@tonic-gate unsigned char	shell[ONMSZ] = {
727c478bd9Sstevel@tonic-gate #ifdef XPG4
737c478bd9Sstevel@tonic-gate 	'/', 'u', 's', 'r', '/', 'x', 'p', 'g', '4', '/',
747c478bd9Sstevel@tonic-gate 	'b', 'i', 'n', '/', 's', 'h'
757c478bd9Sstevel@tonic-gate };
767c478bd9Sstevel@tonic-gate #else /* ! XPG4 */
777c478bd9Sstevel@tonic-gate 	'/', 'b', 'i', 'n', '/', 's', 'h'
787c478bd9Sstevel@tonic-gate };
797c478bd9Sstevel@tonic-gate #endif /* XPG4 */
807c478bd9Sstevel@tonic-gate unsigned char	tags[ONMSZ] = {
817c478bd9Sstevel@tonic-gate 	't', 'a', 'g', 's', ' ',
827c478bd9Sstevel@tonic-gate 	'/', 'u', 's', 'r', '/', 'l', 'i', 'b', '/', 't', 'a', 'g', 's'
837c478bd9Sstevel@tonic-gate };
847c478bd9Sstevel@tonic-gate unsigned char termtype[ONMSZ];
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate struct	option options[vi_NOPTS + 1] = {
877c478bd9Sstevel@tonic-gate 	(unsigned char *)"autoindent",	(unsigned char *)"ai",	ONOFF,		0,	0,	0,
887c478bd9Sstevel@tonic-gate 	(unsigned char *)"autoprint",	(unsigned char *)"ap",	ONOFF,		1,	1,	0,
897c478bd9Sstevel@tonic-gate 	(unsigned char *)"autowrite",	(unsigned char *)"aw",	ONOFF,		0,	0,	0,
907c478bd9Sstevel@tonic-gate 	(unsigned char *)"beautify",	(unsigned char *)"bf",	ONOFF,		0,	0,	0,
917c478bd9Sstevel@tonic-gate 	(unsigned char *)"directory",	(unsigned char *)"dir",	STRING,		0,	0,	direct,
927c478bd9Sstevel@tonic-gate 	(unsigned char *)"edcompatible",	(unsigned char *)"ed",	ONOFF,		0,	0,	0,
937c478bd9Sstevel@tonic-gate 	(unsigned char *)"errorbells",	(unsigned char *)"eb",	ONOFF,		0,	0,	0,
947c478bd9Sstevel@tonic-gate 	(unsigned char *)"exrc",	(unsigned char *)"ex",	ONOFF,		0,	0,	0,
957c478bd9Sstevel@tonic-gate 	(unsigned char *)"flash",	(unsigned char *)"fl",	ONOFF,		1,	1,	0,
967c478bd9Sstevel@tonic-gate 	(unsigned char *)"hardtabs",	(unsigned char *)"ht",	NUMERIC,	8,	8,	0,
977c478bd9Sstevel@tonic-gate 	(unsigned char *)"ignorecase",	(unsigned char *)"ic",	ONOFF,		0,	0,	0,
987c478bd9Sstevel@tonic-gate 	(unsigned char *)"lisp",		0,	ONOFF,		0,	0,	0,
997c478bd9Sstevel@tonic-gate 	(unsigned char *)"list",		0,	ONOFF,		0,	0,	0,
1007c478bd9Sstevel@tonic-gate 	(unsigned char *)"magic",	0,	ONOFF,		1,	1,	0,
1017c478bd9Sstevel@tonic-gate 	(unsigned char *)"mesg",		0,	ONOFF,		1,	1,	0,
1027c478bd9Sstevel@tonic-gate 	(unsigned char *)"modelines",	(unsigned char *)"ml",	ONOFF,		0,	0,	0,
1037c478bd9Sstevel@tonic-gate 	(unsigned char *)"number",	(unsigned char *)"nu",	ONOFF,		0,	0,	0,
1047c478bd9Sstevel@tonic-gate 	(unsigned char *)"novice",	0,	ONOFF,		0,	0,	0,
1057c478bd9Sstevel@tonic-gate 	(unsigned char *)"optimize",	(unsigned char *)"opt",	ONOFF,		0,	0,	0,
1067c478bd9Sstevel@tonic-gate 	(unsigned char *)"paragraphs",	(unsigned char *)"para",	STRING,		0,	0,	paragraphs,
1077c478bd9Sstevel@tonic-gate 	(unsigned char *)"prompt",	0,	ONOFF,		1,	1,	0,
1087c478bd9Sstevel@tonic-gate 	(unsigned char *)"readonly",	(unsigned char *)"ro",	ONOFF,		0,	0,	0,
1097c478bd9Sstevel@tonic-gate 	(unsigned char *)"redraw",	0,	ONOFF,		0,	0,	0,
1107c478bd9Sstevel@tonic-gate 	(unsigned char *)"remap",	0,	ONOFF,		1,	1,	0,
1117c478bd9Sstevel@tonic-gate 	(unsigned char *)"report",	0,	NUMERIC,	5,	5,	0,
1127c478bd9Sstevel@tonic-gate 	(unsigned char *)"scroll",	(unsigned char *)"scr",	NUMERIC,	12,	12,	0,
1137c478bd9Sstevel@tonic-gate 	(unsigned char *)"sections",	(unsigned char *)"sect",	STRING,		0,	0,	sections,
1147c478bd9Sstevel@tonic-gate 	(unsigned char *)"shell",	(unsigned char *)"sh",	STRING,		0,	0,	shell,
1157c478bd9Sstevel@tonic-gate 	(unsigned char *)"shiftwidth",	(unsigned char *)"sw",	NUMERIC,	TABS,	TABS,	0,
1167c478bd9Sstevel@tonic-gate 	(unsigned char *)"showmatch",	(unsigned char *)"sm",	ONOFF,		0,	0,	0,
1177c478bd9Sstevel@tonic-gate 	(unsigned char *)"showmode",	(unsigned char *)"smd",	ONOFF,		0,	0,	0,
1187c478bd9Sstevel@tonic-gate 	(unsigned char *)"slowopen",	(unsigned char *)"slow",	ONOFF,		0,	0,	0,
1197c478bd9Sstevel@tonic-gate 	(unsigned char *)"tabstop",	(unsigned char *)"ts",	NUMERIC,	TABS,	TABS,	0,
1207c478bd9Sstevel@tonic-gate 	(unsigned char *)"taglength",	(unsigned char *)"tl",	NUMERIC,	0,	0,	0,
1217c478bd9Sstevel@tonic-gate 	(unsigned char *)"tags",		(unsigned char *)"tag",	STRING,		0,	0,	tags,
1227c478bd9Sstevel@tonic-gate #ifdef TAG_STACK
1237c478bd9Sstevel@tonic-gate         (unsigned char *)"tagstack",     (unsigned char *)"tgst", ONOFF,          1,      1,      0,
1247c478bd9Sstevel@tonic-gate #endif
1257c478bd9Sstevel@tonic-gate 	(unsigned char *)"term",		0,	OTERM,		0,	0,	termtype,
1267c478bd9Sstevel@tonic-gate 	(unsigned char *)"terse",	0,	ONOFF,		0,	0,	0,
1277c478bd9Sstevel@tonic-gate 	(unsigned char *)"timeout",	(unsigned char *)"to",	ONOFF,		1,	1,	0,
1287c478bd9Sstevel@tonic-gate 	(unsigned char *)"ttytype",	(unsigned char *)"tty",	OTERM,		0,	0,	termtype,
1297c478bd9Sstevel@tonic-gate 	(unsigned char *)"warn",		0,	ONOFF,		1,	1,	0,
1307c478bd9Sstevel@tonic-gate 	(unsigned char *)"window",	(unsigned char *)"wi",	NUMERIC,	23,	23,	0,
1317c478bd9Sstevel@tonic-gate 	(unsigned char *)"wrapscan",	(unsigned char *)"ws",	ONOFF,		1,	1,	0,
1327c478bd9Sstevel@tonic-gate 	(unsigned char *)"wrapmargin",	(unsigned char *)"wm",	NUMERIC,	0,	0,	0,
1337c478bd9Sstevel@tonic-gate 	(unsigned char *)"writeany",	(unsigned char *)"wa",	ONOFF,		0,	0,	0,
1347c478bd9Sstevel@tonic-gate 	0,		0,	0,		0,	0,	0,
1357c478bd9Sstevel@tonic-gate };
136