#!/bin/sh # # Copyright (c) 1994, 1995, 1996 Gunther Schadow. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ANYCONF=$1 CONFTYPE=`expr "$ANYCONF" : "ANY\(.*\).conf"` CONFILE=ANY${CONFTYPE}-config.h UPCTYPE=`echo $CONFTYPE | \ tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` case $CONFTYPE in msg) CODE=UniMesIdCode; ;; seg) CODE=SegTypeCode; ;; esac cat > $CONFILE <<_END_PROLOG_ /* * This file is made automatically, do not modify it. */ _END_PROLOG_ echo "#ifndef ANY${UPCTYPE}_CONFIG_H_" >> $CONFILE echo "#define ANY${UPCTYPE}_CONFIG_H_" >> $CONFILE echo >> $CONFILE case $CONFTYPE in msg) sed -n \ -e "s/^\(...\)\(\^\(...\)\)*$/#include \"\1\2msg.h\"/p" \ $ANYCONF | tr "^" "_" >> $CONFILE echo >> $CONFILE echo "#define ANYMSG_CASES(OBJ) \\" >> $CONFILE sed -n \ -e "s/^\(...\)\(\^\(...\)\)*/case UniMesIdCode::\1\2val:\\\\\\ OBJ = new \1\2msg;\\\\\\ break;\\\/p" \ $ANYCONF | tr "^" "_" >> $CONFILE ;; seg) sed -n \ -e "s/^\(...\)$/#include \"\1seg.h\"/p" \ $ANYCONF >> $CONFILE echo >> $CONFILE echo "#define ANYSEG_CASES(SEG) \\" >> $CONFILE sed -n \ -e "s/^\(...\)$/case SegTypeCode::\1val: SEG = new \1seg; break;\\\/p" \ $ANYCONF >> $CONFILE esac echo "/* end of cases */" >> $CONFILE echo >> $CONFILE echo "#endif /* !ANY${UPCTYPE}_CONFIG_H_ */" >> $CONFILE