1*0Sstevel@tonic-gate#ident "%Z%%M% %I% %E% SMI" 2*0Sstevel@tonic-gate# 3*0Sstevel@tonic-gate# CDDL HEADER START 4*0Sstevel@tonic-gate# 5*0Sstevel@tonic-gate# The contents of this file are subject to the terms of the 6*0Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 7*0Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 8*0Sstevel@tonic-gate# with the License. 9*0Sstevel@tonic-gate# 10*0Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11*0Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 12*0Sstevel@tonic-gate# See the License for the specific language governing permissions 13*0Sstevel@tonic-gate# and limitations under the License. 14*0Sstevel@tonic-gate# 15*0Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 16*0Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17*0Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 18*0Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 19*0Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 20*0Sstevel@tonic-gate# 21*0Sstevel@tonic-gate# CDDL HEADER END 22*0Sstevel@tonic-gate# 23*0Sstevel@tonic-gate# 24*0Sstevel@tonic-gate# make options --should be run when adding/deleting options 25*0Sstevel@tonic-gate# This script should be run to create a new 26*0Sstevel@tonic-gate# ex_vars.h (based on information in ex_data.c 27*0Sstevel@tonic-gate# Ex_data.c should be writeable. 28*0Sstevel@tonic-gate# 29*0Sstevel@tonic-gate cp ex_data.c $$.c 30*0Sstevel@tonic-gate# 31*0Sstevel@tonic-gate# write all lines which are not includes to $$.c 32*0Sstevel@tonic-gate# 33*0Sstevel@tonic-gate set -x 34*0Sstevel@tonic-gate ex - $$.c << 'STOP' 35*0Sstevel@tonic-gateg/^#include/d 36*0Sstevel@tonic-gatew 37*0Sstevel@tonic-gateq 38*0Sstevel@tonic-gateSTOP 39*0Sstevel@tonic-gatecc -E $* $$.c > foo.c 40*0Sstevel@tonic-gate# 41*0Sstevel@tonic-gate# use EX to clean up preprocessor output 42*0Sstevel@tonic-gate# 43*0Sstevel@tonic-gate ex - foo.c << 'STOP' 44*0Sstevel@tonic-gate!echo STEP1 45*0Sstevel@tonic-gate$-1,$d 46*0Sstevel@tonic-gate1,/option options/d 47*0Sstevel@tonic-gate!echo STEP2 48*0Sstevel@tonic-gateg/^# /d 49*0Sstevel@tonic-gate!echo STEP3 50*0Sstevel@tonic-gateg/^[ ]*$/d 51*0Sstevel@tonic-gate!echo STEP4 52*0Sstevel@tonic-gate%s/ \"// 53*0Sstevel@tonic-gate!echo STEP5 54*0Sstevel@tonic-gate%s/\".*// 55*0Sstevel@tonic-gate!echo STEP6 56*0Sstevel@tonic-gate1m$ 57*0Sstevel@tonic-gate!echo STEP7 58*0Sstevel@tonic-gatew! tmpfile1 59*0Sstevel@tonic-gate!pr -t -n tmpfile1 > tmpfile2 60*0Sstevel@tonic-gate!echo STEP8 61*0Sstevel@tonic-gateq 62*0Sstevel@tonic-gateSTOP 63*0Sstevel@tonic-gate# 64*0Sstevel@tonic-gate ex -s tmpfile2 << 'STOP' 65*0Sstevel@tonic-gate$t0 66*0Sstevel@tonic-gate!echo STEP9 67*0Sstevel@tonic-gate1s/....../ 0 / 68*0Sstevel@tonic-gate!echo STEP10 69*0Sstevel@tonic-gatew len4 70*0Sstevel@tonic-gate%s/\(......\)\(.*\)/vi_\U\2\L \1/ 71*0Sstevel@tonic-gate!echo STEP11 72*0Sstevel@tonic-gate%s/ $// 73*0Sstevel@tonic-gate!echo STEP12 74*0Sstevel@tonic-gate%s/[ ][ ]*/ / 75*0Sstevel@tonic-gate!echo STEP13 76*0Sstevel@tonic-gate$s/.* /vi_NOPTS / 77*0Sstevel@tonic-gate!echo STEP14 78*0Sstevel@tonic-gate%s/\([A-Z][A-Z][A-Z][A-Z][A-Z][A-Z]*\)\( \)/\1/ 79*0Sstevel@tonic-gate!echo STEP15 80*0Sstevel@tonic-gate%s/.*/#define &/ 81*0Sstevel@tonic-gate!echo STEP16 82*0Sstevel@tonic-gate$i 83*0Sstevel@tonic-gate 84*0Sstevel@tonic-gate. 85*0Sstevel@tonic-gate0a 86*0Sstevel@tonic-gate#ident "%Z%%M% %I% %E% SMI" 87*0Sstevel@tonic-gate. 88*0Sstevel@tonic-gatew! ex_vars.h 89*0Sstevel@tonic-gateq 90*0Sstevel@tonic-gateSTOP 91*0Sstevel@tonic-gateecho finished.... 92