xref: /onnv-gate/usr/src/cmd/terminfo/cvt.ex (revision 0:68f95e015346)
1" #ident	"@(#)terminfo:cvt.ex	1.2"
2"
3" CDDL HEADER START
4"
5" The contents of this file are subject to the terms of the
6" Common Development and Distribution License, Version 1.0 only
7" (the "License").  You may not use this file except in compliance
8" with the License.
9"
10" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11" or http://www.opensolaris.org/os/licensing.
12" See the License for the specific language governing permissions
13" and limitations under the License.
14"
15" When distributing Covered Code, include this CDDL HEADER in each
16" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17" If applicable, add the following below this CDDL HEADER, with the
18" fields enclosed by brackets "[]" replaced with your own identifying
19" information: Portions Copyright [yyyy] [name of copyright owner]
20"
21" CDDL HEADER END
22"
23" Defend against files with spaces instead of tabs
24g/^  *:/s/^ */	/
25" Clean out all junk lines, making them into comments.
26v/^[#	A-Za-z]/s/^/# /
27g/^[	A-Za-z].*[^\\:]$/s/^/# /
28" Get rid of capabilities on the first line.
29g/^[a-zA-Z].|.*:.*:/s/:/:\\\
30	/
31" Change colons to commas, with appropriate white space
32v/^#/s/,/\\054/g
33v/^#/s/:/, /g
34v/^#/s/^	, /	/
35v/^#/s/, \\$/,/
36" Get rid of two letter codes
37g/^[a-zA-Z].|/s///|s/$/HEADER/
38" Change names of capabilities - this list to be updated from caps
39v/^#/s/\<mi\>/mir/g
40v/^#/s/\<ms\>/msgr/g
41v/^#/s/\<pt\>/ht=^I/g
42v/^#/s/\<xb\>/xsb/g
43v/^#/s/\<xn\>/xenl/g
44v/^#/s/\<xo\>/xon/g
45v/^#/s/\<xs\>/xhp/g
46v/^#/s/\<co\>/cols/g
47v/^#/s/\<li\>/lines/g
48v/^#/s/\<sg\>/xmc/g
49v/^#/s/\<AL\>/il/g
50v/^#/s/\<CC\>/CC/g
51v/^#/s/\<DL\>/dl/g
52v/^#/s/\<DO\>/cud/g
53v/^#/s/\<LE\>/cub/g
54v/^#/s/\<RI\>/cuf/g
55v/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s/g
105v/^#/s/\<kd\>/kcud1/g
106v/^#/s/\<ke\>/rmkx/g
107v/^#/s/\<kh\>/khome/g
108v/^#/s/\<kl\>/kcub1/g
109v/^#/s/\<kr\>/kcuf1/g
110v/^#/s/\<ks\>/smkx/g
111v/^#/s/\<kt\>/kctab/g
112v/^#/s/\<ku\>/kcuu1/g
113v/^#/s/\<l0\>/lf0/g
114v/^#/s/\<l1\>/lf1/g
115v/^#/s/\<l2\>/lf2/g
116v/^#/s/\<l3\>/lf3/g
117v/^#/s/\<l4\>/lf4/g
118v/^#/s/\<l5\>/lf5/g
119v/^#/s/\<l6\>/lf6/g
120v/^#/s/\<l7\>/lf7/g
121v/^#/s/\<l8\>/lf8/g
122v/^#/s/\<l9\>/lf9/g
123v/^#/s/\<bs\>/cub1=^H/g
124v/^#/s/\<bc\>/cub1/g
125v/^#/s/\<mb\>/blink/g
126v/^#/s/\<md\>/bold/g
127v/^#/s/\<me\>/sgr0/g
128v/^#/s/\<mh\>/dim/g
129v/^#/s/\<mk\>/blank/g
130v/^#/s/\<mp\>/prot/g
131v/^#/s/\<mr\>/rev/g
132v/^#/s/\<nd\>/cuf1/g
133v/^#/s/\<nw\>/nel/g
134v/^#/s/\<pc\>/pad/g
135v/^#/s/\<pf\>/mc4/g
136v/^#/s/\<po\>/mc5/g
137v/^#/s/\<ps\>/mc0/g
138v/^#/s/\<rs\>/rs2/g
139v/^#/s/\<rp\>/rep/g
140v/^#/s/\<ri\>/cuf1/g
141v/^#/s/\<sa\>/sgr/g
142v/^#/s/\<se\>/rmso/g
143v/^#/s/\<sf\>/ind/g
144v/^#/s/\<so\>/smso/g
145v/^#/s/\<sr\>/ri/g
146v/^#/s/\<st\>/hts/g
147v/^#/s/\<ta\>/ht/g
148v/^#/s/\<te\>/rmcup/g
149v/^#/s/\<ti\>/smcup/g
150v/^#/s/\<ts\>/tsl/g
151v/^#/s/\<ue\>/rmul/g
152v/^#/s/\<up\>/cuu1/g
153v/^#/s/\<us\>/smul/g
154v/^#/s/\<vb\>/flash/g
155v/^#/s/\<ve\>/cnorm/g
156v/^#/s/\<vi\>/civis/g
157v/^#/s/\<vs\>/cvvis/g
158v/^#/s/\<wi\>/wind/g
159" Deal with changes in default rules
160g/HEADER/s/$/\
161	cr=^M, cud1=^J, ind=^J, bel=^G,
162$a
163# junk
164.
165g/HEADER/+,/^[^	]/-!fmt
166g/HEADER/s///
167g/\<nc\>,/s///|?cr=^M, ?s///
168g/\<ns\>,/s///|?ind=^J, ?s///
169" Still should do something about the cr=, nl=, tab= capabilities.
170" Change parameterized strings
171v/^#/s/%\./%p1%c/
172v/^#/s/%\./%p2%c/
173v/^#/s/%\./%p1%c/
174v/^#/s/%\./%p2%c/
175v/^#/s/%d/%p1%DECIMAL/
176v/^#/s/%d/%p2%DECIMAL/
177v/^#/s/%d/%p1%DECIMAL/
178v/^#/s/%d/%p2%DECIMAL/
179v/^#/s/DECIMAL/d/g
180v/^#/s/%+\([^%]\)/%p1%'\1'%+%c/
181v/^#/s/%+\([^%]\)/%p2%'\1'%+%c/
182v/^#/s/%+\([^%]\)/%p1%'\1'%+%c/
183v/^#/s/%+\([^%]\)/%p2%'\1'%+%c/
184$g/^# junk$/d
185w
186q
187