[MOAB-dev] r3540 - MOAB/trunk/tools/iGeom

hongjun at mcs.anl.gov hongjun at mcs.anl.gov
Fri Feb 12 01:24:08 CST 2010


Author: hongjun
Date: 2010-02-12 01:24:08 -0600 (Fri, 12 Feb 2010)
New Revision: 3540

Added:
   MOAB/trunk/tools/iGeom/mkprotos.sh
Log:
o mkprotos.sh is missed for iGeom MOAB implementation commit


Added: MOAB/trunk/tools/iGeom/mkprotos.sh
===================================================================
--- MOAB/trunk/tools/iGeom/mkprotos.sh	                        (rev 0)
+++ MOAB/trunk/tools/iGeom/mkprotos.sh	2010-02-12 07:24:08 UTC (rev 3540)
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+default_fcdefs=iBase_FCDefs.h
+case "x$1" in
+  x|x-*)
+    echo "Usage: $0 <FUNC_PREFIX> <DEF_PREFIX> <INPUT_FILE> <OUTPUT_FILE> [<FCDEFS>=${default_fcdefs}]"
+    ;;
+esac
+
+PFX="$1"
+DEF="$2"
+INPUT="$3"
+OUTPUT="$4"
+if test "x" != "x$5"; then
+  FCDEFS="$5"
+else
+  FCDEFS="$default_fcdefs"
+fi
+
+if test "x" = "x$SED"; then
+  SED=`which sed`
+fi
+
+EXPR="s/^[[:space:]]*void[[:space:]][[:space:]]*${PFX}_\([_a-zA-Z0-9][_a-zA-Z0-9]*\)[[:space:]]*(.*\$/${PFX}_\1/p"
+
+echo "#include \"$FCDEFS\"" > $OUTPUT
+echo "#ifdef ${DEF}_FC_FUNC_" >> $OUTPUT
+echo >> $OUTPUT
+for func in `$SED -n "$EXPR" $INPUT`; do
+  lower=`echo $func | tr '[:upper:]' '[:lower:]'`
+  upper=`echo $func | tr '[:lower:]' '[:upper:]'`
+  echo "#define $func ${DEF}_FC_FUNC_( $lower, $upper )" >> $OUTPUT
+done
+echo >> $OUTPUT
+echo "#endif" >> $OUTPUT


Property changes on: MOAB/trunk/tools/iGeom/mkprotos.sh
___________________________________________________________________
Added: svn:executable
   + *



More information about the moab-dev mailing list