[mapserver-commits] r10117 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Sat Apr 24 19:15:39 EDT 2010


Author: sdlime
Date: 2010-04-24 19:15:38 -0400 (Sat, 24 Apr 2010)
New Revision: 10117

Modified:
   trunk/mapserver/mapfile.c
Log:
Added a couple more helpers...

Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c	2010-04-24 17:31:23 UTC (rev 10116)
+++ trunk/mapserver/mapfile.c	2010-04-24 23:15:38 UTC (rev 10117)
@@ -436,10 +436,25 @@
 /*
 ** Helper functions for writing mapfiles.
 */
-static void writeNumber(double *d, FILE *stream, char *name, char *tab) {
-  fprintf(stream, "%s%s %g\n", tab, name, *d);
+static void writeStartBlock(FILE *stream, char *tab, char *key) {
+  fprintf(stream, "%s%s\n", tab, key);
 }
 
+static void writeEndBlock(FILE *stream, char *tab, char *key) {
+  fprintf(stream, "%sEND\n", tab);
+}
+
+static void writeNumber(FILE *stream, char *tab, char *key, double value) {
+  fprintf(stream, "%s%s %g\n", tab, key, value);
+}
+
+static void writeString(FILE *stream, char *tab, char *key, char *value) {
+  if(strchr(value, '\"') != NULL)
+    fprintf(stream, "%s%s '%s'\n", tab, key, value);
+  else
+    fprintf(stream, "%s%s \"%s\"\n", tab, key, value);
+}
+
 static void writeColor(colorObj *color, FILE *stream, char *name, char *tab) {
   if(MS_VALID_COLOR(*color))
     fprintf(stream, "%s%s %d %d %d\n", tab, name, color->red, color->green, color->blue);



More information about the mapserver-commits mailing list