[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet s.popinet at niwa.co.nz
Fri May 15 02:55:26 UTC 2009


The following commit has been merged in the upstream branch:
commit 7b932099e8b979d631495c9858e20085b51b1a1c
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date:   Tue Jul 1 12:08:59 2008 +1000

    Fix for doc generation with new gfs-highlight script
    
    darcs-hash:20080701020859-fbd8f-fd01fadff4df9c655409edb6ac3fc628e87cc45c.gz

diff --git a/doc/examples/classes.c b/doc/examples/classes.c
index 138169b..61a429f 100644
--- a/doc/examples/classes.c
+++ b/doc/examples/classes.c
@@ -4,17 +4,10 @@
 
 static void key_value_pair (const char * key, FILE * lang)
 {
-  static int first = 1;
-  if (first) {
-    fprintf (lang, "gfs_keyword = ");
-    first = 0;
-  }
-  else
-    fprintf (lang, ",\n");
-
+  fprintf (lang, "gfs_keyword = \"%s\"\n", key);
   /* keywords must start with Gfs */
   g_assert (strstr (key, "Gfs") == key);
-  fprintf (lang, "    '(Gfs){0,1}%s'", &(key[3]));
+  fprintf (lang, "gfs_keyword = \"%s\"\n", &(key[3]));
 }
 
 int main (int argc, char * argv[])
@@ -26,20 +19,23 @@ int main (int argc, char * argv[])
 
   printf ("# Language file for source-highlight\n"
 	  "# Generated automatically by classes.c\n"
-	  "\n"
-	  "include \"cpp.lang\"\n"
-	  "\n"
-	  "comment start \"#\"\n"
-	  "\n"
-	  "redef preproc = \"C preprocessor command is not compatible with"
-	  " the use of # as comment character in GTS\"\n"
 	  "\n");
+
   key_value_pair ("GfsDefine", stdout);
   key_value_pair ("GfsProjectionParams", stdout);
   key_value_pair ("GfsApproxProjectionParams", stdout);
+
   while (*klass) {
     key_value_pair ((*klass)->info.name, stdout);
     klass++;
   }
+  
+  printf ("\n"
+	  "include \"cpp.lang\"\n"
+	  "\n"
+	  "comment start \"#\"\n"
+	  "\n"
+	  "redef preproc = \"C preprocessor command is not compatible with"
+	  " the use of # as comment character in GTS\"\n");
   return 0;
 }
diff --git a/doc/examples/gfs-highlight b/doc/examples/gfs-highlight
deleted file mode 100755
index 7ced931..0000000
--- a/doc/examples/gfs-highlight
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-wiki="http:\/\/gfs.sf.net\/wiki\/index.php"
-title="Gerris simulation"
-css="darcs.css"
-
-path="/usr/local/share/gerris"
-
-usage()
-{
-	cat <<EOF
-Usage: gfs-highlight [OPTIONS] < input.gfs > output.html
-
-Syntax highlighting/hypertext linking of Gerris simulation files.
-
-Options:
-	[--title=TITLE] sets the page title
-	[--css=FILE]    sets the CSS stylesheet filename
-        [--help]        displays this message and exits
-EOF
-	exit $1
-}
-
-while test $# -gt 0; do
-  case "$1" in
-  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
-  esac
-
-  case $1 in
-    --title=*)
-      title=$optarg
-      ;;
-    --css=*)
-      css=$optarg
-      ;;
-    --help)
-      usage 0 1>&2
-      ;;
-    *)
-      usage 0 1>&2
-      ;;
-  esac
-  shift
-done
-
-cat <<EOF
-<html>
-<head>
-<title>$title</title>
-<link rel="stylesheet" type="text/css" href="$css">
-</head>
-<body><tt class="gfs">
-EOF
-
-file=`mktemp gfs-highlight.XXXXXX`
-ln -s -f $path/gfs.lang $file
-
-awk 'BEGIN{ infile=0 } {
-       if ($2 == "Generated" && $3 == "files:") {
-         infile = 1; 
-         while ($1 == "#") getline; 
-         print $0; 
-       } else if (infile) 
-         print $0;
-     }' | \
-source-highlight --lang-def=$file --out-format=html-css | \
-sed "s/\"gfs_keyword\">\(Gfs\)\{0,1\}\([a-zA-Z0-9_]*\)<\/span>/"gfs_keyword"><a href=\"$wiki\/Gfs\2\">\1\2<\/a><\/span>/g"
-
-rm -f $file
-
-cat <<EOF
-</tt></body>
-</html>
-EOF
diff --git a/doc/examples/gfs-highlight.in b/doc/examples/gfs-highlight.in
index 056d7c8..a0c9608 100755
--- a/doc/examples/gfs-highlight.in
+++ b/doc/examples/gfs-highlight.in
@@ -61,8 +61,13 @@ awk 'BEGIN{ infile=0 } {
          infile = 1; 
          while ($1 == "#") getline; 
          print $0; 
-       } else if (infile) 
+       }
+       else if (infile) 
          print $0;
+       else if ($5 == "GfsGEdge") {
+         infile = 1;
+         print $0;
+       }
      }' | \
 source-highlight --lang-def=$file --out-format=html-css | \
 sed "s/\"gfs_keyword\">\(Gfs\)\{0,1\}\([a-zA-Z0-9_]*\)<\/span>/"gfs_keyword"><a href=\"$wiki\/Gfs\2\">\1\2<\/a><\/span>/g"
diff --git a/test/gfs2tex b/test/gfs2tex
index ce9dd39..0cb556c 100755
--- a/test/gfs2tex
+++ b/test/gfs2tex
@@ -6,7 +6,6 @@ import os.path
 import glob
 sys.path.append("../doc/examples")
 import gfs2tex
-import gfsclasses
 
 if not os.access("tests",os.F_OK):
     os.mkdir("tests")
@@ -17,4 +16,4 @@ for start in sys.argv[1:]:
             example = gfs2tex.Example(root)
             if not os.access("tests/" + example.path,os.F_OK):
                 os.symlink("../" + example.path, "tests/" + example.path)
-            example.write(gfsclasses.klass,style="tests.css")
+            example.write(style="tests.css")

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list