changeset 1018:5c2bd0ac3118

Change how urchin file is placed in HTML output.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 20 Jun 2010 12:15:20 +0000
parents b3584ea2eb25
children 3be41c04262c
files colormap.c mkbcmap.c
diffstat 2 files changed, 23 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/colormap.c	Sun Jun 20 10:29:13 2010 +0000
+++ b/colormap.c	Sun Jun 20 12:15:20 2010 +0000
@@ -235,6 +235,22 @@
 
     fprintf(outFile,
     " </style>\n"
+    );
+
+    if (optUrchinFile) {
+        FILE *inFile;
+        if ((inFile = fopen(optUrchinFile, "rb")) != NULL) {
+            int c;
+            while ((c = fgetc(inFile)) != EOF)
+                fputc(c, outFile);
+            fclose(inFile);
+        } else {
+            THERR("Urchin file '%s' not found!\n", optUrchinFile);
+            exit(17);
+        }
+    }
+    
+    fprintf(outFile,
     "</head>\n"
     "<body onLoad=\"gotoOnLoadPos();\">\n");
 
@@ -268,26 +284,9 @@
 
 void putFileEndXHTML(FILE *outFile)
 {
-    FILE *f;
-    
     /* XHTML document end tags */
     fprintf(outFile,
     "</pre>\n"
-    );
-    
-    if (optUrchinFile) {
-        if ((f = fopen(optUrchinFile, "rb")) != NULL) {
-            int c;
-            while ((c = fgetc(f)) != EOF)
-                fputc(c, outFile);
-            fclose(f);
-        } else {
-            THERR("Urchin file '%s' not found!\n", optUrchinFile);
-            exit(17);
-        }
-    }
-
-    fprintf(outFile,
     "</body>\n"
     "</html>\n"
     );
--- a/mkbcmap.c	Sun Jun 20 10:29:13 2010 +0000
+++ b/mkbcmap.c	Sun Jun 20 12:15:20 2010 +0000
@@ -262,7 +262,7 @@
         fclose(inFile);
         return 0;
     } else {
-        THERR("File '%s' not found!\n", optUrchinFile);
+        THERR("File '%s' not found!\n", filename);
         return -1;
     }
 }
@@ -331,6 +331,12 @@
     
     fprintf(outFile,
     " </style>\n"
+    );
+
+    if (optUrchinFile)
+        copyFile(outFile, optUrchinFile);
+    
+    fprintf(outFile,
     "</head>\n"
     "<body onload=\"httOnLoad();\">\n"
     );
@@ -404,8 +410,6 @@
         fprintf(outFile, "</div></div>\n");
     }
 
-    if (optUrchinFile)
-        copyFile(outFile, optUrchinFile);
     
     /* XHTML document end tags */
     fprintf(outFile,