#!/bin/sh #- # Copyright © 2019 # mirabilos # Copyright (C) 1997 and 1998 WIDE Project. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the project nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS “AS IS” AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. LC_ALL=C; LANGUAGE=C export LC_ALL; unset LANGUAGE set -e allu=QWERTYUIOPASDFGHJKLZXCVBNM alll=qwertyuiopasdfghjklzxcvbnm upper() { echo :"$@" | sed 's/^://' | tr $alll $allu } rm -f ctlwords.c ctlwords.h ctlwords.pl cat >ctlwords.c~ <<\EOF /* this was generated by ctlwords.sh, do not edit */ #include "mgp.h" const struct ctl_words ctl_words[] = { EOF cat >ctlwords.h~ <<\EOF /* this was generated by ctlwords.sh, do not edit */ EOF cat >ctlwords.pl~ <<\EOF # this keyword list was generated by ctlwords.sh, do not edit @keywords = ( EOF lfd=0 while read control ctype clabel; do ctlup=`upper CTL_$control` ctyup=`upper T_$ctype` if test x"$clabel" = x""; then clabel=$control elif test x"$clabel" = x"*"; then clabel='*'$control'*' else : fi clbsz=`expr "X$clabel" : '.*'` clbsz=`expr $clbsz - 1` # the X cat >&4 <&5 <&6 <>ctlwords.c~ 5>>ctlwords.h~ 6>>ctlwords.pl~ <<\EOF noop void default int tab sp size double fore long back long left void leftfill void center void right void shrink void lcutin void rcutin void cont void nodef void nodefault xfont str xfont2 str2 image sp bimage sp page void hgap int vgap int gap int pause sp psfont str prefix str prefixn str * tabprefix str * tabprefixn str * prefixpos void * again void ccolor long bar sp include str bgrad sp text str * linestart void * lineend void * mark void system sp filter sp endfilter void quality int bquality icon sp xsystem sp tsystem sp deffont str font str charset str pcache sp valign sp area sp opaque int sup void sub void setsup int title str EOF cat >>ctlwords.pl~ <<\EOF ); # end of generated keyword list EOF cat >>ctlwords.h~ <<\EOF /* end of generated file */ EOF cat >>ctlwords.c~ <<\EOF { NULL, 0, 0, 0 } }; /* end of generated list */ EOF mv ctlwords.pl~ ctlwords.pl mv ctlwords.h~ ctlwords.h mv ctlwords.c~ ctlwords.c