" #ident "@(#)terminfo:cvt.ex 1.2" " " CDDL HEADER START " " The contents of this file are subject to the terms of the " Common Development and Distribution License, Version 1.0 only " (the "License"). You may not use this file except in compliance " with the License. " " You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE " or http://www.opensolaris.org/os/licensing. " See the License for the specific language governing permissions " and limitations under the License. " " When distributing Covered Code, include this CDDL HEADER in each " file and include the License file at usr/src/OPENSOLARIS.LICENSE. " If applicable, add the following below this CDDL HEADER, with the " fields enclosed by brackets "[]" replaced with your own identifying " information: Portions Copyright [yyyy] [name of copyright owner] " " CDDL HEADER END " " Defend against files with spaces instead of tabs g/^ *:/s/^ */ / " Clean out all junk lines, making them into comments. v/^[# A-Za-z]/s/^/# / g/^[ A-Za-z].*[^\\:]$/s/^/# / " Get rid of capabilities on the first line. g/^[a-zA-Z].|.*:.*:/s/:/:\\\ / " Change colons to commas, with appropriate white space v/^#/s/,/\\054/g v/^#/s/:/, /g v/^#/s/^ , / / v/^#/s/, \\$/,/ " Get rid of two letter codes g/^[a-zA-Z].|/s///|s/$/HEADER/ " Change names of capabilities - this list to be updated from caps v/^#/s/\/mir/g v/^#/s/\/msgr/g v/^#/s/\/ht=^I/g v/^#/s/\/xsb/g v/^#/s/\/xenl/g v/^#/s/\/xon/g v/^#/s/\/xhp/g v/^#/s/\/cols/g v/^#/s/\/lines/g v/^#/s/\/xmc/g v/^#/s/\/il/g v/^#/s/\/CC/g v/^#/s/\/dl/g v/^#/s/\/cud/g v/^#/s/\/cub/g v/^#/s/\/cuf/g v/^#/s/\/cuu/g v/^#/s/\/smacs/g v/^#/s/\/il1/g v/^#/s/\/rmacs/g v/^#/s/\/bel/g v/^#/s/\/cbt/g v/^#/s/\/el/g v/^#/s/\/hpa/g v/^#/s/\/clear/g v/^#/s/\/cup/g v/^#/s/\/csr/g v/^#/s/\/tbc/g v/^#/s/\/vpa/g v/^#/s/\/dch1/g v/^#/s/\/dl1/g v/^#/s/\/smdc/g v/^#/s/\/cud1/g v/^#/s/\/rmdc/g v/^#/s/\/ed/g v/^#/s/\/rmir/g v/^#/s/\/fsl/g v/^#/s/\/home/g v/^#/s/\/is2/g v/^#/s/\/ich1/g v/^#/s/\/smir/g v/^#/s/\/kf0/g v/^#/s/\/kf1/g v/^#/s/\/kf2/g v/^#/s/\/kf3/g v/^#/s/\/kf4/g v/^#/s/\/kf5/g v/^#/s/\/kf6/g v/^#/s/\/kf7/g v/^#/s/\/kf8/g v/^#/s/\/kf9/g v/^#/s/\/kil1/g v/^#/s/\/kclr/g v/^#/s/\/kdch/g v/^#/s/\/kel/g v/^#/s/\/kind/g v/^#/s/\/kich1/g v/^#/s/\/kdl1/g v/^#/s/\/krmir/g v/^#/s/\/knp/g v/^#/s/\/kpp/g v/^#/s/\/kri/g v/^#/s/\/ked/g v/^#/s/\/khts/g v/^#/s/\/ktbc/g v/^#/s/\/kbs/g v/^#/s/\/kcud1/g v/^#/s/\/rmkx/g v/^#/s/\/khome/g v/^#/s/\/kcub1/g v/^#/s/\/kcuf1/g v/^#/s/\/smkx/g v/^#/s/\/kctab/g v/^#/s/\/kcuu1/g v/^#/s/\/lf0/g v/^#/s/\/lf1/g v/^#/s/\/lf2/g v/^#/s/\/lf3/g v/^#/s/\/lf4/g v/^#/s/\/lf5/g v/^#/s/\/lf6/g v/^#/s/\/lf7/g v/^#/s/\/lf8/g v/^#/s/\/lf9/g v/^#/s/\/cub1=^H/g v/^#/s/\/cub1/g v/^#/s/\/blink/g v/^#/s/\/bold/g v/^#/s/\/sgr0/g v/^#/s/\/dim/g v/^#/s/\/blank/g v/^#/s/\/prot/g v/^#/s/\/rev/g v/^#/s/\/cuf1/g v/^#/s/\/nel/g v/^#/s/\/pad/g v/^#/s/\/mc4/g v/^#/s/\/mc5/g v/^#/s/\/mc0/g v/^#/s/\/rs2/g v/^#/s/\/rep/g v/^#/s/\/cuf1/g v/^#/s/\/sgr/g v/^#/s/\/rmso/g v/^#/s/\/ind/g v/^#/s/\/smso/g v/^#/s/\/ri/g v/^#/s/\/hts/g v/^#/s/\/ht/g v/^#/s/\/rmcup/g v/^#/s/\/smcup/g v/^#/s/\/tsl/g v/^#/s/\/rmul/g v/^#/s/\/cuu1/g v/^#/s/\/smul/g v/^#/s/\/flash/g v/^#/s/\/cnorm/g v/^#/s/\/civis/g v/^#/s/\/cvvis/g v/^#/s/\/wind/g " Deal with changes in default rules g/HEADER/s/$/\ cr=^M, cud1=^J, ind=^J, bel=^G, $a # junk . g/HEADER/+,/^[^ ]/-!fmt g/HEADER/s/// g/\,/s///|?cr=^M, ?s/// g/\,/s///|?ind=^J, ?s/// " Still should do something about the cr=, nl=, tab= capabilities. " Change parameterized strings v/^#/s/%\./%p1%c/ v/^#/s/%\./%p2%c/ v/^#/s/%\./%p1%c/ v/^#/s/%\./%p2%c/ v/^#/s/%d/%p1%DECIMAL/ v/^#/s/%d/%p2%DECIMAL/ v/^#/s/%d/%p1%DECIMAL/ v/^#/s/%d/%p2%DECIMAL/ v/^#/s/DECIMAL/d/g v/^#/s/%+\([^%]\)/%p1%'\1'%+%c/ v/^#/s/%+\([^%]\)/%p2%'\1'%+%c/ v/^#/s/%+\([^%]\)/%p1%'\1'%+%c/ v/^#/s/%+\([^%]\)/%p2%'\1'%+%c/ $g/^# junk$/d w q