[mapserver-commits] r10685 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Oct 29 12:57:30 EDT 2010


Author: aboudreault
Date: 2010-10-29 09:57:30 -0700 (Fri, 29 Oct 2010)
New Revision: 10685

Modified:
   trunk/mapserver/mapfile.c
Log:
Added writeHastTableInline function to get CONFIG mapfile option wrote properly in a new mapfile

Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c	2010-10-29 16:18:55 UTC (rev 10684)
+++ trunk/mapserver/mapfile.c	2010-10-29 16:57:30 UTC (rev 10685)
@@ -2093,6 +2093,24 @@
   writeBlockEnd(stream, indent, title);
 }
 
+static void writeHashTableInline(FILE *stream, int indent, char *name, hashTableObj* table) {
+    struct hashObj *tp = NULL;
+    int i;
+
+    if(!table) return;
+    if(msHashIsEmpty(table)) return;
+
+    ++indent;
+    for (i=0;i<MS_HASHSIZE;++i) {
+        if (table->items[i] != NULL) {
+            for (tp=table->items[i]; tp!=NULL; tp=tp->next) {
+                writeIndent(stream, indent);
+                fprintf(stream, "%s \"%s\" \"%s\"\n", name, tp->key, tp->data);
+            }
+        }
+    }
+}
+
 /*
 ** Initialize, load and free a single style
 */
@@ -4953,7 +4971,7 @@
   }
 
   writeBlockBegin(stream, indent, "MAP");
-  writeHashTable(stream, indent, "CONFIG", &(map->configoptions));
+  writeHashTableInline(stream, indent, "CONFIG", &(map->configoptions));
   writeString(stream, indent, "DATAPATTERN", NULL, map->datapattern); /* depricated */
   writeNumber(stream, indent, "DEBUG", 0, map->debug);
   writeNumber(stream, indent, "DEFRESOLUTION", 72.0, map->defresolution);



More information about the mapserver-commits mailing list