Artifact 677e6eb1483efe9bb5a41c295a7c3a502f5a39c640a45b780aec1c15e1f3f970:


#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: numpar_txt2c

# Numerical parameters to c format
# P.J.Gawthrop May 1997
# Copyright (c) P.J.Gawthrop, 1997.

c###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
###############################################################



# Inform user
echo "Creating $1_numpar.c"

rm -f mtt_error

#Write some file headers
echo '/*' > $1_numpar.c
echo "Parameter file for system $1 ($1_numpar.c)"   >> $1_numpar.c
echo "This file provides the system numerical parameters in c form"  >> $1_numpar.c
echo "Generated by MTT at `date`"  >> $1_numpar.c
echo '*/' >> $1_numpar.c
echo  >> $1_numpar.c


cat $MTTPATH/trans/rcs_header.c >> $1_numpar.c
echo  >> $1_numpar.c


echo "#include \"$1_sympar.c\""  >> $1_numpar.c
echo "$1_numpar()" >> $1_numpar.c
echo '{' >> $1_numpar.c

#Write out the variables in c format.
awk -F#  '{
  if (NF<2) print $1
  if (NF>1)  print $1 "/* " $2 " */"
}' $1_numpar.txt  >> $1_numpar.c
echo '}' >> $1_numpar.c



MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]