[SCM] mapserver branch, master, updated. upstream/6.0.1-32-g42429eb

Alan Boudreault aboudreault at mapgears.com
Tue May 22 13:36:49 UTC 2012


The following commit has been merged in the master branch:
commit d112c35365ad0ac7af69c6b54a3673c46dc29d5b
Author: Alan Boudreault <aboudreault at mapgears.com>
Date:   Tue May 22 13:23:43 2012 +0000

    Imported upstream version 6.0.3

diff --git a/HISTORY.TXT b/HISTORY.TXT
index b75577c..c4fb575 100644
--- a/HISTORY.TXT
+++ b/HISTORY.TXT
@@ -1,8 +1,7 @@
-
 MapServer Revision History
 ==========================
 
-$Id: HISTORY.TXT 11896 2011-07-12 13:17:28Z dmorissette $
+$Id$
 
 This is a human-readable revision history which will attempt to document
 required changes for users to migrate from one version of MapServer to the
@@ -10,7 +9,99 @@ next.  Developers are strongly encouraged to document their changes and
 their impacts on the users here.  (Please add the most recent changes to 
 the top of the list.)
 
-For a complete change history, please see the Subversion log comments.
+For a complete change history, please see the Git log comments.
+
+Version 6.0.3 (2012-05-18):
+---------------------------
+
+- Fix creation of a vector symbolObj in mapscript (#4318)
+
+- Added coverage metadata in WCS (#4306)
+
+- Adjusted WCS 2.0 GetCapbilities response (#4003)
+
+- Ignore unknown requets parameteres in WCS 2.0 (#4307).
+
+- Fixed mapscript is unusable in a web application due to
+  memory leaks (#4262)
+
+- Fixed getFeature request with custom output format fails on filter
+  encoding (#4190)
+
+- Fixed resolution when UoM changes in WCS 2.0 (#4283)
+
+- Added missing DEFRESOLUTION parameter to msCopyMap() function (#4272)
+
+- Fixed Python MapScript layerObj/classObj Error (#3940)
+
+- Fixed WCS 2.0 axis order, offset vector, and origin (#4006, #4191)
+
+- Fixed PHP MapScript opacity property of StyleObj no longer works (#3920)
+
+- Added MS_CJC_* constants in PHP/MapScript (#4183)
+
+- Fixed Memory leak with fribidi strings (#4188)
+
+- Added missing properties in styleObj setter of PHP/MapScript (#3901)
+
+Version 6.0.2 (2012-02-08):
+---------------------------
+
+- Fix security issue with quote escape in WFS GetFeature Filter (#4087)
+
+- Fixed lexer buffer size issue with single quotes in a string  (#4175)
+
+- Raster layer fails to be drawn if the window is less than half a pixel (#4172)
+
+- Fixed SLD with FILTER doesn't apply properly to database layers (#4112)
+
+- Fixed a problem with calls to labelInImage() (maplabel.c) when label gutter
+  and label buffers are both used (#3303). Also changed the usage around that
+  function to make it easier to understand. At a result the
+  "labelcache_map_edge_buffer" processing option (i.e. gutter) can be provided
+  as a positive or negative value. (closes #1355 too)
+
+- Added label->style markers to collision detection (#4133)
+
+- Fixed single pixel coverages in WCS 2.0 (#4110)
+
+- Fixed subsetting in WCS 2.0 (#4099)
+
+- Fixed segfault when calling classObj::updateFromString() with SYMBOL (#4062)
+
+- fix rendering offset on thick GD lines (#3962)
+
+- fix segfault on join with postgresql tables (#4074)
+
+- Fixed Python Mapscript does not write COLOR to reference map (#4042)
+ 
+- Fixed cannot add a style to a label in PHP/SWIG Mapscript (#4038) 
+
+- Add missing outputFormat support in WFS GetFeature POST XML requests (#4052)
+
+- Fixed schema validity issue for WCS 1.1 GetCoverage responses (#4047)
+
+- fix centroid geomtransform parser (#4029)
+
+- PHP MapScript is missing many styleObj properties (#3901)
+
+- Added GEOMTRANSFORM in writeStyle function
+
+- WCS 1.0: Fix crash with some _rangeset_axes values (#4020)
+
+- Changed msDrawVectorLayer() not to cache shapes if attribute binding is 
+  present after the first style (#3976)
+
+- Fix mapscript to build when TRUE macro is not defined (#3926)
+
+- Fix mapscript php build issues with MSVC (#4004)
+
+- PHP/Mapscript: Segmentation fault when getting complex object using 
+  PHP 5.2 (#3930)
+
+- Fixed contains operator in logical expresions (#3974)
+
+- Fix incorrect rendering of GD lines between 1 and 2 pixels wide (#3962)
 
 Version 6.0.1 (2011-07-12):
 ---------------------------
@@ -23,6 +114,8 @@ IMPORTANT SECURITY FIXES:
    enabled, with layers connecting to an SQL RDBMS backend, either 
    natively or via OGR (#3903) 
 
+Other fixes:
+
 - Applied patch for ticket (symbol writing issues) (#3589)
 
 - Fix performance issue with Oracle and scrollable cursors (#3905)
diff --git a/MIGRATION_GUIDE.txt b/MIGRATION_GUIDE.txt
index 821b403..7b3f27d 100644
--- a/MIGRATION_GUIDE.txt
+++ b/MIGRATION_GUIDE.txt
@@ -123,7 +123,7 @@ allow us to support all features across all rendering drivers (GD,AGG,PDF,SVG, e
 Mapfile Changes - line styling
 ------------------------------
 
-All line styling must now be specified in layer STYLEs.
+All line styling must now be specified in class STYLEs in the layer definition.
 
 The following parameters/keywords have been moved from SYMBOL
 to STYLE:
diff --git a/Makefile.vc b/Makefile.vc
index 3d586b2..787d0b1 100644
--- a/Makefile.vc
+++ b/Makefile.vc
@@ -9,7 +9,7 @@
 #  - Run the VCVARS32.BAT script to initialize the VC++ environment variables
 #  - Start the build with:  nmake /f makefile.vc
 #
-# $Id: Makefile.vc 11154 2011-03-11 19:59:30Z aboudreault $
+# $Id$
 #
 MAPSERVER_ROOT = .
 
diff --git a/README.CONFIGURE b/README.CONFIGURE
index ed2ac18..e646300 100644
--- a/README.CONFIGURE
+++ b/README.CONFIGURE
@@ -774,7 +774,7 @@ Java Mapscript Module:
                      http://trac.osgeo.org/mapserver/tickets/1209
 
 ----------------
-$Id: README.CONFIGURE 11680 2011-05-12 13:07:06Z dmorissette $
+$Id$
 ----------------
 
 
diff --git a/README.WIN32 b/README.WIN32
index 692f1a3..dedf704 100644
--- a/README.WIN32
+++ b/README.WIN32
@@ -191,4 +191,4 @@ The best option is to download the zip file containing the source code and build
   - uncomment in the nmake.opt the flags related to PDF
 
 
-$Id: README.WIN32 6833 2007-09-05 22:08:13Z hobu $
+$Id$
diff --git a/cgiutil.c b/cgiutil.c
index ac15886..1530b81 100644
--- a/cgiutil.c
+++ b/cgiutil.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: cgiutil.c 11452 2011-04-04 13:25:43Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  cgiRequestObj and CGI parameter parsing. 
@@ -36,7 +36,7 @@
 #include "mapserver.h"
 #include "cgiutil.h"
 
-MS_CVSID("$Id: cgiutil.c 11452 2011-04-04 13:25:43Z aboudreault $")
+MS_CVSID("$Id$")
 
 #define LF 10
 #define CR 13
diff --git a/cgiutil.h b/cgiutil.h
index a53b3a1..5d2c1b5 100644
--- a/cgiutil.h
+++ b/cgiutil.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: cgiutil.h 10645 2010-10-22 20:42:59Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  cgiRequestObj and CGI parsing utility related declarations.
diff --git a/classobject.c b/classobject.c
index affe2c5..b3a7be5 100644
--- a/classobject.c
+++ b/classobject.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: classobject.c 7347 2008-02-06 16:55:30Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Functions for operating on a classObj that don't belong in a
@@ -36,7 +36,7 @@
 #  include "cpl_conv.h"
 #endif
 
-MS_CVSID("$Id: classobject.c 7347 2008-02-06 16:55:30Z nsavard $")
+MS_CVSID("$Id$")
 
 /**
  * Move the style up inside the array of styles.
diff --git a/configure.in b/configure.in
index 2fe8f6b..ba42418 100755
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
 dnl **************************************************************************
-dnl $Id: configure.in 11618 2011-04-27 15:06:17Z dmorissette $
+dnl $Id$
 dnl
 dnl Project:  MapServer
 dnl Purpose:  Main autoconf script ( Process this file with autoconf to 
diff --git a/layerobject.c b/layerobject.c
index 1dc13fb..c2cc75d 100644
--- a/layerobject.c
+++ b/layerobject.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: layerobject.c 11373 2011-03-29 23:37:29Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Functions for operating on a layerObj that don't belong in a
@@ -36,7 +36,7 @@
 #  include "cpl_conv.h"
 #endif
 
-MS_CVSID("$Id: layerobject.c 11373 2011-03-29 23:37:29Z dmorissette $")
+MS_CVSID("$Id$")
 
 /* ===========================================================================
    msInsertClass
diff --git a/legend.c b/legend.c
index 85bbc6a..1377af5 100644
--- a/legend.c
+++ b/legend.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: legend.c 11372 2011-03-29 23:34:57Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Mainline of commandline legend generation test utility.
@@ -29,7 +29,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: legend.c 11372 2011-03-29 23:34:57Z dmorissette $")
+MS_CVSID("$Id$")
 
 int main(int argc, char *argv[])
 {
diff --git a/mapagg.cpp b/mapagg.cpp
index 3374db7..5ae1102 100644
--- a/mapagg.cpp
+++ b/mapagg.cpp
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapagg.cpp 11615 2011-04-21 10:13:42Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  AGG rendering and other AGG related functions.
diff --git a/mapagg.h b/mapagg.h
index 1de1dc5..24ede93 100644
--- a/mapagg.h
+++ b/mapagg.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapagg.h 10743 2010-11-19 17:05:38Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  AGG template library types.
diff --git a/mapaxisorder.h b/mapaxisorder.h
index 61e82b3..2b613ca 100644
--- a/mapaxisorder.h
+++ b/mapaxisorder.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapaxisorder.h 11646 2011-05-04 18:46:39Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Axis lookup table
diff --git a/mapbits.c b/mapbits.c
index 6849b36..5501ac4 100644
--- a/mapbits.c
+++ b/mapbits.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapbits.c 10017 2010-03-26 05:01:03Z warmerdam $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of bit array functions.
@@ -32,7 +32,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapbits.c 10017 2010-03-26 05:01:03Z warmerdam $")
+MS_CVSID("$Id$")
 
 #include <limits.h>
 
diff --git a/mapcairo.c b/mapcairo.c
index 7ed33be..8ea2d84 100644
--- a/mapcairo.c
+++ b/mapcairo.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapcairo.c 11591 2011-04-18 10:13:01Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Cairo Rendering functions
diff --git a/mapchart.c b/mapchart.c
index 8e49b88..d4963ee 100644
--- a/mapchart.c
+++ b/mapchart.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapchart.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of dynamic charting (MS-RFC-29)
@@ -30,7 +30,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapchart.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 #define MS_CHART_TYPE_PIE 1
 #define MS_CHART_TYPE_BAR 2
diff --git a/mapcluster.c b/mapcluster.c
index 53f1f92..945292f 100644
--- a/mapcluster.c
+++ b/mapcluster.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapcluster.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of the cluster layer data provider (RFC-69).
@@ -29,11 +29,11 @@
 
 #define _CRT_SECURE_NO_WARNINGS 1
 
-/* $Id: mapcluster.c 11881 2011-07-07 19:55:43Z sdlime $ */
+/* $Id$ */
 #include <assert.h>
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapcluster.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 
 #ifdef USE_CLUSTER_PLUGIN
diff --git a/mapcontext.c b/mapcontext.c
index a8e1fc3..33a2a77 100644
--- a/mapcontext.c
+++ b/mapcontext.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapcontext.c 10883 2011-01-21 19:38:21Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC Web Map Context implementation
@@ -28,7 +28,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapcontext.c 10883 2011-01-21 19:38:21Z aboudreault $")
+MS_CVSID("$Id$")
 
 #if defined(USE_WMS_LYR) && defined(USE_OGR)
 
diff --git a/mapcopy.c b/mapcopy.c
index 3d68aea..0191095 100644
--- a/mapcopy.c
+++ b/mapcopy.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapcopy.c 11084 2011-03-06 12:15:20Z rouault $
+ * $Id$
  *
  * Project: MapServer
  * Purpose: Functions to allow copying/cloning of maps
@@ -45,7 +45,7 @@
 #include "mapserver.h"
 #include "mapsymbol.h"
 
-MS_CVSID("$Id: mapcopy.c 11084 2011-03-06 12:15:20Z rouault $")
+MS_CVSID("$Id$")
 
 #include "mapcopy.h"
 
@@ -977,6 +977,7 @@ int msCopyMap(mapObj *dst, mapObj *src)
     MS_COPYSTELEM(cellsize);
     MS_COPYSTELEM(units);
     MS_COPYSTELEM(scaledenom);
+    MS_COPYSTELEM(defresolution);
     MS_COPYSTELEM(resolution);
     MS_COPYSTRING(dst->shapepath, src->shapepath); 
     MS_COPYSTRING(dst->mappath, src->mappath); 
diff --git a/mapcopy.h b/mapcopy.h
index 260e430..6a4597c 100644
--- a/mapcopy.h
+++ b/mapcopy.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapcopy.h 9093 2009-06-07 09:52:59Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Declarations related to copyng mapObjs.  Provided by Mladen Turk 
diff --git a/mapcpl.c b/mapcpl.c
index 98d9566..c33846b 100644
--- a/mapcpl.c
+++ b/mapcpl.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapcpl.c 10678 2010-10-28 13:38:27Z aboudreault $ 
+ * $Id$ 
  *
  * Project:  MapServer
  * Purpose:  Functions copied from GDAL's CPL. This file contain utility 
@@ -36,12 +36,12 @@
  * DEALINGS IN THE SOFTWARE.
  ****************************************************************************/
 
-/* $Id: mapcpl.c 10678 2010-10-28 13:38:27Z aboudreault $ */
+/* $Id$ */
 
 #include <assert.h>
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapcpl.c 10678 2010-10-28 13:38:27Z aboudreault $")
+MS_CVSID("$Id$")
 
 /* should be size of largest possible filename */
 #define MS_PATH_BUF_SIZE 2048
diff --git a/mapcrypto.c b/mapcrypto.c
index 4b5b608..37f0ae3 100644
--- a/mapcrypto.c
+++ b/mapcrypto.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapcrypto.c 10678 2010-10-28 13:38:27Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Encryption functions (see MS-RFC-18)
@@ -34,7 +34,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapcrypto.c 10678 2010-10-28 13:38:27Z aboudreault $")
+MS_CVSID("$Id$")
 
 
 /**********************************************************************
diff --git a/mapdebug.c b/mapdebug.c
index 4607547..a363f83 100644
--- a/mapdebug.c
+++ b/mapdebug.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapdebug.c 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of debug/logging, msDebug() and related functions.
@@ -48,7 +48,7 @@
 #include <windows.h> /* OutputDebugStringA() */
 #endif
 
-MS_CVSID("$Id: mapdebug.c 11503 2011-04-07 19:56:16Z dmorissette $")
+MS_CVSID("$Id$")
 
 
 #ifndef USE_THREAD
diff --git a/mapdraw.c b/mapdraw.c
index be640c4..839168e 100644
--- a/mapdraw.c
+++ b/mapdraw.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapdraw.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  High level msDrawMap() implementation and related functions.
@@ -32,7 +32,7 @@
 #include "maptime.h"
 #include "mapcopy.h"
 
-MS_CVSID("$Id: mapdraw.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 /*
  * Functions to reset any pen (color index) values previously set. Used primarily to reset things when
@@ -880,9 +880,15 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
     featuresdrawn++;
 
     cache = MS_FALSE;
-    if(layer->type == MS_LAYER_LINE && (layer->class[shape.classindex]->numstyles > 1 || 
-        (layer->class[shape.classindex]->numstyles == 1 && layer->class[shape.classindex]->styles[0]->outlinewidth>0)))
+    if(layer->type == MS_LAYER_LINE && (layer->class[shape.classindex]->numstyles > 1 || (layer->class[shape.classindex]->numstyles == 1 && layer->class[shape.classindex]->styles[0]->outlinewidth>0))) {
+      int i;
       cache = MS_TRUE; /* only line layers with multiple styles need be cached (I don't think POLYLINE layers need caching - SDL) */
+
+      /* we can't handle caching with attribute binding other than for the first style (#3976) */
+      for(i=1;i<layer->class[shape.classindex]->numstyles; i++) {
+        if(layer->class[shape.classindex]->styles[i]->numbindings > 0) cache = MS_FALSE;
+      }
+    }
          
     /* With 'STYLEITEM AUTO', we will have the datasource fill the class' */
     /* style parameters for this shape. */
@@ -1296,15 +1302,15 @@ msDrawRasterLayerPlugin( mapObj *map, layerObj *layer, imageObj *image)
         	renderer->mergeRasterBuffer( image, rb, 1.0, 0, 0, 0, 0, rb->width, rb->height );
         }
 
-        msFreeRasterBuffer(rb);
-        free(rb); 
-        
+	msFreeRasterBuffer(rb);
     }
 #define RB_GET_R(rb,x,y) *((rb)->data.rgba.r + (x) * (rb)->data.rgba.pixel_step + (y) * (rb)->data.rgba.row_step)
 #define RB_GET_G(rb,x,y) *((rb)->data.rgba.g + (x) * (rb)->data.rgba.pixel_step + (y) * (rb)->data.rgba.row_step)
 #define RB_GET_B(rb,x,y) *((rb)->data.rgba.b + (x) * (rb)->data.rgba.pixel_step + (y) * (rb)->data.rgba.row_step)
 #define RB_GET_A(rb,x,y) *((rb)->data.rgba.a + (x) * (rb)->data.rgba.pixel_step + (y) * (rb)->data.rgba.row_step)
 
+    free(rb);         
+	
     return ret;
 }
 
@@ -2389,6 +2395,7 @@ int msDrawLabel(mapObj *map, imageObj *image, pointObj labelPnt, char *string, l
 int msDrawLabelCache(imageObj *image, mapObj *map)
 {
   int nReturnVal = MS_SUCCESS;
+
   if(image) {
     if(MS_RENDERER_PLUGIN(image->format)) {          
       pointObj p;
@@ -2423,7 +2430,7 @@ int msDrawLabelCache(imageObj *image, mapObj *map)
        * map image where labels can't fall
        */
       if((value = msLookupHashTable(&(map->web.metadata), "labelcache_map_edge_buffer")) != NULL) {
-        map_edge_buffer = atoi(value);
+        map_edge_buffer = MS_ABS(atoi(value));
         if(map->debug) msDebug("msDrawLabelCache(): labelcache_map_edge_buffer = %d\n", map_edge_buffer);
       }
 
@@ -2455,7 +2462,7 @@ int msDrawLabelCache(imageObj *image, mapObj *map)
               msRectToPolygon(marker_rect, cachePtr->poly);
                  
               if(!labelPtr->force)
-                msTestLabelCacheCollisions(&(map->labelcache), labelPtr, image->width, image->height, label_buffer + map_edge_buffer, cachePtr, priority, l, label_mindistance, 0);
+                msTestLabelCacheCollisions(&(map->labelcache), labelPtr, image->width, image->height, (map_edge_buffer-label_buffer), cachePtr, priority, l, label_mindistance, 0);
                  
               if(cachePtr->status == MS_FALSE)
                 continue;
@@ -2480,6 +2487,7 @@ int msDrawLabelCache(imageObj *image, mapObj *map)
               }
             }
           } else {
+
             if(labelPtr->type == MS_TRUETYPE) {
               size = labelPtr->size * layerPtr->scalefactor;
               size = MS_MAX(size, labelPtr->minsize*image->resolutionfactor);
@@ -2487,7 +2495,7 @@ int msDrawLabelCache(imageObj *image, mapObj *map)
               scalefactor = size / labelPtr->size;
             } else {
               size = labelPtr->size;
-              scalefactor = 1;
+              scalefactor = 1; /* can't scale bitmap fonts */
             }
             if(msGetLabelSize(map,labelPtr,cachePtr->text,size,&r,NULL) != MS_SUCCESS)
               return MS_FAILURE;
@@ -2526,6 +2534,7 @@ int msDrawLabelCache(imageObj *image, mapObj *map)
               continue; /* label too large relative to the feature */
    
             marker_offset_x = marker_offset_y = 0; /* assume no marker */
+            marker_width = marker_height = 0;
             if(layerPtr->type == MS_LAYER_ANNOTATION && cachePtr->numstyles > 0) { /* there might be a marker added to the image */
    
               /* TODO: at the moment only checks the bottom (first) marker style, perhaps should check all of them */
@@ -2547,6 +2556,33 @@ int msDrawLabelCache(imageObj *image, mapObj *map)
               marker_offset_y = MS_NINT(marker_height/2.0);
             }
 
+            /* TODO: might need this in the no text/empty text section above */
+            if(labelPtr->numstyles > 0) {
+              int temp_marker_width, temp_marker_height;
+
+	      for(i=0; i<labelPtr->numstyles; i++) {
+                /* TODO: at the moment only checks the bottom (first) label style, perhaps should check all of them */
+		if(labelPtr->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOINT) {
+                  if(msGetMarkerSize(&map->symbolset, labelPtr->styles[i], &temp_marker_width, &temp_marker_height, layerPtr->scalefactor) != MS_SUCCESS)
+		    return MS_FAILURE;
+                  break;
+		}
+	      }
+
+	      if(temp_marker_width > marker_width || temp_marker_height > marker_height) {
+                marker_width = temp_marker_width;
+		marker_height = temp_marker_height;
+
+		marker_offset_x = MS_NINT(marker_width/2.0);
+		marker_offset_y = MS_NINT(marker_height/2.0);
+
+		marker_rect.minx = MS_NINT(cachePtr->point.x - .5 * marker_width) - labelPtr->buffer;
+		marker_rect.miny = MS_NINT(cachePtr->point.y - .5 * marker_height) - labelPtr->buffer;
+		marker_rect.maxx = MS_NINT(cachePtr->point.x + .5 * marker_width) + labelPtr->buffer; // marker_rect.minx + (marker_width-1) + labelPtr->buffer;
+		marker_rect.maxy = MS_NINT(cachePtr->point.y + .5 * marker_height) + labelPtr->buffer; // marker_rect.miny + (marker_height-1) + labelPtr->buffer;
+	      }
+            }
+
             /* handle path following labels first (position does not matter) */
             if(cachePtr->labelpath) {
               cachePtr->status = MS_TRUE;
@@ -2557,9 +2593,9 @@ int msDrawLabelCache(imageObj *image, mapObj *map)
    
               /* Compare against image bounds, rendered labels and markers (sets cachePtr->status), if FORCE=TRUE then skip it */
               if(!labelPtr->force)
-                msTestLabelCacheCollisions(&(map->labelcache), labelPtr, image->width, image->height, label_buffer + map_edge_buffer, cachePtr, priority, l, label_mindistance, (r.maxx-r.minx));
+                msTestLabelCacheCollisions(&(map->labelcache), labelPtr, image->width, image->height, (map_edge_buffer-label_buffer), cachePtr, priority, l, label_mindistance, (r.maxx-r.minx));
             } else {
-   
+
               if(labelPtr->position == MS_AUTO) {
                 int positions[MS_POSITIONS_LENGTH], npositions=0;
    
@@ -2583,11 +2619,12 @@ int msDrawLabelCache(imageObj *image, mapObj *map)
                   cachePtr->status = MS_TRUE; /* assume label *can* be drawn */
    
                   p = get_metrics(&(cachePtr->point), positions[i], r, (marker_offset_x + label_offset_x), (marker_offset_y + label_offset_y), labelPtr->angle, label_buffer, cachePtr->poly);
-                  if(layerPtr->type == MS_LAYER_ANNOTATION && cachePtr->numstyles > 0)
+
+                  if(marker_width > 0 && marker_height > 0)
                     msRectToPolygon(marker_rect, cachePtr->poly); /* save marker bounding polygon */
    
                   /* Compare against image bounds, rendered labels and markers (sets cachePtr->status) */
-                  msTestLabelCacheCollisions(&(map->labelcache), labelPtr, image->width, image->height, label_buffer + map_edge_buffer, cachePtr, priority, l, label_mindistance, (r.maxx-r.minx));
+                  msTestLabelCacheCollisions(&(map->labelcache), labelPtr, image->width, image->height, (map_edge_buffer-label_buffer), cachePtr, priority, l, label_mindistance, (r.maxx-r.minx));
 
                   /* found a suitable place for this label */
                   if(cachePtr->status) {
@@ -2615,18 +2652,18 @@ int msDrawLabelCache(imageObj *image, mapObj *map)
                   if(drawLabelPoly) get_metrics_line(&(cachePtr->point), labelPtr->position, r, (marker_offset_x + label_offset_x), (marker_offset_y + label_offset_y), labelPtr->angle, 1, labelPoly.line);
                 }
 
-                if(layerPtr->type == MS_LAYER_ANNOTATION && cachePtr->numstyles > 0)
+                if(marker_width > 0 && marker_height > 0)
                   msRectToPolygon(marker_rect, cachePtr->poly); /* save marker bounding polygon, part of overlap tests (TODO: might need to do something similar with label styles?) */
 
                 /* Compare against image bounds, rendered labels and markers (sets cachePtr->status), if FORCE=TRUE then skip the test */
                 if(!labelPtr->force)
-                  msTestLabelCacheCollisions(&(map->labelcache), labelPtr, image->width, image->height, label_buffer + map_edge_buffer, cachePtr, priority, l, label_mindistance, (r.maxx-r.minx));  
+                  msTestLabelCacheCollisions(&(map->labelcache), labelPtr, image->width, image->height, (map_edge_buffer-label_buffer), cachePtr, priority, l, label_mindistance, (r.maxx-r.minx));  
               }
-            }
+            } /* end (not) POSITION FOLLOW/AUTO */
    
             if(!cachePtr->status)
               continue; /* next label */
-   
+
             /* here's where we draw the label styles */
             if(!cachePtr->labelpath && cachePtr->label.numstyles > 0) {
               for(i=0; i<cachePtr->label.numstyles; i++) {
diff --git a/mapdrawgdal.c b/mapdrawgdal.c
index e1caeaf..c673259 100644
--- a/mapdrawgdal.c
+++ b/mapdrawgdal.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapdrawgdal.c 11176 2011-03-16 19:01:00Z schpidi $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Code for drawing GDAL raster layers.  Called from 
@@ -33,7 +33,7 @@
 #include "mapresample.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: mapdrawgdal.c 11176 2011-03-16 19:01:00Z schpidi $")
+MS_CVSID("$Id$")
 
 extern int InvGeoTransform( double *gt_in, double *gt_out );
 
@@ -250,6 +250,18 @@ int msDrawRasterLayerGDAL(mapObj *map, layerObj *layer, imageObj *image,
         src_ysize = MIN(MAX(0,(int) (lly - ury + 0.5)),
                         GDALGetRasterYSize(hDS) - src_yoff);
 
+       /* We want very small windows to use at least one source pixel (#4172) */
+       if( src_xsize == 0 && (urx - llx) > 0.0 ) 
+       {
+           src_xsize = 1;
+	   src_xoff = MIN(src_xoff,GDALGetRasterXSize(hDS)-1);
+       }
+       if( src_ysize == 0 && (lly - ury) > 0.0 )
+       {
+           src_ysize = 1;
+	   src_yoff = MIN(src_yoff,GDALGetRasterYSize(hDS)-1);
+       }
+
         if( src_xsize == 0 || src_ysize == 0 )
         {
             if( layer->debug )
diff --git a/mapdummyrenderer.c b/mapdummyrenderer.c
index c661c7a..72b8179 100644
--- a/mapdummyrenderer.c
+++ b/mapdummyrenderer.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapdummyrenderer.c 11592 2011-04-18 10:15:18Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Dummy functions to implement when using a pluggable renderer
diff --git a/mapentities.h b/mapentities.h
index c0207e7..e67d4cb 100644
--- a/mapentities.h
+++ b/mapentities.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapentities.h 7056 2007-11-20 10:05:50Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  HTML entity to unicode lookup table
diff --git a/maperror.c b/maperror.c
index 290f38a..9a49db6 100644
--- a/maperror.c
+++ b/maperror.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maperror.c 11415 2011-03-31 08:50:39Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of msSetError(), msDebug() and related functions.
@@ -41,7 +41,7 @@
 #endif
 #include <stdarg.h>
 
-MS_CVSID("$Id: maperror.c 11415 2011-03-31 08:50:39Z tbonfort $")
+MS_CVSID("$Id$")
 
 static char *ms_errorCodes[MS_NUMERRORCODES] = {"",
 						"Unable to access file.",
diff --git a/maperror.h b/maperror.h
index cedd79a..f71c529 100644
--- a/maperror.h
+++ b/maperror.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maperror.h 11128 2011-03-09 20:38:48Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Declarations for Error and Debug functions.
diff --git a/mapfile.c b/mapfile.c
index 702a450..e31c39a 100644
--- a/mapfile.c
+++ b/mapfile.c
@@ -44,7 +44,7 @@
 #  include "gdal.h"
 #endif
 
-MS_CVSID("$Id: mapfile.c 11882 2011-07-08 04:03:49Z sdlime $")
+MS_CVSID("$Id$")
 
 extern int msyylex(void);
 extern void msyyrestart(FILE *);
@@ -616,8 +616,10 @@ static void writeAttributeBinding(FILE *stream, int indent, const char *name, at
   fprintf(stream, "%s [%s]\n", name, binding->item);
 }
 
-static void writeColor(FILE *stream, int indent, const char *name, colorObj *color) {
-  if(!MS_VALID_COLOR(*color)) return;
+static void writeColor(FILE *stream, int indent, const char *name, colorObj *defaultColor, colorObj *color) {
+    if (!defaultColor && !MS_VALID_COLOR(*color)) return;
+    else if(defaultColor && MS_COMPARE_COLOR(*defaultColor, *color)) return; /* if defaultColor has the same value than the color, return.*/
+  
   writeIndent(stream, ++indent);
 #if ALPHACOLOR_ENABLED
   fprintf(stream, "%s %d %d %d\n", name, color->red, color->green, color->blue, color->alpha);
@@ -1923,6 +1925,7 @@ int msUpdateLabelFromString(labelObj *label, char *string)
 static void writeLabel(FILE *stream, int indent, labelObj *label)
 {
   int i;
+  colorObj c;
 
   if(label->size == -1) return; /* there is no default label anymore */
 
@@ -1958,7 +1961,10 @@ static void writeLabel(FILE *stream, int indent, labelObj *label)
 
   if(label->numbindings > 0 && label->bindings[MS_LABEL_BINDING_COLOR].item)
     writeAttributeBinding(stream, indent, "COLOR", &(label->bindings[MS_LABEL_BINDING_COLOR]));
-  else writeColor(stream, indent, "COLOR", &(label->color));
+  else {
+    MS_INIT_COLOR(c,0,0,0,255);
+    writeColor(stream, indent, "COLOR", &c, &(label->color));
+  }
 
   writeString(stream, indent, "ENCODING", NULL, label->encoding);
   writeKeyword(stream, indent, "FORCE", label->force, 1, MS_TRUE, "TRUE");
@@ -1972,7 +1978,7 @@ static void writeLabel(FILE *stream, int indent, labelObj *label)
     
   if(label->numbindings > 0 && label->bindings[MS_LABEL_BINDING_OUTLINECOLOR].item)
     writeAttributeBinding(stream, indent, "OUTLINECOLOR", &(label->bindings[MS_LABEL_BINDING_OUTLINECOLOR]));
-  else writeColor(stream, indent, "OUTLINECOLOR", &(label->outlinecolor));
+  else  writeColor(stream, indent, "OUTLINECOLOR", NULL, &(label->outlinecolor));
 
   writeNumber(stream, indent, "OUTLINEWIDTH", 1, label->outlinewidth);
   writeKeyword(stream, indent, "PARTIALS", label->partials, 1, MS_FALSE, "FALSE");
@@ -1986,7 +1992,7 @@ static void writeLabel(FILE *stream, int indent, labelObj *label)
   else writeNumber(stream, indent, "PRIORITY", MS_DEFAULT_LABEL_PRIORITY, label->priority);
 
   writeNumber(stream, indent, "REPEATDISTANCE", 0, label->repeatdistance);
-  writeColor(stream, indent, "SHADOWCOLOR", &(label->shadowcolor));
+  writeColor(stream, indent, "SHADOWCOLOR", NULL, &(label->shadowcolor));
   writeDimension(stream, indent, "SHADOWSIZE", label->shadowsizex, label->shadowsizey, label->bindings[MS_LABEL_BINDING_SHADOWSIZEX].item, label->bindings[MS_LABEL_BINDING_SHADOWSIZEY].item);
 
   writeNumber(stream, indent, "MAXOVERLAPANGLE", 22.5, label->maxoverlapangle);
@@ -2697,14 +2703,25 @@ void writeStyle(FILE *stream, int indent, styleObj *style) {
   else writeNumberOrKeyword(stream, indent, "ANGLE", 360, style->angle, style->autoangle, 1, MS_TRUE, "AUTO");
 
   writeKeyword(stream, indent, "ANTIALIAS", style->antialias, 1, MS_TRUE, "TRUE");
-  writeColor(stream, indent, "BACKGROUNDCOLOR", &(style->backgroundcolor));
+  writeColor(stream, indent, "BACKGROUNDCOLOR", NULL, &(style->backgroundcolor));
 
   if(style->numbindings > 0 && style->bindings[MS_STYLE_BINDING_COLOR].item)
     writeAttributeBinding(stream, indent, "COLOR", &(style->bindings[MS_STYLE_BINDING_COLOR]));
-  else writeColor(stream, indent, "COLOR", &(style->color));
+  else writeColor(stream, indent, "COLOR", NULL, &(style->color));
   
   writeNumber(stream, indent, "GAP", 0, style->gap);
 
+  if(style->_geomtransform.type != MS_GEOMTRANSFORM_NONE) {
+    writeKeyword(stream, indent, "GEOMTRANSFORM", style->_geomtransform.type, 6,
+                 MS_GEOMTRANSFORM_BBOX, "\"bbox\"",
+                 MS_GEOMTRANSFORM_END, "\"end\"",
+                 MS_GEOMTRANSFORM_LABELPOINT, "\"labelpnt\"",
+                 MS_GEOMTRANSFORM_LABELPOLY, "\"labelpoly\"",
+                 MS_GEOMTRANSFORM_START, "\"start\"",
+                 MS_GEOMTRANSFORM_VERTICES, "\"vertices\""
+    );
+  }
+
   if(style->linecap != MS_CJC_DEFAULT_CAPS) {
      writeKeyword(stream,indent,"LINECAP",(int)style->linecap,5,
            MS_CJC_NONE,"NONE",
@@ -2737,7 +2754,7 @@ void writeStyle(FILE *stream, int indent, styleObj *style) {
 
   if(style->numbindings > 0 && style->bindings[MS_STYLE_BINDING_OUTLINECOLOR].item)
     writeAttributeBinding(stream, indent, "OUTLINECOLOR", &(style->bindings[MS_STYLE_BINDING_OUTLINECOLOR]));
-  else writeColor(stream, indent, "OUTLINECOLOR", &(style->outlinecolor)); 
+  else  writeColor(stream, indent, "OUTLINECOLOR", NULL, &(style->outlinecolor)); 
 
   if(style->numbindings > 0 && style->bindings[MS_STYLE_BINDING_OUTLINEWIDTH].item)
     writeAttributeBinding(stream, indent, "OUTLINEWIDTH", &(style->bindings[MS_STYLE_BINDING_OUTLINEWIDTH]));
@@ -2780,11 +2797,6 @@ void writeStyle(FILE *stream, int indent, styleObj *style) {
     writeDimension(stream, indent, "DATARANGE", style->minvalue, style->maxvalue, NULL, NULL);
   }
 
-  if(style->_geomtransform.type != MS_GEOMTRANSFORM_NONE) {
-    /*
-    ** TODO: fprintf(stream, "        GEOMTRANSFORM \"%s\"\n",style->_geomtransformexpression);
-    */
-  }
   writeBlockEnd(stream, indent, "STYLE");
 }
 
@@ -4004,7 +4016,7 @@ static void writeLayer(FILE *stream, int indent, layerObj *layer)
   writeNumber(stream, indent, "MINSCALEDENOM", -1, layer->minscaledenom);
   writeNumber(stream, indent, "MINFEATURESIZE", -1, layer->minfeaturesize);
   writeString(stream, indent, "NAME", NULL, layer->name);
-  writeColor(stream, indent, "OFFSITE", &(layer->offsite));
+  writeColor(stream, indent, "OFFSITE", NULL, &(layer->offsite));
   writeString(stream, indent, "PLUGIN", NULL, layer->plugin_library_original);
   writeKeyword(stream, indent, "POSTLABELCACHE", layer->postlabelcache, 1, MS_TRUE, "TRUE");
   for(i=0; i<layer->numprocessing; i++)
@@ -4179,14 +4191,18 @@ int msUpdateReferenceMapFromString(referenceMapObj *ref, char *string, int url_s
 
 static void writeReferenceMap(FILE *stream, int indent, referenceMapObj *ref)
 {
+  colorObj c;
+
   if(!ref->image) return;
 
   indent++;
   writeBlockBegin(stream, indent, "REFERENCE");
-  writeColor(stream, indent, "COLOR", &(ref->color));
+  MS_INIT_COLOR(c,255,0,0,255);
+  writeColor(stream, indent, "COLOR", &c, &(ref->color));
   writeExtent(stream, indent, "EXTENT", ref->extent);
   writeString(stream, indent, "IMAGE", NULL, ref->image);
-  writeColor(stream, indent, "OUTLINECOLOR", &(ref->outlinecolor));
+  MS_INIT_COLOR(c,0,0,0,255);
+  writeColor(stream, indent, "OUTLINECOLOR", &c, &(ref->outlinecolor));
   writeDimension(stream, indent, "SIZE", ref->width, ref->height, NULL, NULL);
   writeKeyword(stream, indent, "STATUS", ref->status, 2, MS_ON, "ON", MS_OFF, "OFF");
   writeNumberOrString(stream, indent, "MARKER", 0, ref->marker, ref->markername);
@@ -4513,14 +4529,17 @@ int msUpdateLegendFromString(legendObj *legend, char *string, int url_string)
 
 static void writeLegend(FILE *stream, int indent, legendObj *legend)
 {
+  colorObj c;
+
   indent++;
   writeBlockBegin(stream, indent, "LEGEND");
-  writeColor(stream, indent, "IMAGECOLOR", &(legend->imagecolor));
+  MS_INIT_COLOR(c,255,255,255,255);
+  writeColor(stream, indent, "IMAGECOLOR", &c, &(legend->imagecolor));
   writeKeyword(stream, indent, "INTERLACE", legend->interlace, 2, MS_TRUE, "TRUE", MS_FALSE, "FALSE");
   writeDimension(stream, indent, "KEYSIZE", legend->keysizex, legend->keysizey, NULL, NULL);
   writeDimension(stream, indent, "KEYSPACING", legend->keyspacingx, legend->keyspacingy, NULL, NULL);
   writeLabel(stream, indent, &(legend->label));
-  writeColor(stream, indent, "OUTLINECOLOR", &(legend->outlinecolor));
+  writeColor(stream, indent, "OUTLINECOLOR", NULL, &(legend->outlinecolor));
   if(legend->status == MS_EMBED) writeKeyword(stream, indent, "POSITION", legend->position, 6, MS_LL, "LL", MS_UL, "UL", MS_UR, "UR", MS_LR, "LR", MS_UC, "UC", MS_LC, "LC");
   writeKeyword(stream, indent, "POSTLABELCACHE", legend->postlabelcache, 1, MS_TRUE, "TRUE");
   writeKeyword(stream, indent, "STATUS", legend->status, 3, MS_ON, "ON", MS_OFF, "OFF", MS_EMBED, "EMBED");
@@ -4656,16 +4675,19 @@ int msUpdateScalebarFromString(scalebarObj *scalebar, char *string, int url_stri
 
 static void writeScalebar(FILE *stream, int indent, scalebarObj *scalebar)
 {
+  colorObj c;
+
   indent++;
   writeBlockBegin(stream, indent, "SCALEBAR");
   writeKeyword(stream, indent, "ALIGN", scalebar->align, 2, MS_ALIGN_LEFT, "LEFT", MS_ALIGN_RIGHT, "RIGHT");
-  writeColor(stream, indent, "BACKGROUNDCOLOR", &(scalebar->backgroundcolor));
-  writeColor(stream, indent, "COLOR", &(scalebar->color));
-  writeColor(stream, indent, "IMAGECOLOR", &(scalebar->imagecolor));
+  writeColor(stream, indent, "BACKGROUNDCOLOR", NULL, &(scalebar->backgroundcolor));
+  MS_INIT_COLOR(c,0,0,0,255);
+  writeColor(stream, indent, "COLOR", &c, &(scalebar->color));
+  writeColor(stream, indent, "IMAGECOLOR", NULL, &(scalebar->imagecolor));
   writeKeyword(stream, indent, "INTERLACE", scalebar->interlace, 2, MS_TRUE, "TRUE", MS_FALSE, "FALSE");
   writeNumber(stream, indent, "INTERVALS", -1, scalebar->intervals);
   writeLabel(stream, indent, &(scalebar->label));
-  writeColor(stream, indent, "OUTLINECOLOR", &(scalebar->outlinecolor));
+  writeColor(stream, indent, "OUTLINECOLOR", NULL, &(scalebar->outlinecolor));
   if(scalebar->status == MS_EMBED) writeKeyword(stream, indent, "POSITION", scalebar->position, 6, MS_LL, "LL", MS_UL, "UL", MS_UR, "UR", MS_LR, "LR", MS_UC, "UC", MS_LC, "LC");
   writeKeyword(stream, indent, "POSTLABELCACHE", scalebar->postlabelcache, 1, MS_TRUE, "TRUE");
   writeDimension(stream, indent, "SIZE", scalebar->width, scalebar->height, NULL, NULL);
@@ -4752,9 +4774,12 @@ int msUpdateQueryMapFromString(queryMapObj *querymap, char *string, int url_stri
 
 static void writeQueryMap(FILE *stream, int indent, queryMapObj *querymap)
 {
+  colorObj c;
+
   indent++;
   writeBlockBegin(stream, indent, "QUERYMAP");
-  writeColor(stream, indent, "COLOR", &(querymap->color));
+  MS_INIT_COLOR(c,255,255,0,255);
+  writeColor(stream, indent, "COLOR",  &c, &(querymap->color));
   writeDimension(stream, indent, "SIZE", querymap->width, querymap->height, NULL, NULL);
   writeKeyword(stream, indent, "STATUS", querymap->status, 2, MS_ON, "ON", MS_OFF, "OFF");
   writeKeyword(stream, indent, "STYLE", querymap->style, 3, MS_NORMAL, "NORMAL", MS_HILITE, "HILITE", MS_SELECTED, "SELECTED");
@@ -5218,6 +5243,7 @@ int msSaveMap(mapObj *map, char *filename)
   int i, indent=0;
   FILE *stream;
   char szPath[MS_MAXPATHLEN];
+  colorObj c;
 
   if(!map) {
     msSetError(MS_MISCERR, "Map is undefined.", "msSaveMap()");
@@ -5242,7 +5268,8 @@ int msSaveMap(mapObj *map, char *filename)
   writeNumber(stream, indent, "DEFRESOLUTION", 72.0, map->defresolution);
   writeExtent(stream, indent, "EXTENT", map->extent);
   writeString(stream, indent, "FONTSET", NULL, map->fontset.filename);
-  writeColor(stream, indent, "IMAGECOLOR", &(map->imagecolor));
+  MS_INIT_COLOR(c,255,255,255,255);
+  writeColor(stream, indent, "IMAGECOLOR", &c, &(map->imagecolor));
   writeString(stream, indent, "IMAGETYPE", NULL, map->imagetype);
   writeKeyword(stream, indent, "INTERLACE", map->interlace, 2, MS_TRUE, "TRUE", MS_FALSE, "FALSE");
   writeNumber(stream, indent, "MAXSIZE", MS_MAXIMAGESIZE_DEFAULT, map->maxsize);
diff --git a/mapfile.h b/mapfile.h
index bee99c5..f53e015 100644
--- a/mapfile.h
+++ b/mapfile.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapfile.h 11177 2011-03-16 19:29:01Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Keyword definitions for the mapfiles and symbolfiles.
diff --git a/mapgd.c b/mapgd.c
index 614e571..ba83956 100644
--- a/mapgd.c
+++ b/mapgd.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapgd.c 11583 2011-04-15 10:01:11Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  GD rendering functions (using renderer plugin API)
@@ -344,14 +344,14 @@ int renderLineGD(imageObj *img, shapeObj *p, strokeStyleObj *stroke)
   }
 
   if(stroke->width > 1) {
-     int brush_fc; 
-     brush = gdImageCreate(stroke->width, stroke->width);
+     int brush_fc;
+     brush = gdImageCreate(ceil(stroke->width), ceil(stroke->width));
      gdImageColorAllocate(brush, gdImageRed(ip,0), gdImageGreen(ip, 0), gdImageBlue(ip, 0));
      gdImageColorTransparent(brush,0);
      brush_fc = gdImageColorAllocate(brush, gdImageRed(ip,stroke->color->pen),
            gdImageGreen(ip,stroke->color->pen), gdImageBlue(ip,stroke->color->pen));
-     gdImageFilledEllipse(brush,MS_NINT(stroke->width/2),MS_NINT(stroke->width/2),
-           stroke->width,stroke->width, brush_fc);
+     gdImageFilledEllipse(brush,MS_NINT(brush->sx/2),MS_NINT(brush->sy/2),
+           MS_NINT(stroke->width),MS_NINT(stroke->width), brush_fc);
      gdImageSetBrush(ip, brush);
      if(stroke->patternlength > 0) {
        c = gdStyledBrushed;
diff --git a/mapgdal.c b/mapgdal.c
index 435636f..2d0f3a7 100644
--- a/mapgdal.c
+++ b/mapgdal.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapgdal.c 11218 2011-03-18 13:41:32Z warmerdam $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of support for output using GDAL.
@@ -31,7 +31,7 @@
 #include "mapserver.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: mapgdal.c 11218 2011-03-18 13:41:32Z warmerdam $")
+MS_CVSID("$Id$")
 
 #if defined(USE_GDAL) || defined(USE_OGR)
 #include "cpl_conv.h"
diff --git a/mapgeomtransform.c b/mapgeomtransform.c
index a065f03..e4f95e1 100644
--- a/mapgeomtransform.c
+++ b/mapgeomtransform.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapgeomtransform.c 11513 2011-04-10 09:50:28Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose: RFC48 implementation of geometry transformations for styling
@@ -53,6 +53,9 @@ void msStyleSetGeomTransform(styleObj *s, char *transform) {
   else if(!strncasecmp("labelpoly",transform,9)) {
     s->_geomtransform.type = MS_GEOMTRANSFORM_LABELPOLY;
   }
+  else if(!strncasecmp("centroid",transform,8)) {
+    s->_geomtransform.type = MS_GEOMTRANSFORM_CENTROID;
+  }
   else {
     s->_geomtransform.type = MS_GEOMTRANSFORM_NONE;
     msSetError(MS_MISCERR,"unknown transform expression","msStyleSetGeomTransform()");
diff --git a/mapgeomutil.cpp b/mapgeomutil.cpp
index 475463e..e4c910b 100644
--- a/mapgeomutil.cpp
+++ b/mapgeomutil.cpp
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapgeomutil.cpp 11592 2011-04-18 10:15:18Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Rendering utility functions
diff --git a/mapgeos.c b/mapgeos.c
index 94faacc..0f0c0af 100644
--- a/mapgeos.c
+++ b/mapgeos.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapgeos.c 11470 2011-04-05 20:11:33Z tamas $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  MapServer-GEOS integration.
diff --git a/mapgml.c b/mapgml.c
index 17f6518..3cd64ed 100644
--- a/mapgml.c
+++ b/mapgml.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapgml.c 11544 2011-04-12 12:38:18Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  shapeObj to GML output via MapServer queries.
@@ -31,7 +31,7 @@
 #include "maperror.h"
 #include "mapgml.h"
 
-MS_CVSID("$Id: mapgml.c 11544 2011-04-12 12:38:18Z aboudreault $")
+MS_CVSID("$Id$")
 
 /* Use only mapgml.c if WMS or WFS is available (with minor exceptions at end)*/
 
diff --git a/mapgml.h b/mapgml.h
index 89e9a66..b5b7bcc 100644
--- a/mapgml.h
+++ b/mapgml.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapgml.h 7504 2008-04-08 21:13:45Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Headers for mapgml.c.  shapeObj to GML output via MapServer 
diff --git a/mapgraticule.c b/mapgraticule.c
index 2d20e42..1284a0b 100644
--- a/mapgraticule.c
+++ b/mapgraticule.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapgraticule.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Graticule Renderer
@@ -30,7 +30,7 @@
 #include <assert.h>
 #include "mapproject.h"
 
-MS_CVSID("$Id: mapgraticule.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 /**********************************************************************************************************************
  *
diff --git a/maphash.c b/maphash.c
index e0db094..26ccf8f 100644
--- a/maphash.c
+++ b/maphash.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maphash.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implement hashTableObj class.
@@ -32,7 +32,7 @@
 #include "mapserver.h"
 #include "maphash.h"
 
-MS_CVSID("$Id: maphash.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 static unsigned hash(const char *key)
 {
diff --git a/maphash.h b/maphash.h
index 6cb7407..5efc4d2 100644
--- a/maphash.h
+++ b/maphash.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maphash.h 6458 2007-08-04 02:49:10Z hobu $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Declarations for the hashTableObj and related stuff.
diff --git a/maphttp.c b/maphttp.c
index 3c12688..9a383fc 100644
--- a/maphttp.c
+++ b/maphttp.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: maphttp.c 10889 2011-01-22 17:25:28Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Utility functions to access files via HTTP (requires libcurl)
@@ -37,7 +37,7 @@
 #include "maperror.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: maphttp.c 10889 2011-01-22 17:25:28Z assefa $")
+MS_CVSID("$Id$")
 
 #include <time.h>
 #ifndef _WIN32
diff --git a/maphttp.h b/maphttp.h
index fba6043..337c034 100644
--- a/maphttp.h
+++ b/maphttp.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maphttp.h 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  http requests related functions
diff --git a/mapimageio.c b/mapimageio.c
index 2687a95..718d251 100644
--- a/mapimageio.c
+++ b/mapimageio.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapimageio.c 11599 2011-04-19 05:14:17Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Low level PNG/JPEG/GIF image io native functions
@@ -38,7 +38,7 @@
 #include "gif_lib.h"
 #endif
 
-MS_CVSID("$Id: mapimageio.c 11599 2011-04-19 05:14:17Z tbonfort $")
+MS_CVSID("$Id$")
 
 typedef struct _streamInfo {
     FILE *fp;
diff --git a/mapimagemap.c b/mapimagemap.c
index d82627f..71be7c1 100644
--- a/mapimagemap.c
+++ b/mapimagemap.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapimagemap.c 11473 2011-04-06 03:05:02Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implements imagemap outputformat support.
@@ -38,7 +38,7 @@
 #include <io.h>
 #endif
 
-MS_CVSID("$Id: mapimagemap.c 11473 2011-04-06 03:05:02Z dmorissette $")
+MS_CVSID("$Id$")
 
 #define MYDEBUG 0
 #define DEBUG_IF if (MYDEBUG > 2) 
diff --git a/mapio.c b/mapio.c
index 0992a9c..1e79585 100644
--- a/mapio.c
+++ b/mapio.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapio.c 11163 2011-03-15 20:54:31Z schpidi $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementations for MapServer IO redirection capability.
@@ -37,7 +37,7 @@
 #include <io.h>
 #endif
 
-MS_CVSID("$Id: mapio.c 11163 2011-03-15 20:54:31Z schpidi $")
+MS_CVSID("$Id$")
 
 static int is_msIO_initialized = MS_FALSE;
 
diff --git a/mapio.h b/mapio.h
index cd9f7df..84b5080 100644
--- a/mapio.h
+++ b/mapio.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapio.h 11163 2011-03-15 20:54:31Z schpidi $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Definitions for MapServer IO redirection capability.
diff --git a/mapjoin.c b/mapjoin.c
index 8a6e3ac..828530c 100644
--- a/mapjoin.c
+++ b/mapjoin.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapjoin.c 11469 2011-04-05 19:52:41Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implements MapServer joins. 
@@ -29,7 +29,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapjoin.c 11469 2011-04-05 19:52:41Z aboudreault $")
+MS_CVSID("$Id$")
 
 #define ROW_ALLOCATION_SIZE 10
 
diff --git a/mapkml.cpp b/mapkml.cpp
index cf723bb..8cb34e7 100644
--- a/mapkml.cpp
+++ b/mapkml.cpp
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapkml.cpp 11506 2011-04-07 21:08:48Z assefa $ 
+ * $Id$ 
  *
  * Project:  MapServer
  * Purpose:  Headers for mapkml.cpp Google Earth KML output
diff --git a/mapkmlrenderer.cpp b/mapkmlrenderer.cpp
index d44fcba..d013ca3 100644
--- a/mapkmlrenderer.cpp
+++ b/mapkmlrenderer.cpp
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapkmlrenderer.cpp 11575 2011-04-14 14:18:31Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Google Earth KML output
diff --git a/mapkmlrenderer.h b/mapkmlrenderer.h
index 5abca52..3f95f7e 100644
--- a/mapkmlrenderer.h
+++ b/mapkmlrenderer.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapkmlrenderer.h 11506 2011-04-07 21:08:48Z assefa $ 
+ * $Id$ 
  *
  * Project:  MapServer
  * Purpose:  Headers for mapkmlrenderer.cpp Google Earth KML output
diff --git a/maplabel.c b/maplabel.c
index 51fda7f..a911e0c 100644
--- a/maplabel.c
+++ b/maplabel.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maplabel.c 11620 2011-04-27 16:18:45Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Labeling Implementation.
@@ -38,7 +38,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: maplabel.c 11620 2011-04-27 16:18:45Z sdlime $")
+MS_CVSID("$Id$")
 
 
 /**
@@ -446,6 +446,28 @@ int msAddLabel(mapObj *map, int layerindex, int classindex, shapeObj *shape, poi
   return(MS_SUCCESS);
 }
 
+
+/*
+** Is a label completely in the image, reserving a gutter (in pixels) inside 
+** image for no labels (effectively making image larger. The gutter can be 
+** negative in cases where a label has a buffer around it.
+*/
+static int labelInImage(int width, int height, shapeObj *lpoly, int gutter)
+{
+  int i,j;
+
+  for(i=0; i<lpoly->numlines; i++) {
+    for(j=1; j<lpoly->line[i].numpoints; j++) {
+      if(lpoly->line[i].point[j].x < gutter) return(MS_FALSE);
+      if(lpoly->line[i].point[j].x >= width-gutter) return(MS_FALSE);
+      if(lpoly->line[i].point[j].y < gutter) return(MS_FALSE);
+      if(lpoly->line[i].point[j].y >= height-gutter) return(MS_FALSE);
+    }
+  }
+
+  return(MS_TRUE);
+}
+
 /* msTestLabelCacheCollisions()
 **
 ** Compares current label against labels already drawn and markers from cache and discards it
@@ -956,26 +978,6 @@ pointObj get_metrics(pointObj *p, int position, rectObj rect, int ox, int oy, do
 }
 
 /*
-** is a label completely in the image (excluding label buffer)
-*/
-/* static int labelInImage(int width, int height, shapeObj *lpoly, int buffer) */
-int labelInImage(int width, int height, shapeObj *lpoly, int buffer)
-{
-  int i,j;
-
-  for(i=0; i<lpoly->numlines; i++) {
-    for(j=1; j<lpoly->line[i].numpoints; j++) {
-      if(lpoly->line[i].point[j].x < -buffer) return(MS_FALSE);
-      if(lpoly->line[i].point[j].x >= width+buffer) return(MS_FALSE);
-      if(lpoly->line[i].point[j].y < -buffer) return(MS_FALSE);
-      if(lpoly->line[i].point[j].y >= height+buffer) return(MS_FALSE);
-    }
-  }
-
-  return(MS_TRUE);
-}
-
-/*
 ** Variation on msIntersectPolygons. Label polygons aren't like shapefile polygons. They
 ** have no holes, and often do have overlapping parts (i.e. road symbols).
 */
@@ -1017,3 +1019,140 @@ int intersectLabelPolygons(shapeObj *p1, shapeObj *p2) {
 
   return(MS_FALSE);
 }
+
+/* For MapScript, exactly the same the msInsertStyle */
+int msInsertLabelStyle(labelObj *label, styleObj *style, int nStyleIndex) {
+    int i;
+
+    if (!style)
+    {
+        msSetError(MS_CHILDERR, "Can't insert a NULL Style", "msInsertLabelStyle()");
+        return -1;
+    }
+
+    /* Ensure there is room for a new style */
+    if (msGrowLabelStyles(label) == NULL) {
+        return -1;
+    }
+    /* Catch attempt to insert past end of styles array */
+    else if (nStyleIndex >= label->numstyles) {
+        msSetError(MS_CHILDERR, "Cannot insert style beyond index %d", "insertLabelStyle()", label->numstyles-1);
+        return -1;
+    }
+    else if (nStyleIndex < 0) { /* Insert at the end by default */
+        label->styles[label->numstyles]=style;
+	MS_REFCNT_INCR(style);
+        label->numstyles++;
+        return label->numstyles-1;
+    }
+    else if (nStyleIndex >= 0 && nStyleIndex < label->numstyles) {
+        /* Move styles existing at the specified nStyleIndex or greater */
+        /* to a higher nStyleIndex */
+        for (i=label->numstyles-1; i>=nStyleIndex; i--) {
+            label->styles[i+1] = label->styles[i];
+        }
+        label->styles[nStyleIndex]=style;
+	MS_REFCNT_INCR(style);
+        label->numstyles++;
+        return nStyleIndex;
+    }
+    else {
+        msSetError(MS_CHILDERR, "Invalid nStyleIndex", "insertLabelStyle()");
+        return -1;
+    }
+}
+
+/**
+ * Move the style up inside the array of styles.
+ */  
+int msMoveLabelStyleUp(labelObj *label, int nStyleIndex)
+{
+    styleObj *psTmpStyle = NULL;
+    if (label && nStyleIndex < label->numstyles && nStyleIndex >0)
+    {
+        psTmpStyle = (styleObj *)malloc(sizeof(styleObj));
+        initStyle(psTmpStyle);
+        
+        msCopyStyle(psTmpStyle, label->styles[nStyleIndex]);
+
+        msCopyStyle(label->styles[nStyleIndex], 
+                    label->styles[nStyleIndex-1]);
+        
+        msCopyStyle(label->styles[nStyleIndex-1], psTmpStyle);
+
+        return(MS_SUCCESS);
+    }
+    msSetError(MS_CHILDERR, "Invalid index: %d", "msMoveLabelStyleUp()",
+               nStyleIndex);
+    return (MS_FAILURE);
+}
+
+
+/**
+ * Move the style down inside the array of styles.
+ */  
+int msMoveLabelStyleDown(labelObj *label, int nStyleIndex)
+{
+    styleObj *psTmpStyle = NULL;
+
+    if (label && nStyleIndex < label->numstyles-1 && nStyleIndex >=0)
+    {
+        psTmpStyle = (styleObj *)malloc(sizeof(styleObj));
+        initStyle(psTmpStyle);
+        
+        msCopyStyle(psTmpStyle, label->styles[nStyleIndex]);
+
+        msCopyStyle(label->styles[nStyleIndex], 
+                    label->styles[nStyleIndex+1]);
+        
+        msCopyStyle(label->styles[nStyleIndex+1], psTmpStyle);
+
+        return(MS_SUCCESS);
+    }
+    msSetError(MS_CHILDERR, "Invalid index: %d", "msMoveLabelStyleDown()",
+               nStyleIndex);
+    return (MS_FAILURE);
+}
+
+/**
+ * Delete the style identified by the index and shift
+ * styles that follows the deleted style.
+ */  
+int msDeleteLabelStyle(labelObj *label, int nStyleIndex)
+{
+    int i = 0;
+    if (label && nStyleIndex < label->numstyles && nStyleIndex >=0)
+    {
+        if (freeStyle(label->styles[nStyleIndex]) == MS_SUCCESS)
+            msFree(label->styles[nStyleIndex]);
+        for (i=nStyleIndex; i< label->numstyles-1; i++)
+        {
+            label->styles[i] = label->styles[i+1];
+        }
+        label->styles[label->numstyles-1] = NULL;
+        label->numstyles--;
+        return(MS_SUCCESS);
+    }
+    msSetError(MS_CHILDERR, "Invalid index: %d", "msDeleteLabelStyle()",
+               nStyleIndex);
+    return (MS_FAILURE);
+}
+
+styleObj *msRemoveLabelStyle(labelObj *label, int nStyleIndex) {
+    int i;
+    styleObj *style;
+    if (nStyleIndex < 0 || nStyleIndex >= label->numstyles) {
+        msSetError(MS_CHILDERR, "Cannot remove style, invalid nStyleIndex %d", "removeLabelStyle()", nStyleIndex);
+        return NULL;
+    }
+    else {
+        style=label->styles[nStyleIndex];
+        for (i=nStyleIndex; i<label->numstyles-1; i++) {
+             label->styles[i]=label->styles[i+1];
+        }
+	label->styles[label->numstyles-1]=NULL;
+        label->numstyles--;
+	MS_REFCNT_DECR(style);
+        return style;
+    }
+}
diff --git a/maplayer.c b/maplayer.c
index 080c78c..a486e2d 100644
--- a/maplayer.c
+++ b/maplayer.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maplayer.c 11890 2011-07-12 13:06:14Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of most layerObj functions.
@@ -36,7 +36,7 @@
 #include "mapparser.h"
 
 #include <assert.h>
-MS_CVSID("$Id: maplayer.c 11890 2011-07-12 13:06:14Z assefa $")
+MS_CVSID("$Id$")
 
 static int populateVirtualTable(layerVTableObj *vtable);
 
diff --git a/maplegend.c b/maplegend.c
index 5680ade..85e7b9f 100644
--- a/maplegend.c
+++ b/maplegend.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maplegend.c 11673 2011-05-11 16:33:28Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Legend generation.
@@ -29,7 +29,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: maplegend.c 11673 2011-05-11 16:33:28Z tbonfort $")
+MS_CVSID("$Id$")
 
 #define PSF .8
 #define VMARGIN 5 /* margin at top and bottom of legend graphic */
diff --git a/maplexer.c b/maplexer.c
index a65c705..c5aa6fa 100644
--- a/maplexer.c
+++ b/maplexer.c
@@ -4068,6 +4068,8 @@ YY_RULE_SETUP
                                                   ++msyystring_size;
                                                   *msyystring_buffer_ptr++ = *msyytext;
                                                   if (strlen(msyytext)==2) {
+                                                      MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, 
+                                                                              msyystring_buffer_size, msyystring_buffer_ptr);
                                                      ++msyystring_size;
                                                      *msyystring_buffer_ptr++ = msyytext[1];
                                                   }
@@ -4076,7 +4078,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 305:
 YY_RULE_SETUP
-#line 607 "maplexer.l"
+#line 609 "maplexer.l"
 { 
                                                 MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, 
                                                                                            msyystring_buffer_size, msyystring_buffer_ptr);
@@ -4091,7 +4093,7 @@ YY_RULE_SETUP
 case 306:
 /* rule 306 can match eol */
 YY_RULE_SETUP
-#line 618 "maplexer.l"
+#line 620 "maplexer.l"
 {
                                                  char *yptr = msyytext;
                                                  while ( *yptr ) { 
@@ -4105,7 +4107,7 @@ YY_RULE_SETUP
 case 307:
 /* rule 307 can match eol */
 YY_RULE_SETUP
-#line 628 "maplexer.l"
+#line 630 "maplexer.l"
 {
                                                  msyytext++;
                                                  msyytext[strlen(msyytext)-1] = '\0';
@@ -4133,7 +4135,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 308:
 YY_RULE_SETUP
-#line 653 "maplexer.l"
+#line 655 "maplexer.l"
 {
                                                  msyystring_return_state = MS_TOKEN_LITERAL_STRING;
                                                  msyystring_begin = msyytext[0]; 
@@ -4144,7 +4146,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 309:
 YY_RULE_SETUP
-#line 661 "maplexer.l"
+#line 663 "maplexer.l"
 { 
                                                     MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), 
                                                                             msyystring_buffer_size, msyystring_buffer_ptr);
@@ -4155,11 +4157,11 @@ YY_RULE_SETUP
 case 310:
 /* rule 310 can match eol */
 YY_RULE_SETUP
-#line 668 "maplexer.l"
+#line 670 "maplexer.l"
 { msyylineno++; }
 	YY_BREAK
 case YY_STATE_EOF(INITIAL):
-#line 670 "maplexer.l"
+#line 672 "maplexer.l"
 {
                                                   if( --include_stack_ptr < 0 )
                                                     return(EOF); /* end of main file */
@@ -4174,14 +4176,14 @@ case YY_STATE_EOF(INITIAL):
 case 311:
 /* rule 311 can match eol */
 YY_RULE_SETUP
-#line 681 "maplexer.l"
+#line 683 "maplexer.l"
 {
   return(0); 
 }
 	YY_BREAK
 case 312:
 YY_RULE_SETUP
-#line 685 "maplexer.l"
+#line 687 "maplexer.l"
 { 
                                                   MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), 
                                                                           msyystring_buffer_size, msyystring_buffer_ptr);
@@ -4191,15 +4193,15 @@ YY_RULE_SETUP
 	YY_BREAK
 case 313:
 YY_RULE_SETUP
-#line 691 "maplexer.l"
+#line 693 "maplexer.l"
 { return(msyytext[0]); }
 	YY_BREAK
 case 314:
 YY_RULE_SETUP
-#line 692 "maplexer.l"
+#line 694 "maplexer.l"
 ECHO;
 	YY_BREAK
-#line 4203 "maplexer.c"
+#line 4205 "maplexer.c"
 case YY_STATE_EOF(URL_VARIABLE):
 case YY_STATE_EOF(URL_STRING):
 case YY_STATE_EOF(EXPRESSION_STRING):
@@ -5201,7 +5203,7 @@ void msyyfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 692 "maplexer.l"
+#line 694 "maplexer.l"
 
 
 
diff --git a/maplexer.l b/maplexer.l
index 777bdb5..6029f07 100644
--- a/maplexer.l
+++ b/maplexer.l
@@ -598,6 +598,8 @@ char path[MS_MAXPATHLEN];
                                                   ++msyystring_size;
                                                   *msyystring_buffer_ptr++ = *msyytext;
                                                   if (strlen(msyytext)==2) {
+                                                      MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, 
+                                                                              msyystring_buffer_size, msyystring_buffer_ptr);
                                                      ++msyystring_size;
                                                      *msyystring_buffer_ptr++ = msyytext[1];
                                                   }
diff --git a/maplibxml2.c b/maplibxml2.c
index aa0cfc4..52dfba9 100644
--- a/maplibxml2.c
+++ b/maplibxml2.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maplibxml2.c 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  libxml2 convenience wrapper functions
@@ -36,7 +36,7 @@
 #include<libxml/xpath.h>
 #include<libxml/xpathInternals.h>
 
-MS_CVSID("$Id: maplibxml2.c 11503 2011-04-07 19:56:16Z dmorissette $")
+MS_CVSID("$Id$")
 
 /**
  * msLibXml2GenerateList()
diff --git a/maplibxml2.h b/maplibxml2.h
index 51e3a6e..019f0d8 100644
--- a/maplibxml2.h
+++ b/maplibxml2.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maplibxml2.h 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  libxml2 convenience wrapper functions include file
diff --git a/mapmssql2008.c b/mapmssql2008.c
index ce3e811..2080995 100644
--- a/mapmssql2008.c
+++ b/mapmssql2008.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapmssql2008.c 11884 2011-07-09 13:01:00Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  MS SQL 2008 (Katmai) Layer Connector
@@ -34,7 +34,7 @@
 
 #define _CRT_SECURE_NO_WARNINGS 1
 
-/* $Id: mapmssql2008.c 11884 2011-07-09 13:01:00Z sdlime $ */
+/* $Id$ */
 #include <assert.h>
 #include "mapserver.h"
 #include "maptime.h"
@@ -49,7 +49,7 @@
 #include <string.h>
 #include <ctype.h> /* tolower() */
 
-MS_CVSID("$Id: mapmssql2008.c 11884 2011-07-09 13:01:00Z sdlime $")
+MS_CVSID("$Id$")
 
 /* Structure for connection to an ODBC database (Microsoft preferred way to connect to SQL Server 2005 from c/c++) */
 typedef struct msODBCconn_t
diff --git a/mapobject.c b/mapobject.c
index 74fe831..f7618f9 100644
--- a/mapobject.c
+++ b/mapobject.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapobject.c 11376 2011-03-30 01:11:13Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Functions for operating on a mapObj that don't belong in a
@@ -35,7 +35,7 @@
 #  include "cpl_conv.h"
 #endif
 
-MS_CVSID("$Id: mapobject.c 11376 2011-03-30 01:11:13Z dmorissette $")
+MS_CVSID("$Id$")
 
 void freeWeb(webObj *web);
 void freeScalebar(scalebarObj *scalebar);
@@ -781,7 +781,7 @@ int msMapLoadOWSParameters(mapObj *map, cgiRequestObj *request,
     int version;
     char *wms_exception_format = NULL;
     const char *wms_request= NULL;
-    int i =0;
+    int result, i = 0;
     owsRequestObj ows_request;
 
     ows_request.numlayers = 0;
@@ -800,9 +800,15 @@ int msMapLoadOWSParameters(mapObj *map, cgiRequestObj *request,
 
      msOWSRequestLayersEnabled(map, "M", wms_request, &ows_request);
 
-     return msWMSLoadGetMapParams(map, version, request->ParamNames,
-                                  request->ParamValues, request->NumParams,  wms_exception_format, 
-                                  wms_request, &ows_request);
+     result = msWMSLoadGetMapParams(map, version, request->ParamNames,
+				    request->ParamValues, request->NumParams,  wms_exception_format, 
+				    wms_request, &ows_request);
+
+     if (ows_request.numlayers > 0)
+       msFree(ows_request.enabled_layers);
+
+     return result;
+
 #else
     msSetError(MS_WMSERR, "WMS server support is not available.",
                "msMapLoadOWSParameters()");
diff --git a/mapogcfilter.c b/mapogcfilter.c
index 3cdc409..8bbc8e6 100644
--- a/mapogcfilter.c
+++ b/mapogcfilter.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapogcfilter.c 11890 2011-07-12 13:06:14Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC Filter Encoding implementation
@@ -37,7 +37,7 @@
 #include "mapserver.h"
 #include "mapowscommon.h"
 
-MS_CVSID("$Id: mapogcfilter.c 11890 2011-07-12 13:06:14Z assefa $")
+MS_CVSID("$Id$")
 
 #ifdef USE_OGR
 
@@ -2569,7 +2569,10 @@ char *FLTGetBinaryComparisonSQLExpresssion(FilterEncodingNode *psFilterNode,
         psFilterNode->psRightNode->pOther && 
         (*(int *)psFilterNode->psRightNode->pOther) == 1)
     {
-        snprintf(szTmp, sizeof(szTmp), "lower('%s') ", psFilterNode->psRightNode->pszValue);
+        char* pszEscapedStr;
+        pszEscapedStr = msLayerEscapeSQLParam(lp, psFilterNode->psRightNode->pszValue);
+        snprintf(szTmp, sizeof(szTmp), "lower('%s') ", pszEscapedStr);
+        msFree(pszEscapedStr);
         strlcat(szBuffer, szTmp, bufferSize);
     }
     else
diff --git a/mapogcfilter.h b/mapogcfilter.h
index 572ecb6..7a216a2 100644
--- a/mapogcfilter.h
+++ b/mapogcfilter.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapogcfilter.h 11890 2011-07-12 13:06:14Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC Filter Encoding implementation
diff --git a/mapogcfiltercommon.c b/mapogcfiltercommon.c
index 3d6f80e..afdf7a2 100644
--- a/mapogcfiltercommon.c
+++ b/mapogcfiltercommon.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapogcfiltercommon.c 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC Filter Encoding implementation
@@ -34,7 +34,7 @@
 #include "mapserver.h"
 #include "mapowscommon.h"
 
-MS_CVSID("$Id: mapogcfiltercommon.c 11503 2011-04-07 19:56:16Z dmorissette $")
+MS_CVSID("$Id$")
 
 #ifdef USE_OGR
 
diff --git a/mapogcsld.c b/mapogcsld.c
index 5b7025a..5c41398 100644
--- a/mapogcsld.c
+++ b/mapogcsld.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapogcsld.c 11640 2011-05-03 21:24:38Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC SLD implementation
@@ -34,7 +34,7 @@
 #include "cpl_string.h"
 #endif
 
-MS_CVSID("$Id: mapogcsld.c 11640 2011-05-03 21:24:38Z assefa $")
+MS_CVSID("$Id$")
 
 #define SLD_LINE_SYMBOL_NAME "sld_line_symbol"
 #define SLD_LINE_SYMBOL_DASH_NAME "sld_line_symbol_dash"
@@ -419,14 +419,14 @@ int msSLDApplySLD(mapObj *map, char *psSLDXML, int iLayer,
                                                     msFree(pszSqlExpression);
                                                 }
                                                 else
-                                                {
+						{
                                                     bFailedExpression =1;
                                                     break;
                                                 }
                                                 FLTFreeFilterEncodingNode(psExpressionNode);
                                             }
                                             else
-                                            {
+					    {   
                                                 bFailedExpression =1;
                                                 break;
                                             }
@@ -436,9 +436,6 @@ int msSLDApplySLD(mapObj *map, char *psSLDXML, int iLayer,
                                             snprintf(szTmp, sizeof(szTmp), "%s", "))");
                                             pszBuffer =msStringConcatenate(pszBuffer, szTmp);
                                             msLoadExpressionString(&lp->filter, pszBuffer);
-                                            for (k=0;k<lp->numclasses;k++)
-                                              freeExpression(&lp->class[k]->expression);
-                                              
                                         }
                                         msFree(pszBuffer);
                                     }
@@ -4710,31 +4707,14 @@ int msSLDNumberOfLogicalOperators(char *pszExpression)
 /*      tests here are minimal to be able to parse simple expression    */
 /*      like A AND B, A OR B, NOT A.                                    */
 /* -------------------------------------------------------------------- */
-    pszAnd = strstr(pszExpression, " AND ");
-    if (!pszAnd)
-       pszAnd = strstr(pszExpression, " and ");
-
-    pszOr = strstr(pszExpression, " OR ");
-    if (!pszOr)
-      pszOr = strstr(pszExpression, " or ");
-    
-
-    pszNot = strstr(pszExpression, "NOT ");
-    if (!pszNot)
-    {
-        pszNot = strstr(pszExpression, "not ");
-    }
-    
+    pszAnd = strcasestr(pszExpression, " AND ");
+    pszOr = strcasestr(pszExpression, " OR ");
+    pszNot = strcasestr(pszExpression, "NOT ");
 
     if (!pszAnd && !pszOr)
     {
-        pszAnd = strstr(pszExpression, "AND(");
-        if (!pszAnd)
-          pszAnd = strstr(pszExpression, "and(");
-        
-        pszOr = strstr(pszExpression, "OR(");
-        if (!pszOr)
-          pszOr = strstr(pszExpression, "or(");
+        pszAnd = strcasestr(pszExpression, "AND(");
+        pszOr = strcasestr(pszExpression, "OR(");
     }
 
     if (!pszAnd && !pszOr && !pszNot)
@@ -4746,24 +4726,13 @@ int msSLDNumberOfLogicalOperators(char *pszExpression)
 
     if (pszAnd)
     {
-        pszSecondAnd = strstr(pszAnd+3, " AND ");
-        if (!pszSecondAnd)
-           pszSecondAnd = strstr(pszAnd+3, " and ");
-
-        pszSecondOr = strstr(pszAnd+3, " OR ");
-        if (!pszSecondOr)
-          pszSecondOr = strstr(pszAnd+3, " or ");
+        pszSecondAnd = strcasestr(pszAnd+3, " AND ");
+        pszSecondOr = strcasestr(pszAnd+3, " OR ");
     }
     else if (pszOr)
     {
-        pszSecondAnd = strstr(pszOr+2, " AND ");
-        if (!pszSecondAnd)
-          pszSecondAnd = strstr(pszOr+2, " and ");
-
-        pszSecondOr = strstr(pszOr+2, " OR ");
-        if (!pszSecondOr)
-          pszSecondOr = strstr(pszOr+2, " or ");
-
+        pszSecondAnd = strcasestr(pszOr+2, " AND ");
+        pszSecondOr = strcasestr(pszOr+2, " OR ");
     }
 
     if (!pszSecondAnd && !pszSecondOr)
diff --git a/mapogcsld.h b/mapogcsld.h
index af7ad0f..7c42255 100644
--- a/mapogcsld.h
+++ b/mapogcsld.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapogcsld.h 11472 2011-04-06 02:48:18Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC SLD implementation
diff --git a/mapogcsos.c b/mapogcsos.c
index 046127d..7f2d5a6 100644
--- a/mapogcsos.c
+++ b/mapogcsos.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapogcsos.c 11890 2011-07-12 13:06:14Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC SOS implementation
@@ -32,7 +32,7 @@
 #include "mapserver.h"
 
 
-MS_CVSID("$Id: mapogcsos.c 11890 2011-07-12 13:06:14Z assefa $")
+MS_CVSID("$Id$")
 
 #if defined(USE_SOS_SVR) && defined(USE_LIBXML2)
 
diff --git a/mapogl.cpp b/mapogl.cpp
index 1999587..42aeac6 100644
--- a/mapogl.cpp
+++ b/mapogl.cpp
@@ -35,7 +35,7 @@
 #include "mapoglrenderer.h"
 #include "mapoglcontext.h"
 
-MS_CVSID("$Id: mapogl.cpp 11529 2011-04-11 18:57:05Z tbonfort $")
+MS_CVSID("$Id$")
 
 imageObj* createImageObjOgl(OglRenderer* renderer)
 {    
diff --git a/mapoglcontext.cpp b/mapoglcontext.cpp
index b7b6cf8..ec555bd 100644
--- a/mapoglcontext.cpp
+++ b/mapoglcontext.cpp
@@ -33,7 +33,7 @@
 #include "maperror.h"
 #include "mapoglcontext.h"
 
-MS_CVSID("$Id: mapoglcontext.cpp 11512 2011-04-09 08:46:51Z toby $")
+MS_CVSID("$Id$")
 
 #define _T(x) __TEXT(x)
 
diff --git a/mapoglrenderer.cpp b/mapoglrenderer.cpp
index 81b5568..cca2f35 100644
--- a/mapoglrenderer.cpp
+++ b/mapoglrenderer.cpp
@@ -36,7 +36,7 @@
 #include "maperror.h"
 #include "mapoglrenderer.h"
 
-MS_CVSID("$Id: mapoglrenderer.cpp 11512 2011-04-09 08:46:51Z toby $")
+MS_CVSID("$Id$")
 
 using namespace std;
 
diff --git a/mapogr.cpp b/mapogr.cpp
index d0e4630..4a0cf6b 100644
--- a/mapogr.cpp
+++ b/mapogr.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapogr.cpp 11890 2011-07-12 13:06:14Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGR Link
@@ -40,7 +40,7 @@
 #  include "ogr_srs_api.h"
 #endif
 
-MS_CVSID("$Id: mapogr.cpp 11890 2011-07-12 13:06:14Z assefa $")
+MS_CVSID("$Id$")
 
 #if defined(GDAL_VERSION_NUM) && (GDAL_VERSION_NUM < 1400)
 #  define ACQUIRE_OLD_OGR_LOCK   msAcquireLock( TLOCK_OGR )
diff --git a/mapogroutput.c b/mapogroutput.c
index 89fc9b2..0a321fa 100644
--- a/mapogroutput.c
+++ b/mapogroutput.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapogroutput.c 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGR Output (for WFS)
@@ -41,7 +41,7 @@
 #  include "cpl_string.h"
 #endif
 
-MS_CVSID("$Id: mapogroutput.c 11503 2011-04-07 19:56:16Z dmorissette $")
+MS_CVSID("$Id$")
 
 #ifdef USE_OGR
 
diff --git a/maporaclespatial.c b/maporaclespatial.c
index 1de8190..4969df3 100644
--- a/maporaclespatial.c
+++ b/maporaclespatial.c
@@ -39,7 +39,7 @@
 #include "mapserver.h"
 #include <assert.h>
 
-MS_CVSID("$Id: maporaclespatial.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 #ifdef USE_ORACLESPATIAL
 
diff --git a/mapoutput.c b/mapoutput.c
index 757da07..86236c6 100644
--- a/mapoutput.c
+++ b/mapoutput.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapoutput.c 11240 2011-03-18 16:28:37Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Various support code related to the outputFormatObj.
@@ -30,7 +30,7 @@
 #include <assert.h>
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapoutput.c 11240 2011-03-18 16:28:37Z tbonfort $")
+MS_CVSID("$Id$")
 
 static outputFormatObj *msAllocOutputFormat( mapObj *map, const char *name, 
                                              const char *driver );
diff --git a/mapows.c b/mapows.c
index a7b91a4..deee4ec 100644
--- a/mapows.c
+++ b/mapows.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapows.c 11582 2011-04-15 09:55:46Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC Web Services (WMS, WFS) support functions
@@ -35,7 +35,7 @@
 #include <stdarg.h> 
 #include <assert.h>
 
-MS_CVSID("$Id: mapows.c 11582 2011-04-15 09:55:46Z tbonfort $")
+MS_CVSID("$Id$")
 
 /*
 ** msOWSDispatch() is the entry point for any OWS request (WMS, WFS, ...)
diff --git a/mapows.h b/mapows.h
index 05f18ff..cbca665 100644
--- a/mapows.h
+++ b/mapows.h
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * $Id: mapows.h 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC Web Services (WMS, WFS, WCS) support function definitions
diff --git a/mapowscommon.c b/mapowscommon.c
index f4c2ec7..51a0298 100644
--- a/mapowscommon.c
+++ b/mapowscommon.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapowscommon.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC OWS Common Implementation for use by MapServer OGC code
@@ -42,7 +42,7 @@
 #include "mapowscommon.h"
 #include "maplibxml2.h"
 
-MS_CVSID("$Id: mapowscommon.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 
 
@@ -410,7 +410,7 @@ xmlNodePtr msOWSCommonOperationsMetadataDomainType(int version, xmlNsPtr psNsOws
   if (version == OWS_1_0_0) {
     msLibXml2GenerateList(psRootNode, psNsOws, "Value", values, ',');
   }
-  if (version == OWS_1_1_0) {
+  if (version == OWS_1_1_0 || version == OWS_2_0_0) {
     psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "AllowedValues", NULL);
     msLibXml2GenerateList(psNode, psNsOws, "Value", values, ',');
   }
diff --git a/mapowscommon.h b/mapowscommon.h
index 4bf11dc..00e659f 100644
--- a/mapowscommon.h
+++ b/mapowscommon.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapowscommon.h 10713 2010-11-09 14:14:57Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC OWS Common Implementation include file
diff --git a/mapparser.c b/mapparser.c
index 45a73cf..d993309 100644
--- a/mapparser.c
+++ b/mapparser.c
@@ -1,30 +1,39 @@
-/* A Bison parser, made by GNU Bison 2.0.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* A Bison parser, made by GNU Bison 2.4.1.  */
 
-   This program is free software; you can redistribute it and/or modify
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+   
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* Written by Richard Stallman by simplifying the original so called
-   ``semantic'' parser.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+   
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
 
 /* All symbols defined below should begin with yy or YY, to avoid
    infringing on user name space.  This should be done even for local
@@ -36,17 +45,70 @@
 /* Identify Bison output.  */
 #define YYBISON 1
 
+/* Bison version.  */
+#define YYBISON_VERSION "2.4.1"
+
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
 
 /* Pure parsers.  */
 #define YYPURE 1
 
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
 /* Using locations.  */
 #define YYLSP_NEEDED 0
 
 
 
+/* Copy the first part of user declarations.  */
+
+/* Line 189 of yacc.c  */
+#line 5 "mapparser.y"
+
+/* C declarations */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <time.h>
+
+#include "mapserver.h" /* for TRUE/FALSE and REGEX includes */
+#include "maptime.h" /* for time comparison routines */
+#include "mapprimitive.h" /* for shapeObj */
+
+#include "mapparser.h" /* for YYSTYPE in the function prototype for yylex() */
+
+int yylex(YYSTYPE *, parseObj *); /* prototype functions, defined after the grammar */
+int yyerror(parseObj *, const char *);
+
+
+/* Line 189 of yacc.c  */
+#line 92 "mapparser.c"
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
@@ -88,6 +150,7 @@
      NEG = 290
    };
 #endif
+/* Tokens.  */
 #define NUMBER 258
 #define STRING 259
 #define TIME 260
@@ -125,71 +188,121 @@
 
 
 
-/* Copy the first part of user declarations.  */
-#line 5 "mapparser.y"
-
-/* C declarations */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <time.h>
-
-#include "mapserver.h" /* for TRUE/FALSE and REGEX includes */
-#include "maptime.h" /* for time comparison routines */
-#include "mapprimitive.h" /* for shapeObj */
-
-#include "mapparser.h" /* for YYSTYPE in the function prototype for yylex() */
-
-int yylex(YYSTYPE *, parseObj *); /* prototype functions, defined after the grammar */
-int yyerror(parseObj *, const char *);
-
-
-/* Enabling traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+{
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+/* Line 214 of yacc.c  */
 #line 30 "mapparser.y"
-typedef union YYSTYPE {
+
   double dblval;
   int intval;  
   char *strval;  
   struct tm tmval;
   shapeObj *shpval;
+
+
+
+/* Line 214 of yacc.c  */
+#line 208 "mapparser.c"
 } YYSTYPE;
-/* Line 185 of yacc.c.  */
-#line 172 "mapparser.c"
+# define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 
-
 /* Copy the second part of user declarations.  */
 
 
-/* Line 213 of yacc.c.  */
-#line 184 "mapparser.c"
+/* Line 264 of yacc.c  */
+#line 220 "mapparser.c"
+
+#ifdef short
+# undef short
+#endif
 
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
 
-# ifndef YYFREE
-#  define YYFREE free
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
 # endif
-# ifndef YYMALLOC
-#  define YYMALLOC malloc
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
 # endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions.  */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int yyi)
+#else
+static int
+YYID (yyi)
+    int yyi;
+#endif
+{
+  return yyi;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
 
@@ -197,36 +310,78 @@ typedef union YYSTYPE {
 #  if YYSTACK_USE_ALLOCA
 #   ifdef __GNUC__
 #    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
+#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     endif
+#    endif
 #   endif
 #  endif
 # endif
 
 # ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning. */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-#  if defined (__STDC__) || defined (__cplusplus)
-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   define YYSIZE_T size_t
+   /* Pacify GCC's `empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+    /* The OS might guarantee only one guard page at the bottom of the stack,
+       and a page size can be as small as 4096 bytes.  So we cannot safely
+       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
+       to allow for a few compiler-allocated temporary stack slots.  */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 #  endif
+# else
 #  define YYSTACK_ALLOC YYMALLOC
 #  define YYSTACK_FREE YYFREE
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+#  endif
+#  if (defined __cplusplus && ! defined _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+#  ifndef YYFREE
+#   define YYFREE free
+#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
 # endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 
 
-#if (! defined (yyoverflow) \
-     && (! defined (__cplusplus) \
-	 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  short int yyss;
-  YYSTYPE yyvs;
-  };
+  yytype_int16 yyss_alloc;
+  YYSTYPE yyvs_alloc;
+};
 
 /* The size of the maximum gap between one aligned stack and the next.  */
 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -234,24 +389,24 @@ union yyalloc
 /* The size of an array large to enough to hold all stacks, each with
    N elements.  */
 # define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (short int) + sizeof (YYSTYPE))			\
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
       + YYSTACK_GAP_MAXIMUM)
 
 /* Copy COUNT objects from FROM to TO.  The source and destination do
    not overlap.  */
 # ifndef YYCOPY
-#  if defined (__GNUC__) && 1 < __GNUC__
+#  if defined __GNUC__ && 1 < __GNUC__
 #   define YYCOPY(To, From, Count) \
       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 #  else
 #   define YYCOPY(To, From, Count)		\
       do					\
 	{					\
-	  register YYSIZE_T yyi;		\
+	  YYSIZE_T yyi;				\
 	  for (yyi = 0; yyi < (Count); yyi++)	\
 	    (To)[yyi] = (From)[yyi];		\
 	}					\
-      while (0)
+      while (YYID (0))
 #  endif
 # endif
 
@@ -260,48 +415,42 @@ union yyalloc
    elements in the stack, and YYPTR gives the new location of the
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack)					\
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
     do									\
       {									\
 	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack, Stack, yysize);				\
-	Stack = &yyptr->Stack;						\
+	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
+	Stack = &yyptr->Stack_alloc;					\
 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 	yyptr += yynewbytes / sizeof (*yyptr);				\
       }									\
-    while (0)
+    while (YYID (0))
 
 #endif
 
-#if defined (__STDC__) || defined (__cplusplus)
-   typedef signed char yysigned_char;
-#else
-   typedef short int yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  37
 /* YYLAST -- Last index in YYTABLE.  */
 #define YYLAST   334
 
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  45
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  7
-/* YYNRULES -- Number of rules. */
+/* YYNRULES -- Number of rules.  */
 #define YYNRULES  74
-/* YYNRULES -- Number of states. */
+/* YYNRULES -- Number of states.  */
 #define YYNSTATES  164
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
 #define YYMAXUTOK   290
 
-#define YYTRANSLATE(YYX) 						\
+#define YYTRANSLATE(YYX)						\
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const unsigned char yytranslate[] =
+static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -338,7 +487,7 @@ static const unsigned char yytranslate[] =
 #if YYDEBUG
 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
    YYRHS.  */
-static const unsigned short int yyprhs[] =
+static const yytype_uint16 yyprhs[] =
 {
        0,     0,     3,     4,     6,     8,    10,    12,    16,    20,
       24,    28,    32,    36,    40,    44,    47,    50,    54,    58,
@@ -350,8 +499,8 @@ static const unsigned short int yyprhs[] =
      263,   267,   274,   279,   281
 };
 
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
 {
       46,     0,    -1,    -1,    47,    -1,    48,    -1,    50,    -1,
       49,    -1,    47,     7,    47,    -1,    47,     8,    47,    -1,
@@ -385,7 +534,7 @@ static const yysigned_char yyrhs[] =
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const unsigned short int yyrline[] =
+static const yytype_uint16 yyrline[] =
 {
        0,    65,    65,    66,    79,    93,   106,   117,   125,   134,
      142,   151,   159,   168,   176,   185,   186,   187,   200,   213,
@@ -398,9 +547,9 @@ static const unsigned short int yyrline[] =
 };
 #endif
 
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "NUMBER", "STRING", "TIME", "SHAPE",
@@ -416,7 +565,7 @@ static const char *const yytname[] =
 # ifdef YYPRINT
 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
    token YYLEX-NUM.  */
-static const unsigned short int yytoknum[] =
+static const yytype_uint16 yytoknum[] =
 {
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
@@ -427,7 +576,7 @@ static const unsigned short int yytoknum[] =
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const unsigned char yyr1[] =
+static const yytype_uint8 yyr1[] =
 {
        0,    45,    46,    46,    46,    46,    46,    47,    47,    47,
       47,    47,    47,    47,    47,    47,    47,    47,    47,    47,
@@ -440,7 +589,7 @@ static const unsigned char yyr1[] =
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const unsigned char yyr2[] =
+static const yytype_uint8 yyr2[] =
 {
        0,     2,     0,     1,     1,     1,     1,     3,     3,     3,
        3,     3,     3,     3,     3,     2,     2,     3,     3,     3,
@@ -455,7 +604,7 @@ static const unsigned char yyr2[] =
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
-static const unsigned char yydefact[] =
+static const yytype_uint8 yydefact[] =
 {
        2,    53,    68,    73,    65,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     3,     4,     6,     5,     0,
@@ -476,8 +625,8 @@ static const unsigned char yydefact[] =
        0,    64,    71,    67
 };
 
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
 {
       -1,    14,    15,    16,    22,    23,    19
 };
@@ -485,7 +634,7 @@ static const yysigned_char yydefgoto[] =
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
 #define YYPACT_NINF -40
-static const short int yypact[] =
+static const yytype_int16 yypact[] =
 {
      101,   -40,   -40,   -40,   -40,   101,   -39,   -21,   -14,   -10,
       -4,     2,    -2,   101,    22,    10,   183,    91,   256,   309,
@@ -507,7 +656,7 @@ static const short int yypact[] =
 };
 
 /* YYPGOTO[NTERM-NUM].  */
-static const short int yypgoto[] =
+static const yytype_int16 yypgoto[] =
 {
      -40,   -40,   148,     7,    64,     0,     1
 };
@@ -517,7 +666,7 @@ static const short int yypgoto[] =
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -1
-static const unsigned char yytable[] =
+static const yytype_uint8 yytable[] =
 {
       18,     1,     3,    24,    77,     4,    78,    79,    80,    81,
       82,    83,    21,    35,    36,    76,    76,    38,    39,    31,
@@ -555,7 +704,7 @@ static const unsigned char yytable[] =
       52,    53,    54,     0,    55
 };
 
-static const short int yycheck[] =
+static const yytype_int16 yycheck[] =
 {
        0,     3,     5,    42,    11,     6,    13,    14,    15,    16,
       17,    18,     5,    13,    13,    35,    35,     7,     8,    12,
@@ -595,7 +744,7 @@ static const short int yycheck[] =
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
-static const unsigned char yystos[] =
+static const yytype_uint8 yystos[] =
 {
        0,     3,     4,     5,     6,     9,    29,    30,    31,    32,
       33,    34,    36,    42,    46,    47,    48,    49,    50,    51,
@@ -616,22 +765,6 @@ static const unsigned char yystos[] =
       48,    43,    43,    43
 };
 
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
 #define yyerrok		(yyerrstatus = 0)
 #define yyclearin	(yychar = YYEMPTY)
 #define YYEMPTY		(-2)
@@ -657,15 +790,15 @@ do								\
       yychar = (Token);						\
       yylval = (Value);						\
       yytoken = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
+      YYPOPSTACK (1);						\
       goto yybackup;						\
     }								\
   else								\
-    { 								\
-      yyerror (p, "syntax error: cannot back up");\
+    {								\
+      yyerror (p, YY_("syntax error: cannot back up")); \
       YYERROR;							\
     }								\
-while (0)
+while (YYID (0))
 
 
 #define YYTERROR	1
@@ -680,7 +813,7 @@ while (0)
 #ifndef YYLLOC_DEFAULT
 # define YYLLOC_DEFAULT(Current, Rhs, N)				\
     do									\
-      if (N)								\
+      if (YYID (N))                                                    \
 	{								\
 	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
 	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
@@ -694,7 +827,7 @@ while (0)
 	  (Current).first_column = (Current).last_column =		\
 	    YYRHSLOC (Rhs, 0).last_column;				\
 	}								\
-    while (0)
+    while (YYID (0))
 #endif
 
 
@@ -706,8 +839,8 @@ while (0)
 # if YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)			\
      fprintf (File, "%d.%d-%d.%d",			\
-              (Loc).first_line, (Loc).first_column,	\
-              (Loc).last_line,  (Loc).last_column)
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
 # else
 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 # endif
@@ -734,37 +867,103 @@ while (0)
 do {						\
   if (yydebug)					\
     YYFPRINTF Args;				\
-} while (0)
+} while (YYID (0))
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
+do {									  \
+  if (yydebug)								  \
+    {									  \
+      YYFPRINTF (stderr, "%s ", Title);					  \
+      yy_symbol_print (stderr,						  \
+		  Type, Value, p); \
+      YYFPRINTF (stderr, "\n");						  \
+    }									  \
+} while (YYID (0))
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parseObj *p)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep, p)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+    parseObj *p;
+#endif
+{
+  if (!yyvaluep)
+    return;
+  YYUSE (p);
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+  YYUSE (yyoutput);
+# endif
+  switch (yytype)
+    {
+      default:
+	break;
+    }
+}
 
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)		\
-do {								\
-  if (yydebug)							\
-    {								\
-      YYFPRINTF (stderr, "%s ", Title);				\
-      yysymprint (stderr, 					\
-                  Type, Value);	\
-      YYFPRINTF (stderr, "\n");					\
-    }								\
-} while (0)
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parseObj *p)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep, p)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+    parseObj *p;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep, p);
+  YYFPRINTF (yyoutput, ")");
+}
 
 /*------------------------------------------------------------------.
 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
 | TOP (included).                                                   |
 `------------------------------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_stack_print (short int *bottom, short int *top)
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 #else
 static void
-yy_stack_print (bottom, top)
-    short int *bottom;
-    short int *top;
+yy_stack_print (yybottom, yytop)
+    yytype_int16 *yybottom;
+    yytype_int16 *yytop;
 #endif
 {
   YYFPRINTF (stderr, "Stack now");
-  for (/* Nothing. */; bottom <= top; ++bottom)
-    YYFPRINTF (stderr, " %d", *bottom);
+  for (; yybottom <= yytop; yybottom++)
+    {
+      int yybot = *yybottom;
+      YYFPRINTF (stderr, " %d", yybot);
+    }
   YYFPRINTF (stderr, "\n");
 }
 
@@ -772,37 +971,46 @@ yy_stack_print (bottom, top)
 do {								\
   if (yydebug)							\
     yy_stack_print ((Bottom), (Top));				\
-} while (0)
+} while (YYID (0))
 
 
 /*------------------------------------------------.
 | Report that the YYRULE is going to be reduced.  |
 `------------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_reduce_print (int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule, parseObj *p)
 #else
 static void
-yy_reduce_print (yyrule)
+yy_reduce_print (yyvsp, yyrule, p)
+    YYSTYPE *yyvsp;
     int yyrule;
+    parseObj *p;
 #endif
 {
+  int yynrhs = yyr2[yyrule];
   int yyi;
-  unsigned int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
-             yyrule - 1, yylno);
-  /* Print the symbols being reduced, and their result.  */
-  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
-    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
-  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+  unsigned long int yylno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+	     yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+		       &(yyvsp[(yyi + 1) - (yynrhs)])
+		       		       , p);
+      YYFPRINTF (stderr, "\n");
+    }
 }
 
 # define YY_REDUCE_PRINT(Rule)		\
 do {					\
   if (yydebug)				\
-    yy_reduce_print (Rule);		\
-} while (0)
+    yy_reduce_print (yyvsp, Rule, p); \
+} while (YYID (0))
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
@@ -824,7 +1032,7 @@ int yydebug;
    if the built-in stack extension method is used).
 
    Do not make this value too large; the results are undefined if
-   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
    evaluated with infinite-precision integer arithmetic.  */
 
 #ifndef YYMAXDEPTH
@@ -836,45 +1044,47 @@ int yydebug;
 #if YYERROR_VERBOSE
 
 # ifndef yystrlen
-#  if defined (__GLIBC__) && defined (_STRING_H)
+#  if defined __GLIBC__ && defined _STRING_H
 #   define yystrlen strlen
 #  else
 /* Return the length of YYSTR.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static YYSIZE_T
-#   if defined (__STDC__) || defined (__cplusplus)
 yystrlen (const char *yystr)
-#   else
+#else
+static YYSIZE_T
 yystrlen (yystr)
-     const char *yystr;
-#   endif
+    const char *yystr;
+#endif
 {
-  register const char *yys = yystr;
-
-  while (*yys++ != '\0')
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
     continue;
-
-  return yys - yystr - 1;
+  return yylen;
 }
 #  endif
 # endif
 
 # ifndef yystpcpy
-#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 #   define yystpcpy stpcpy
 #  else
 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    YYDEST.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static char *
-#   if defined (__STDC__) || defined (__cplusplus)
 yystpcpy (char *yydest, const char *yysrc)
-#   else
+#else
+static char *
 yystpcpy (yydest, yysrc)
-     char *yydest;
-     const char *yysrc;
-#   endif
+    char *yydest;
+    const char *yysrc;
+#endif
 {
-  register char *yyd = yydest;
-  register const char *yys = yysrc;
+  char *yyd = yydest;
+  const char *yys = yysrc;
 
   while ((*yyd++ = *yys++) != '\0')
     continue;
@@ -884,65 +1094,184 @@ yystpcpy (yydest, yysrc)
 #  endif
 # endif
 
-#endif /* !YYERROR_VERBOSE */
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+   quotes and backslashes, so that it's suitable for yyerror.  The
+   heuristic is that double-quoting is unnecessary unless the string
+   contains an apostrophe, a comma, or backslash (other than
+   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
+   null, do not copy; instead, return the length of what the result
+   would have been.  */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+  if (*yystr == '"')
+    {
+      YYSIZE_T yyn = 0;
+      char const *yyp = yystr;
+
+      for (;;)
+	switch (*++yyp)
+	  {
+	  case '\'':
+	  case ',':
+	    goto do_not_strip_quotes;
+
+	  case '\\':
+	    if (*++yyp != '\\')
+	      goto do_not_strip_quotes;
+	    /* Fall through.  */
+	  default:
+	    if (yyres)
+	      yyres[yyn] = *yyp;
+	    yyn++;
+	    break;
+
+	  case '"':
+	    if (yyres)
+	      yyres[yyn] = '\0';
+	    return yyn;
+	  }
+    do_not_strip_quotes: ;
+    }
 
-
+  if (! yyres)
+    return yystrlen (yystr);
 
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
+  return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
 
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
+/* Copy into YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
 {
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
+  int yyn = yypact[yystate];
 
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
   else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
-  switch (yytype)
     {
-      default:
-        break;
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      int yyxbegin = yyn < 0 ? -yyn : 0;
+
+      /* Stay within bounds of both yycheck and yytname.  */
+      int yychecklim = YYLAST - yyn + 1;
+      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+      int yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* Avoid sprintf, as that infringes on the user's name space.
+	     Don't have undefined behavior even if the translation
+	     produced a string with the wrong number of "%s"s.  */
+	  char *yyp = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
     }
-  YYFPRINTF (yyoutput, ")");
 }
+#endif /* YYERROR_VERBOSE */
+
 
-#endif /* ! YYDEBUG */
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parseObj *p)
 #else
 static void
-yydestruct (yymsg, yytype, yyvaluep)
+yydestruct (yymsg, yytype, yyvaluep, p)
     const char *yymsg;
     int yytype;
     YYSTYPE *yyvaluep;
+    parseObj *p;
 #endif
 {
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
+  YYUSE (yyvaluep);
+  YYUSE (p);
 
   if (!yymsg)
     yymsg = "Deleting";
@@ -952,21 +1281,19 @@ yydestruct (yymsg, yytype, yyvaluep)
     {
 
       default:
-        break;
+	break;
     }
 }
-
 
 /* Prevent warnings from -Wmissing-prototypes.  */
-
 #ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
 int yyparse (void *YYPARSE_PARAM);
-# else
+#else
 int yyparse ();
-# endif
+#endif
 #else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
 int yyparse (parseObj *p);
 #else
 int yyparse ();
@@ -977,20 +1304,23 @@ int yyparse ();
 
 
 
-
-/*----------.
-| yyparse.  |
-`----------*/
+/*-------------------------.
+| yyparse or yypush_parse.  |
+`-------------------------*/
 
 #ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
-  void *YYPARSE_PARAM;
-# endif
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+    void *YYPARSE_PARAM;
+#endif
 #else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 int
 yyparse (parseObj *p)
 #else
@@ -1000,74 +1330,78 @@ yyparse (p)
 #endif
 #endif
 {
-  /* The look-ahead symbol.  */
+/* The lookahead symbol.  */
 int yychar;
 
-/* The semantic value of the look-ahead symbol.  */
+/* The semantic value of the lookahead symbol.  */
 YYSTYPE yylval;
 
-/* Number of syntax errors so far.  */
-int yynerrs;
-
-  register int yystate;
-  register int yyn;
-  int yyresult;
-  /* Number of tokens to shift before error messages enabled.  */
-  int yyerrstatus;
-  /* Look-ahead token as an internal (translated) token number.  */
-  int yytoken = 0;
-
-  /* Three stacks and their tools:
-     `yyss': related to states,
-     `yyvs': related to semantic values,
-     `yyls': related to locations.
+    /* Number of syntax errors so far.  */
+    int yynerrs;
 
-     Refer to the stacks thru separate pointers, to allow yyoverflow
-     to reallocate them elsewhere.  */
+    int yystate;
+    /* Number of tokens to shift before error messages enabled.  */
+    int yyerrstatus;
 
-  /* The state stack.  */
-  short int yyssa[YYINITDEPTH];
-  short int *yyss = yyssa;
-  register short int *yyssp;
+    /* The stacks and their tools:
+       `yyss': related to states.
+       `yyvs': related to semantic values.
 
-  /* The semantic value stack.  */
-  YYSTYPE yyvsa[YYINITDEPTH];
-  YYSTYPE *yyvs = yyvsa;
-  register YYSTYPE *yyvsp;
+       Refer to the stacks thru separate pointers, to allow yyoverflow
+       to reallocate them elsewhere.  */
 
+    /* The state stack.  */
+    yytype_int16 yyssa[YYINITDEPTH];
+    yytype_int16 *yyss;
+    yytype_int16 *yyssp;
 
+    /* The semantic value stack.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs;
+    YYSTYPE *yyvsp;
 
-#define YYPOPSTACK   (yyvsp--, yyssp--)
-
-  YYSIZE_T yystacksize = YYINITDEPTH;
+    YYSIZE_T yystacksize;
 
+  int yyn;
+  int yyresult;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken;
   /* The variables used to return semantic value and location from the
      action routines.  */
   YYSTYPE yyval;
 
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
 
-  /* When reducing, the number of symbols on the RHS of the reduced
-     rule.  */
-  int yylen;
+  yytoken = 0;
+  yyss = yyssa;
+  yyvs = yyvsa;
+  yystacksize = YYINITDEPTH;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
 
   yystate = 0;
   yyerrstatus = 0;
   yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
+  yychar = YYEMPTY; /* Cause a token to be read.  */
 
   /* Initialize stack pointers.
      Waste one element of value and location stack
      so that they stay on the same level as the state stack.
      The wasted elements are never initialized.  */
-
   yyssp = yyss;
   yyvsp = yyvs;
 
-
-  yyvsp[0] = yylval;
-
   goto yysetstate;
 
 /*------------------------------------------------------------.
@@ -1075,8 +1409,7 @@ int yynerrs;
 `------------------------------------------------------------*/
  yynewstate:
   /* In all cases, when you get here, the value and location stacks
-     have just been pushed. so pushing a state here evens the stacks.
-     */
+     have just been pushed.  So pushing a state here evens the stacks.  */
   yyssp++;
 
  yysetstate:
@@ -1089,21 +1422,19 @@ int yynerrs;
 
 #ifdef yyoverflow
       {
-	/* Give user a chance to reallocate the stack. Use copies of
+	/* Give user a chance to reallocate the stack.  Use copies of
 	   these so that the &'s don't force the real ones into
 	   memory.  */
 	YYSTYPE *yyvs1 = yyvs;
-	short int *yyss1 = yyss;
-
+	yytype_int16 *yyss1 = yyss;
 
 	/* Each stack pointer address is followed by the size of the
 	   data in use in that stack, in bytes.  This used to be a
 	   conditional around just the two extra args, but that might
 	   be undefined if yyoverflow is a macro.  */
-	yyoverflow ("parser stack overflow",
+	yyoverflow (YY_("memory exhausted"),
 		    &yyss1, yysize * sizeof (*yyssp),
 		    &yyvs1, yysize * sizeof (*yyvsp),
-
 		    &yystacksize);
 
 	yyss = yyss1;
@@ -1111,24 +1442,23 @@ int yynerrs;
       }
 #else /* no yyoverflow */
 # ifndef YYSTACK_RELOCATE
-      goto yyoverflowlab;
+      goto yyexhaustedlab;
 # else
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-	goto yyoverflowlab;
+	goto yyexhaustedlab;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
 	yystacksize = YYMAXDEPTH;
 
       {
-	short int *yyss1 = yyss;
+	yytype_int16 *yyss1 = yyss;
 	union yyalloc *yyptr =
 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 	if (! yyptr)
-	  goto yyoverflowlab;
-	YYSTACK_RELOCATE (yyss);
-	YYSTACK_RELOCATE (yyvs);
-
+	  goto yyexhaustedlab;
+	YYSTACK_RELOCATE (yyss_alloc, yyss);
+	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 #  undef YYSTACK_RELOCATE
 	if (yyss1 != yyssa)
 	  YYSTACK_FREE (yyss1);
@@ -1139,7 +1469,6 @@ int yynerrs;
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
 
-
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 		  (unsigned long int) yystacksize));
 
@@ -1149,6 +1478,9 @@ int yynerrs;
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
+  if (yystate == YYFINAL)
+    YYACCEPT;
+
   goto yybackup;
 
 /*-----------.
@@ -1156,19 +1488,17 @@ int yynerrs;
 `-----------*/
 yybackup:
 
-/* Do appropriate processing given the current state.  */
-/* Read a look-ahead token if we need one and don't already have one.  */
-/* yyresume: */
-
-  /* First try to decide what to do without reference to look-ahead token.  */
+  /* Do appropriate processing given the current state.  Read a
+     lookahead token if we need one and don't already have one.  */
 
+  /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
   if (yyn == YYPACT_NINF)
     goto yydefault;
 
-  /* Not known => get a look-ahead token if don't already have one.  */
+  /* Not known => get a lookahead token if don't already have one.  */
 
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
@@ -1200,25 +1530,20 @@ yybackup:
       goto yyreduce;
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Shift the look-ahead token.  */
-  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
-  /* Discard the token being shifted unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  *++yyvsp = yylval;
-
-
   /* Count tokens shifted since error; after three, turn off error
      status.  */
   if (yyerrstatus)
     yyerrstatus--;
 
+  /* Shift the lookahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token.  */
+  yychar = YYEMPTY;
+
   yystate = yyn;
+  *++yyvsp = yylval;
+
   goto yynewstate;
 
 
@@ -1254,14 +1579,16 @@ yyreduce:
   switch (yyn)
     {
         case 3:
+
+/* Line 1455 of yacc.c  */
 #line 66 "mapparser.y"
     {
       switch(p->type) {
       case(MS_PARSE_TYPE_BOOLEAN):
-        p->result.intval = (yyvsp[0].intval); 
+        p->result.intval = (yyvsp[(1) - (1)].intval); 
         break;
       case(MS_PARSE_TYPE_STRING):
-        if((yyvsp[0].intval)) 
+        if((yyvsp[(1) - (1)].intval)) 
           p->result.strval = strdup("true");
         else
           p->result.strval = strdup("false");
@@ -1271,46 +1598,52 @@ yyreduce:
     break;
 
   case 4:
+
+/* Line 1455 of yacc.c  */
 #line 79 "mapparser.y"
     {
       switch(p->type) {
       case(MS_PARSE_TYPE_BOOLEAN):
-        if((yyvsp[0].dblval) != 0)
+        if((yyvsp[(1) - (1)].dblval) != 0)
           p->result.intval = MS_TRUE;
         else
           p->result.intval = MS_FALSE;			    
         break;
       case(MS_PARSE_TYPE_STRING):
         p->result.strval = (char *)malloc(64); /* large enough for a double */
-        snprintf(p->result.strval, 64, "%g", (yyvsp[0].dblval));
+        snprintf(p->result.strval, 64, "%g", (yyvsp[(1) - (1)].dblval));
         break;
       }
     }
     break;
 
   case 5:
+
+/* Line 1455 of yacc.c  */
 #line 93 "mapparser.y"
     {
       switch(p->type) {
       case(MS_PARSE_TYPE_BOOLEAN):
-        if((yyvsp[0].strval)) /* string is not NULL */
+        if((yyvsp[(1) - (1)].strval)) /* string is not NULL */
           p->result.intval = MS_TRUE;
         else
           p->result.intval = MS_FALSE;
         break;
       case(MS_PARSE_TYPE_STRING):
-        p->result.strval = (yyvsp[0].strval); // strdup($1);
+        p->result.strval = (yyvsp[(1) - (1)].strval); // strdup($1);
         break;
       }
     }
     break;
 
   case 6:
+
+/* Line 1455 of yacc.c  */
 #line 106 "mapparser.y"
     {
     switch(p->type) {
     case(MS_PARSE_TYPE_SHAPE):
-      p->result.shpval = (yyvsp[0].shpval);
+      p->result.shpval = (yyvsp[(1) - (1)].shpval);
       p->result.shpval->scratch = MS_FALSE;
       break;
     }
@@ -1318,11 +1651,13 @@ yyreduce:
     break;
 
   case 7:
+
+/* Line 1455 of yacc.c  */
 #line 117 "mapparser.y"
     {
-	                                 if((yyvsp[-2].intval) == MS_TRUE)
+	                                 if((yyvsp[(1) - (3)].intval) == MS_TRUE)
 		                           (yyval.intval) = MS_TRUE;
-		                         else if((yyvsp[0].intval) == MS_TRUE)
+		                         else if((yyvsp[(3) - (3)].intval) == MS_TRUE)
 			                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1330,10 +1665,12 @@ yyreduce:
     break;
 
   case 8:
+
+/* Line 1455 of yacc.c  */
 #line 125 "mapparser.y"
     {
-	                                 if((yyvsp[-2].intval) == MS_TRUE) {
-			                   if((yyvsp[0].intval) == MS_TRUE)
+	                                 if((yyvsp[(1) - (3)].intval) == MS_TRUE) {
+			                   if((yyvsp[(3) - (3)].intval) == MS_TRUE)
 			                     (yyval.intval) = MS_TRUE;
 			                   else
 			                     (yyval.intval) = MS_FALSE;
@@ -1343,11 +1680,13 @@ yyreduce:
     break;
 
   case 9:
+
+/* Line 1455 of yacc.c  */
 #line 134 "mapparser.y"
     {
-	                                 if((yyvsp[-2].intval) == MS_TRUE)
+	                                 if((yyvsp[(1) - (3)].intval) == MS_TRUE)
 		                           (yyval.intval) = MS_TRUE;
-		                         else if((yyvsp[0].dblval) != 0)
+		                         else if((yyvsp[(3) - (3)].dblval) != 0)
 			                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1355,10 +1694,12 @@ yyreduce:
     break;
 
   case 10:
+
+/* Line 1455 of yacc.c  */
 #line 142 "mapparser.y"
     {
-	                                 if((yyvsp[-2].intval) == MS_TRUE) {
-			                   if((yyvsp[0].dblval) != 0)
+	                                 if((yyvsp[(1) - (3)].intval) == MS_TRUE) {
+			                   if((yyvsp[(3) - (3)].dblval) != 0)
 			                     (yyval.intval) = MS_TRUE;
 			                   else
 			                     (yyval.intval) = MS_FALSE;
@@ -1368,11 +1709,13 @@ yyreduce:
     break;
 
   case 11:
+
+/* Line 1455 of yacc.c  */
 #line 151 "mapparser.y"
     {
-	                                 if((yyvsp[-2].dblval) != 0)
+	                                 if((yyvsp[(1) - (3)].dblval) != 0)
 		                           (yyval.intval) = MS_TRUE;
-		                         else if((yyvsp[0].intval) == MS_TRUE)
+		                         else if((yyvsp[(3) - (3)].intval) == MS_TRUE)
 			                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1380,10 +1723,12 @@ yyreduce:
     break;
 
   case 12:
+
+/* Line 1455 of yacc.c  */
 #line 159 "mapparser.y"
     {
-	                                 if((yyvsp[-2].dblval) != 0) {
-			                   if((yyvsp[0].intval) == MS_TRUE)
+	                                 if((yyvsp[(1) - (3)].dblval) != 0) {
+			                   if((yyvsp[(3) - (3)].intval) == MS_TRUE)
 			                     (yyval.intval) = MS_TRUE;
 			                   else
 			                     (yyval.intval) = MS_FALSE;
@@ -1393,11 +1738,13 @@ yyreduce:
     break;
 
   case 13:
+
+/* Line 1455 of yacc.c  */
 #line 168 "mapparser.y"
     {
-	                                 if((yyvsp[-2].dblval) != 0)
+	                                 if((yyvsp[(1) - (3)].dblval) != 0)
 		                           (yyval.intval) = MS_TRUE;
-		                         else if((yyvsp[0].dblval) != 0)
+		                         else if((yyvsp[(3) - (3)].dblval) != 0)
 			                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1405,10 +1752,12 @@ yyreduce:
     break;
 
   case 14:
+
+/* Line 1455 of yacc.c  */
 #line 176 "mapparser.y"
     {
-	                                 if((yyvsp[-2].dblval) != 0) {
-			                   if((yyvsp[0].dblval) != 0)
+	                                 if((yyvsp[(1) - (3)].dblval) != 0) {
+			                   if((yyvsp[(3) - (3)].dblval) != 0)
 			                     (yyval.intval) = MS_TRUE;
 			                   else
 			                     (yyval.intval) = MS_FALSE;
@@ -1418,24 +1767,30 @@ yyreduce:
     break;
 
   case 15:
+
+/* Line 1455 of yacc.c  */
 #line 185 "mapparser.y"
-    { (yyval.intval) = !(yyvsp[0].intval); }
+    { (yyval.intval) = !(yyvsp[(2) - (2)].intval); }
     break;
 
   case 16:
+
+/* Line 1455 of yacc.c  */
 #line 186 "mapparser.y"
-    { (yyval.intval) = !(yyvsp[0].dblval); }
+    { (yyval.intval) = !(yyvsp[(2) - (2)].dblval); }
     break;
 
   case 17:
+
+/* Line 1455 of yacc.c  */
 #line 187 "mapparser.y"
     {
                                          ms_regex_t re;
 
-                                         if(ms_regcomp(&re, (yyvsp[0].strval), MS_REG_EXTENDED|MS_REG_NOSUB) != 0) 
+                                         if(ms_regcomp(&re, (yyvsp[(3) - (3)].strval), MS_REG_EXTENDED|MS_REG_NOSUB) != 0) 
                                            (yyval.intval) = MS_FALSE;
 
-                                         if(ms_regexec(&re, (yyvsp[-2].strval), 0, NULL, 0) == 0)
+                                         if(ms_regexec(&re, (yyvsp[(1) - (3)].strval), 0, NULL, 0) == 0)
                                   	   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1445,14 +1800,16 @@ yyreduce:
     break;
 
   case 18:
+
+/* Line 1455 of yacc.c  */
 #line 200 "mapparser.y"
     {
                                          ms_regex_t re;
 
-                                         if(ms_regcomp(&re, (yyvsp[0].strval), MS_REG_EXTENDED|MS_REG_NOSUB|MS_REG_ICASE) != 0) 
+                                         if(ms_regcomp(&re, (yyvsp[(3) - (3)].strval), MS_REG_EXTENDED|MS_REG_NOSUB|MS_REG_ICASE) != 0) 
                                            (yyval.intval) = MS_FALSE;
 
-                                         if(ms_regexec(&re, (yyvsp[-2].strval), 0, NULL, 0) == 0)
+                                         if(ms_regexec(&re, (yyvsp[(1) - (3)].strval), 0, NULL, 0) == 0)
                                   	   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1462,9 +1819,11 @@ yyreduce:
     break;
 
   case 19:
+
+/* Line 1455 of yacc.c  */
 #line 213 "mapparser.y"
     {
-	                                 if((yyvsp[-2].dblval) == (yyvsp[0].dblval))
+	                                 if((yyvsp[(1) - (3)].dblval) == (yyvsp[(3) - (3)].dblval))
 	 		                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1472,9 +1831,11 @@ yyreduce:
     break;
 
   case 20:
+
+/* Line 1455 of yacc.c  */
 #line 219 "mapparser.y"
     {
-	                                 if((yyvsp[-2].dblval) != (yyvsp[0].dblval))
+	                                 if((yyvsp[(1) - (3)].dblval) != (yyvsp[(3) - (3)].dblval))
 			                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1482,9 +1843,11 @@ yyreduce:
     break;
 
   case 21:
+
+/* Line 1455 of yacc.c  */
 #line 225 "mapparser.y"
     {	                                 
-	                                 if((yyvsp[-2].dblval) > (yyvsp[0].dblval))
+	                                 if((yyvsp[(1) - (3)].dblval) > (yyvsp[(3) - (3)].dblval))
 			                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1492,9 +1855,11 @@ yyreduce:
     break;
 
   case 22:
+
+/* Line 1455 of yacc.c  */
 #line 231 "mapparser.y"
     {
-	                                 if((yyvsp[-2].dblval) < (yyvsp[0].dblval))
+	                                 if((yyvsp[(1) - (3)].dblval) < (yyvsp[(3) - (3)].dblval))
 			                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1502,9 +1867,11 @@ yyreduce:
     break;
 
   case 23:
+
+/* Line 1455 of yacc.c  */
 #line 237 "mapparser.y"
     {	                                 
-	                                 if((yyvsp[-2].dblval) >= (yyvsp[0].dblval))
+	                                 if((yyvsp[(1) - (3)].dblval) >= (yyvsp[(3) - (3)].dblval))
 			                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1512,9 +1879,11 @@ yyreduce:
     break;
 
   case 24:
+
+/* Line 1455 of yacc.c  */
 #line 243 "mapparser.y"
     {
-	                                 if((yyvsp[-2].dblval) <= (yyvsp[0].dblval))
+	                                 if((yyvsp[(1) - (3)].dblval) <= (yyvsp[(3) - (3)].dblval))
 			                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1522,87 +1891,103 @@ yyreduce:
     break;
 
   case 25:
+
+/* Line 1455 of yacc.c  */
 #line 249 "mapparser.y"
-    { (yyval.intval) = (yyvsp[-1].intval); }
+    { (yyval.intval) = (yyvsp[(2) - (3)].intval); }
     break;
 
   case 26:
+
+/* Line 1455 of yacc.c  */
 #line 250 "mapparser.y"
     {
-                                         if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) == 0)
+                                         if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) == 0)
 					   (yyval.intval) = MS_TRUE;
 					 else
 					   (yyval.intval) = MS_FALSE;
-					 free((yyvsp[-2].strval));
-					 free((yyvsp[0].strval));
+					 free((yyvsp[(1) - (3)].strval));
+					 free((yyvsp[(3) - (3)].strval));
 				       }
     break;
 
   case 27:
+
+/* Line 1455 of yacc.c  */
 #line 258 "mapparser.y"
     {
-                                         if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) != 0)
+                                         if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) != 0)
 					   (yyval.intval) = MS_TRUE;
 					 else
 					   (yyval.intval) = MS_FALSE;
-					 free((yyvsp[-2].strval));
-					 free((yyvsp[0].strval));
+					 free((yyvsp[(1) - (3)].strval));
+					 free((yyvsp[(3) - (3)].strval));
 				       }
     break;
 
   case 28:
+
+/* Line 1455 of yacc.c  */
 #line 266 "mapparser.y"
     {
-                                         if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) > 0)
+                                         if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) > 0)
 					   (yyval.intval) = MS_TRUE;
 					 else
 					   (yyval.intval) = MS_FALSE;
 					 /* printf("Not freeing: %s >= %s\n",$1, $3); */
-					 free((yyvsp[-2].strval));
-					 free((yyvsp[0].strval));
+					 free((yyvsp[(1) - (3)].strval));
+					 free((yyvsp[(3) - (3)].strval));
                                        }
     break;
 
   case 29:
+
+/* Line 1455 of yacc.c  */
 #line 275 "mapparser.y"
     {
-                                         if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) < 0)
+                                         if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) < 0)
 					   (yyval.intval) = MS_TRUE;
 					 else
 					   (yyval.intval) = MS_FALSE;
-					 free((yyvsp[-2].strval));
-					 free((yyvsp[0].strval));
+					 free((yyvsp[(1) - (3)].strval));
+					 free((yyvsp[(3) - (3)].strval));
                                        }
     break;
 
   case 30:
+
+/* Line 1455 of yacc.c  */
 #line 283 "mapparser.y"
     {
-                                         if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) >= 0)
+                                         if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) >= 0)
 					   (yyval.intval) = MS_TRUE;
 					 else
 					   (yyval.intval) = MS_FALSE;
-					 free((yyvsp[-2].strval));
-					 free((yyvsp[0].strval));
+					 free((yyvsp[(1) - (3)].strval));
+					 free((yyvsp[(3) - (3)].strval));
                                        }
     break;
 
   case 31:
+
+/* Line 1455 of yacc.c  */
 #line 291 "mapparser.y"
     {
-                                         if(strcmp((yyvsp[-2].strval), (yyvsp[0].strval)) <= 0)
+                                         if(strcmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) <= 0)
 					   (yyval.intval) = MS_TRUE;
 					 else
 					   (yyval.intval) = MS_FALSE;
-					 free((yyvsp[-2].strval));
-					 free((yyvsp[0].strval));
+					 free((yyvsp[(1) - (3)].strval));
+					 free((yyvsp[(3) - (3)].strval));
                                        }
     break;
 
   case 32:
+
+/* Line 1455 of yacc.c  */
 #line 299 "mapparser.y"
     {
-                                     if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) == 0)
+                                     if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) == 0)
 				       (yyval.intval) = MS_TRUE;
 				     else
 				       (yyval.intval) = MS_FALSE;
@@ -1610,9 +1995,11 @@ yyreduce:
     break;
 
   case 33:
+
+/* Line 1455 of yacc.c  */
 #line 305 "mapparser.y"
     {
-                                     if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) != 0)
+                                     if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) != 0)
 				       (yyval.intval) = MS_TRUE;
 				     else
 				       (yyval.intval) = MS_FALSE;
@@ -1620,9 +2007,11 @@ yyreduce:
     break;
 
   case 34:
+
+/* Line 1455 of yacc.c  */
 #line 311 "mapparser.y"
     {
-                                     if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) > 0)
+                                     if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) > 0)
 				       (yyval.intval) = MS_TRUE;
 				     else
 				       (yyval.intval) = MS_FALSE;
@@ -1630,9 +2019,11 @@ yyreduce:
     break;
 
   case 35:
+
+/* Line 1455 of yacc.c  */
 #line 317 "mapparser.y"
     {
-                                     if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) < 0)
+                                     if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) < 0)
 				       (yyval.intval) = MS_TRUE;
 				     else
 				       (yyval.intval) = MS_FALSE;
@@ -1640,9 +2031,11 @@ yyreduce:
     break;
 
   case 36:
+
+/* Line 1455 of yacc.c  */
 #line 323 "mapparser.y"
     {
-                                     if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) >= 0)
+                                     if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) >= 0)
 				       (yyval.intval) = MS_TRUE;
 				     else
 				       (yyval.intval) = MS_FALSE;
@@ -1650,9 +2043,11 @@ yyreduce:
     break;
 
   case 37:
+
+/* Line 1455 of yacc.c  */
 #line 329 "mapparser.y"
     {
-                                     if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) <= 0)
+                                     if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) <= 0)
 				       (yyval.intval) = MS_TRUE;
 				     else
 				       (yyval.intval) = MS_FALSE;
@@ -1660,16 +2055,18 @@ yyreduce:
     break;
 
   case 38:
+
+/* Line 1455 of yacc.c  */
 #line 335 "mapparser.y"
     {
 					 char *delim,*bufferp;
 
 					 (yyval.intval) = MS_FALSE;
-					 bufferp=(yyvsp[0].strval);
+					 bufferp=(yyvsp[(3) - (3)].strval);
 
 					 while((delim=strchr(bufferp,',')) != NULL) {
 					   *delim='\0';
-					   if(strcmp((yyvsp[-2].strval),bufferp) == 0) {
+					   if(strcmp((yyvsp[(1) - (3)].strval),bufferp) == 0) {
 					     (yyval.intval) = MS_TRUE;
 					     break;
 					   } 
@@ -1677,24 +2074,26 @@ yyreduce:
 					   bufferp=delim+1;
 					 }
 
-					 if(strcmp((yyvsp[-2].strval),bufferp) == 0) // is this test necessary?
+					 if(strcmp((yyvsp[(1) - (3)].strval),bufferp) == 0) // is this test necessary?
 					   (yyval.intval) = MS_TRUE;
-					 free((yyvsp[-2].strval));
-					 free((yyvsp[0].strval));
+					 free((yyvsp[(1) - (3)].strval));
+					 free((yyvsp[(3) - (3)].strval));
 				       }
     break;
 
   case 39:
+
+/* Line 1455 of yacc.c  */
 #line 356 "mapparser.y"
     {
 					 char *delim,*bufferp;
 
 					 (yyval.intval) = MS_FALSE;
-					 bufferp=(yyvsp[0].strval);
+					 bufferp=(yyvsp[(3) - (3)].strval);
 
 					 while((delim=strchr(bufferp,',')) != NULL) {
 					   *delim='\0';
-					   if((yyvsp[-2].dblval) == atof(bufferp)) {
+					   if((yyvsp[(1) - (3)].dblval) == atof(bufferp)) {
 					     (yyval.intval) = MS_TRUE;
 					     break;
 					   } 
@@ -1702,17 +2101,19 @@ yyreduce:
 					   bufferp=delim+1;
 					 }
 
-					 if((yyvsp[-2].dblval) == atof(bufferp)) // is this test necessary?
+					 if((yyvsp[(1) - (3)].dblval) == atof(bufferp)) // is this test necessary?
 					   (yyval.intval) = MS_TRUE;
 					   
-					 free((yyvsp[0].strval));
+					 free((yyvsp[(3) - (3)].strval));
 				       }
     break;
 
   case 40:
+
+/* Line 1455 of yacc.c  */
 #line 377 "mapparser.y"
     {
-	                                 if((yyvsp[-2].dblval) == (yyvsp[0].dblval))
+	                                 if((yyvsp[(1) - (3)].dblval) == (yyvsp[(3) - (3)].dblval))
 	 		                   (yyval.intval) = MS_TRUE;
 			                 else
 			                   (yyval.intval) = MS_FALSE;
@@ -1720,21 +2121,25 @@ yyreduce:
     break;
 
   case 41:
+
+/* Line 1455 of yacc.c  */
 #line 383 "mapparser.y"
     {
-                                         if(strcasecmp((yyvsp[-2].strval), (yyvsp[0].strval)) == 0)
+                                         if(strcasecmp((yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)) == 0)
 					   (yyval.intval) = MS_TRUE;
 					 else
 					   (yyval.intval) = MS_FALSE;
-					 free((yyvsp[-2].strval));
-					 free((yyvsp[0].strval));
+					 free((yyvsp[(1) - (3)].strval));
+					 free((yyvsp[(3) - (3)].strval));
 				       }
     break;
 
   case 42:
+
+/* Line 1455 of yacc.c  */
 #line 391 "mapparser.y"
     {
-                                     if(msTimeCompare(&((yyvsp[-2].tmval)), &((yyvsp[0].tmval))) == 0)
+                                     if(msTimeCompare(&((yyvsp[(1) - (3)].tmval)), &((yyvsp[(3) - (3)].tmval))) == 0)
 				       (yyval.intval) = MS_TRUE;
 				     else
 				       (yyval.intval) = MS_FALSE;
@@ -1742,12 +2147,14 @@ yyreduce:
     break;
 
   case 43:
+
+/* Line 1455 of yacc.c  */
 #line 398 "mapparser.y"
     {
       int rval;
-      rval = msGEOSEquals((yyvsp[-2].shpval), (yyvsp[0].shpval));
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval));
+      rval = msGEOSEquals((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval));
       if(rval == -1) {
         yyerror(p, "Equals (EQ or ==) operator failed.");
         return(-1);
@@ -1757,12 +2164,14 @@ yyreduce:
     break;
 
   case 44:
+
+/* Line 1455 of yacc.c  */
 #line 409 "mapparser.y"
     {
       int rval;
-      rval = msGEOSIntersects((yyvsp[-2].shpval), (yyvsp[0].shpval));      
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval)); 
+      rval = msGEOSIntersects((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));      
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval)); 
       if(rval == -1) {
         yyerror(p, "Intersects operator failed.");
         return(-1);
@@ -1772,12 +2181,14 @@ yyreduce:
     break;
 
   case 45:
+
+/* Line 1455 of yacc.c  */
 #line 420 "mapparser.y"
     {
       int rval;
-      rval = msGEOSDisjoint((yyvsp[-2].shpval), (yyvsp[0].shpval));
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval));
+      rval = msGEOSDisjoint((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval));
       if(rval == -1) {
         yyerror(p, "Disjoint operator failed.");
         return(-1);
@@ -1787,12 +2198,14 @@ yyreduce:
     break;
 
   case 46:
+
+/* Line 1455 of yacc.c  */
 #line 431 "mapparser.y"
     {
       int rval;
-      rval = msGEOSTouches((yyvsp[-2].shpval), (yyvsp[0].shpval));
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval));
+      rval = msGEOSTouches((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval));
       if(rval == -1) {
         yyerror(p, "Touches operator failed.");
         return(-1);
@@ -1802,12 +2215,14 @@ yyreduce:
     break;
 
   case 47:
+
+/* Line 1455 of yacc.c  */
 #line 442 "mapparser.y"
     {
       int rval;
-      rval = msGEOSOverlaps((yyvsp[-2].shpval), (yyvsp[0].shpval));
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval));
+      rval = msGEOSOverlaps((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval));
       if(rval == -1) {
         yyerror(p, "Overlaps operator failed.");
         return(-1);
@@ -1817,12 +2232,14 @@ yyreduce:
     break;
 
   case 48:
+
+/* Line 1455 of yacc.c  */
 #line 453 "mapparser.y"
     {
       int rval;
-      rval = msGEOSCrosses((yyvsp[-2].shpval), (yyvsp[0].shpval));
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval));
+      rval = msGEOSCrosses((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval));
       if(rval == -1) {
         yyerror(p, "Crosses operator failed.");
         return(-1);
@@ -1832,12 +2249,14 @@ yyreduce:
     break;
 
   case 49:
+
+/* Line 1455 of yacc.c  */
 #line 464 "mapparser.y"
     {
       int rval;
-      rval = msGEOSWithin((yyvsp[-2].shpval), (yyvsp[0].shpval));
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval));
+      rval = msGEOSWithin((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval));
       if(rval == -1) {
         yyerror(p, "Within operator failed.");
         return(-1);
@@ -1847,14 +2266,16 @@ yyreduce:
     break;
 
   case 50:
+
+/* Line 1455 of yacc.c  */
 #line 475 "mapparser.y"
     {
       int rval;
-      rval = msGEOSWithin((yyvsp[-2].shpval), (yyvsp[0].shpval));
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval));
+      rval = msGEOSContains((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval));
       if(rval == -1) {
-        yyerror(p, "Within operator failed.");
+        yyerror(p, "Contains operator failed.");
         return(-1);
       } else
         (yyval.intval) = rval;
@@ -1862,12 +2283,14 @@ yyreduce:
     break;
 
   case 51:
+
+/* Line 1455 of yacc.c  */
 #line 486 "mapparser.y"
     {
       double d;
-      d = msGEOSDistance((yyvsp[-2].shpval), (yyvsp[0].shpval));
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval));
+      d = msGEOSDistance((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval));
       if(d == 0.0) 
         (yyval.intval) = MS_TRUE;
       else
@@ -1876,12 +2299,14 @@ yyreduce:
     break;
 
   case 52:
+
+/* Line 1455 of yacc.c  */
 #line 496 "mapparser.y"
     {
       double d;
-      d = msGEOSDistance((yyvsp[-2].shpval), (yyvsp[0].shpval));
-      if((yyvsp[-2].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-2].shpval));
-      if((yyvsp[0].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[0].shpval));
+      d = msGEOSDistance((yyvsp[(1) - (3)].shpval), (yyvsp[(3) - (3)].shpval));
+      if((yyvsp[(1) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(1) - (3)].shpval));
+      if((yyvsp[(3) - (3)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (3)].shpval));
       if(d > 0.0) 
         (yyval.intval) = MS_TRUE;
       else
@@ -1890,83 +2315,109 @@ yyreduce:
     break;
 
   case 54:
+
+/* Line 1455 of yacc.c  */
 #line 509 "mapparser.y"
-    { (yyval.dblval) = (yyvsp[-1].dblval); }
+    { (yyval.dblval) = (yyvsp[(2) - (3)].dblval); }
     break;
 
   case 55:
+
+/* Line 1455 of yacc.c  */
 #line 510 "mapparser.y"
-    { (yyval.dblval) = (yyvsp[-2].dblval) + (yyvsp[0].dblval); }
+    { (yyval.dblval) = (yyvsp[(1) - (3)].dblval) + (yyvsp[(3) - (3)].dblval); }
     break;
 
   case 56:
+
+/* Line 1455 of yacc.c  */
 #line 511 "mapparser.y"
-    { (yyval.dblval) = (yyvsp[-2].dblval) - (yyvsp[0].dblval); }
+    { (yyval.dblval) = (yyvsp[(1) - (3)].dblval) - (yyvsp[(3) - (3)].dblval); }
     break;
 
   case 57:
+
+/* Line 1455 of yacc.c  */
 #line 512 "mapparser.y"
-    { (yyval.dblval) = (yyvsp[-2].dblval) * (yyvsp[0].dblval); }
+    { (yyval.dblval) = (yyvsp[(1) - (3)].dblval) * (yyvsp[(3) - (3)].dblval); }
     break;
 
   case 58:
+
+/* Line 1455 of yacc.c  */
 #line 513 "mapparser.y"
-    { (yyval.dblval) = (int)(yyvsp[-2].dblval) % (int)(yyvsp[0].dblval); }
+    { (yyval.dblval) = (int)(yyvsp[(1) - (3)].dblval) % (int)(yyvsp[(3) - (3)].dblval); }
     break;
 
   case 59:
+
+/* Line 1455 of yacc.c  */
 #line 514 "mapparser.y"
     {
-      if((yyvsp[0].dblval) == 0.0) {
+      if((yyvsp[(3) - (3)].dblval) == 0.0) {
         yyerror(p, "Division by zero.");
         return(-1);
       } else
-        (yyval.dblval) = (yyvsp[-2].dblval) / (yyvsp[0].dblval); 
+        (yyval.dblval) = (yyvsp[(1) - (3)].dblval) / (yyvsp[(3) - (3)].dblval); 
     }
     break;
 
   case 60:
+
+/* Line 1455 of yacc.c  */
 #line 521 "mapparser.y"
-    { (yyval.dblval) = (yyvsp[0].dblval); }
+    { (yyval.dblval) = (yyvsp[(2) - (2)].dblval); }
     break;
 
   case 61:
+
+/* Line 1455 of yacc.c  */
 #line 522 "mapparser.y"
-    { (yyval.dblval) = pow((yyvsp[-2].dblval), (yyvsp[0].dblval)); }
+    { (yyval.dblval) = pow((yyvsp[(1) - (3)].dblval), (yyvsp[(3) - (3)].dblval)); }
     break;
 
   case 62:
+
+/* Line 1455 of yacc.c  */
 #line 523 "mapparser.y"
-    { (yyval.dblval) = strlen((yyvsp[-1].strval)); }
+    { (yyval.dblval) = strlen((yyvsp[(3) - (4)].strval)); }
     break;
 
   case 63:
+
+/* Line 1455 of yacc.c  */
 #line 524 "mapparser.y"
     {
-      if((yyvsp[-1].shpval)->type != MS_SHAPE_POLYGON) {
+      if((yyvsp[(3) - (4)].shpval)->type != MS_SHAPE_POLYGON) {
         yyerror(p, "Area can only be computed for polygon shapes.");
         return(-1);
       }
-      (yyval.dblval) = msGetPolygonArea((yyvsp[-1].shpval));
-      if((yyvsp[-1].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[-1].shpval));
+      (yyval.dblval) = msGetPolygonArea((yyvsp[(3) - (4)].shpval));
+      if((yyvsp[(3) - (4)].shpval)->scratch == MS_TRUE) msFreeShape((yyvsp[(3) - (4)].shpval));
     }
     break;
 
   case 64:
+
+/* Line 1455 of yacc.c  */
 #line 532 "mapparser.y"
-    { (yyval.dblval) = (MS_NINT((yyvsp[-3].dblval)/(yyvsp[-1].dblval)))*(yyvsp[-1].dblval); }
+    { (yyval.dblval) = (MS_NINT((yyvsp[(3) - (6)].dblval)/(yyvsp[(5) - (6)].dblval)))*(yyvsp[(5) - (6)].dblval); }
     break;
 
   case 66:
+
+/* Line 1455 of yacc.c  */
 #line 536 "mapparser.y"
-    { (yyval.shpval) = (yyvsp[-1].shpval); }
+    { (yyval.shpval) = (yyvsp[(2) - (3)].shpval); }
     break;
 
   case 67:
+
+/* Line 1455 of yacc.c  */
 #line 537 "mapparser.y"
     {
       shapeObj *s;
-      s = msGEOSBuffer((yyvsp[-3].shpval), (yyvsp[-1].dblval));
+      s = msGEOSBuffer((yyvsp[(3) - (6)].shpval), (yyvsp[(5) - (6)].dblval));
       if(!s) {
         yyerror(p, "Executing buffer failed.");
         return(-1);
@@ -1977,54 +2428,63 @@ yyreduce:
     break;
 
   case 69:
+
+/* Line 1455 of yacc.c  */
 #line 550 "mapparser.y"
-    { (yyval.strval) = (yyvsp[-1].strval); }
+    { (yyval.strval) = (yyvsp[(2) - (3)].strval); }
     break;
 
   case 70:
+
+/* Line 1455 of yacc.c  */
 #line 551 "mapparser.y"
     { 
-      (yyval.strval) = (char *)malloc(strlen((yyvsp[-2].strval)) + strlen((yyvsp[0].strval)) + 1);
-      sprintf((yyval.strval), "%s%s", (yyvsp[-2].strval), (yyvsp[0].strval)); free((yyvsp[-2].strval)); free((yyvsp[0].strval)); 
+      (yyval.strval) = (char *)malloc(strlen((yyvsp[(1) - (3)].strval)) + strlen((yyvsp[(3) - (3)].strval)) + 1);
+      sprintf((yyval.strval), "%s%s", (yyvsp[(1) - (3)].strval), (yyvsp[(3) - (3)].strval)); free((yyvsp[(1) - (3)].strval)); free((yyvsp[(3) - (3)].strval)); 
     }
     break;
 
   case 71:
+
+/* Line 1455 of yacc.c  */
 #line 555 "mapparser.y"
     {
-      (yyval.strval) = (char *) malloc(strlen((yyvsp[-1].strval)) + 64); /* Plenty big? Should use snprintf below... */
-      sprintf((yyval.strval), (yyvsp[-1].strval), (yyvsp[-3].dblval));
+      (yyval.strval) = (char *) malloc(strlen((yyvsp[(5) - (6)].strval)) + 64); /* Plenty big? Should use snprintf below... */
+      sprintf((yyval.strval), (yyvsp[(5) - (6)].strval), (yyvsp[(3) - (6)].dblval));
     }
     break;
 
   case 72:
+
+/* Line 1455 of yacc.c  */
 #line 559 "mapparser.y"
     {  
-      (yyvsp[-1].strval) = msCommifyString((yyvsp[-1].strval)); 
-      (yyval.strval) = (yyvsp[-1].strval); 
+      (yyvsp[(3) - (4)].strval) = msCommifyString((yyvsp[(3) - (4)].strval)); 
+      (yyval.strval) = (yyvsp[(3) - (4)].strval); 
     }
     break;
 
   case 74:
+
+/* Line 1455 of yacc.c  */
 #line 566 "mapparser.y"
-    { (yyval.tmval) = (yyvsp[-1].tmval); }
+    { (yyval.tmval) = (yyvsp[(2) - (3)].tmval); }
     break;
 
 
-    }
-
-/* Line 1037 of yacc.c.  */
-#line 2018 "mapparser.c"
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
 
+/* Line 1455 of yacc.c  */
+#line 2478 "mapparser.c"
+      default: break;
+    }
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
+  YYPOPSTACK (yylen);
+  yylen = 0;
   YY_STACK_PRINT (yyss, yyssp);
 
   *++yyvsp = yyval;
 
-
   /* Now `shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
@@ -2048,98 +2508,65 @@ yyerrlab:
   if (!yyerrstatus)
     {
       ++yynerrs;
-#if YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (YYPACT_NINF < yyn && yyn < YYLAST)
-	{
-	  YYSIZE_T yysize = 0;
-	  int yytype = YYTRANSLATE (yychar);
-	  const char* yyprefix;
-	  char *yymsg;
-	  int yyx;
-
-	  /* Start YYX at -YYN if negative to avoid negative indexes in
-	     YYCHECK.  */
-	  int yyxbegin = yyn < 0 ? -yyn : 0;
-
-	  /* Stay within bounds of both yycheck and yytname.  */
-	  int yychecklim = YYLAST - yyn;
-	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-	  int yycount = 0;
-
-	  yyprefix = ", expecting ";
-	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+#if ! YYERROR_VERBOSE
+      yyerror (p, YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
 	      {
-		yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
-		yycount += 1;
-		if (yycount == 5)
-		  {
-		    yysize = 0;
-		    break;
-		  }
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
 	      }
-	  yysize += (sizeof ("syntax error, unexpected ")
-		     + yystrlen (yytname[yytype]));
-	  yymsg = (char *) YYSTACK_ALLOC (yysize);
-	  if (yymsg != 0)
-	    {
-	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
-	      yyp = yystpcpy (yyp, yytname[yytype]);
-
-	      if (yycount < 5)
-		{
-		  yyprefix = ", expecting ";
-		  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-		      {
-			yyp = yystpcpy (yyp, yyprefix);
-			yyp = yystpcpy (yyp, yytname[yyx]);
-			yyprefix = " or ";
-		      }
-		}
-	      yyerror (p, yymsg);
-	      YYSTACK_FREE (yymsg);
-	    }
-	  else
-	    yyerror (p, "syntax error; also virtual memory exhausted");
-	}
-      else
-#endif /* YYERROR_VERBOSE */
-	yyerror (p, "syntax error");
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (p, yymsg);
+	  }
+	else
+	  {
+	    yyerror (p, YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#endif
     }
 
 
 
   if (yyerrstatus == 3)
     {
-      /* If just tried and failed to reuse look-ahead token after an
+      /* If just tried and failed to reuse lookahead token after an
 	 error, discard it.  */
 
       if (yychar <= YYEOF)
-        {
-          /* If at end of input, pop the error token,
-	     then the rest of the stack, then return failure.  */
+	{
+	  /* Return failure if at end of input.  */
 	  if (yychar == YYEOF)
-	     for (;;)
-	       {
-
-		 YYPOPSTACK;
-		 if (yyssp == yyss)
-		   YYABORT;
-		 yydestruct ("Error: popping",
-                             yystos[*yyssp], yyvsp);
-	       }
-        }
+	    YYABORT;
+	}
       else
 	{
-	  yydestruct ("Error: discarding", yytoken, &yylval);
+	  yydestruct ("Error: discarding",
+		      yytoken, &yylval, p);
 	  yychar = YYEMPTY;
 	}
     }
 
-  /* Else will try to reuse look-ahead token after shifting the error
+  /* Else will try to reuse lookahead token after shifting the error
      token.  */
   goto yyerrlab1;
 
@@ -2149,15 +2576,17 @@ yyerrlab:
 `---------------------------------------------------*/
 yyerrorlab:
 
-#ifdef __GNUC__
-  /* Pacify GCC when the user code never invokes YYERROR and the label
-     yyerrorlab therefore never appears in user code.  */
-  if (0)
+  /* Pacify compilers like GCC when the user code never invokes
+     YYERROR and the label yyerrorlab therefore never appears in user
+     code.  */
+  if (/*CONSTCOND*/ 0)
      goto yyerrorlab;
-#endif
 
-yyvsp -= yylen;
-  yyssp -= yylen;
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
   yystate = *yyssp;
   goto yyerrlab1;
 
@@ -2187,19 +2616,17 @@ yyerrlab1:
 	YYABORT;
 
 
-      yydestruct ("Error: popping", yystos[yystate], yyvsp);
-      YYPOPSTACK;
+      yydestruct ("Error: popping",
+		  yystos[yystate], yyvsp, p);
+      YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
   *++yyvsp = yylval;
 
 
-  /* Shift the error token. */
+  /* Shift the error token.  */
   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 
   yystate = yyn;
@@ -2217,31 +2644,48 @@ yyacceptlab:
 | yyabortlab -- YYABORT comes here.  |
 `-----------------------------------*/
 yyabortlab:
-  yydestruct ("Error: discarding lookahead",
-              yytoken, &yylval);
-  yychar = YYEMPTY;
   yyresult = 1;
   goto yyreturn;
 
-#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here.  |
-`----------------------------------------------*/
-yyoverflowlab:
-  yyerror (p, "parser stack overflow");
+#if !defined(yyoverflow) || YYERROR_VERBOSE
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (p, YY_("memory exhausted"));
   yyresult = 2;
   /* Fall through.  */
 #endif
 
 yyreturn:
+  if (yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval, p);
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
+  while (yyssp != yyss)
+    {
+      yydestruct ("Cleanup: popping",
+		  yystos[*yyssp], yyvsp, p);
+      YYPOPSTACK (1);
+    }
 #ifndef yyoverflow
   if (yyss != yyssa)
     YYSTACK_FREE (yyss);
 #endif
-  return yyresult;
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
 }
 
 
+
+/* Line 1675 of yacc.c  */
 #line 569 "mapparser.y"
 
 
diff --git a/mapparser.h b/mapparser.h
index 22e3617..3bdd211 100644
--- a/mapparser.h
+++ b/mapparser.h
@@ -1,27 +1,37 @@
-/* A Bison parser, made by GNU Bison 2.0.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* A Bison parser, made by GNU Bison 2.4.1.  */
 
-   This program is free software; you can redistribute it and/or modify
+/* Skeleton interface for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+   
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+   
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
 
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
 
 /* Tokens.  */
 #ifndef YYTOKENTYPE
@@ -64,6 +74,7 @@
      NEG = 290
    };
 #endif
+/* Tokens.  */
 #define NUMBER 258
 #define STRING 259
 #define TIME 260
@@ -101,23 +112,29 @@
 
 
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+{
+
+/* Line 1676 of yacc.c  */
 #line 30 "mapparser.y"
-typedef union YYSTYPE {
+
   double dblval;
   int intval;  
   char *strval;  
   struct tm tmval;
   shapeObj *shpval;
+
+
+
+/* Line 1676 of yacc.c  */
+#line 132 "mapparser.h"
 } YYSTYPE;
-/* Line 1274 of yacc.c.  */
-#line 115 "mapparser.h"
+# define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 
 
 
-
diff --git a/mapparser.y b/mapparser.y
index 07480c9..df598cc 100644
--- a/mapparser.y
+++ b/mapparser.y
@@ -474,11 +474,11 @@ logical_exp:
     }
   | shape_exp CONTAINS shape_exp {
       int rval;
-      rval = msGEOSWithin($1, $3);
+      rval = msGEOSContains($1, $3);
       if($1->scratch == MS_TRUE) msFreeShape($1);
       if($3->scratch == MS_TRUE) msFreeShape($3);
       if(rval == -1) {
-        yyerror(p, "Within operator failed.");
+        yyerror(p, "Contains operator failed.");
         return(-1);
       } else
         $$ = rval;
diff --git a/mappluginlayer.c b/mappluginlayer.c
index 7e22922..2c0fe38 100644
--- a/mappluginlayer.c
+++ b/mappluginlayer.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mappluginlayer.c 11147 2011-03-11 03:26:44Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of plug-in layer functionality
@@ -30,7 +30,7 @@
 #include "mapserver.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: mappluginlayer.c 11147 2011-03-11 03:26:44Z dmorissette $")
+MS_CVSID("$Id$")
 
 typedef struct {
     char *name;
diff --git a/mappool.c b/mappool.c
index 48ff9c1..aca0686 100644
--- a/mappool.c
+++ b/mappool.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mappool.c 11072 2011-03-04 19:57:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implement new style connection pooling.
@@ -134,7 +134,7 @@ o The connection pooling API will let a connection be used/referenced multiple
 #include "mapserver.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: mappool.c 11072 2011-03-04 19:57:16Z dmorissette $")
+MS_CVSID("$Id$")
 
 /* defines for lifetime.  
    A positive number is a time-from-last use in seconds */
diff --git a/mappostgis.c b/mappostgis.c
index ae0c504..3d50563 100644
--- a/mappostgis.c
+++ b/mappostgis.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mappostgis.c 11910 2011-07-12 18:09:25Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  PostGIS CONNECTIONTYPE support.
@@ -84,7 +84,7 @@
  
 #ifdef USE_POSTGIS
   
-MS_CVSID("$Id: mappostgis.c 11910 2011-07-12 18:09:25Z dmorissette $")
+MS_CVSID("$Id$")
 
 /*
 ** msPostGISCloseConnection()
@@ -1533,7 +1533,7 @@ char *msPostGISBuildSQLBox(layerObj *layer, rectObj *rect, char *strSRID) {
     }
 
     if ( strSRID ) {
-        static char *strBoxTemplate = "GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))',%s)";
+        static char *strBoxTemplate = "ST_GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))',%s)";
         /* 10 doubles + 1 integer + template characters */
         sz = 10 * 22 + strlen(strSRID) + strlen(strBoxTemplate);
         strBox = (char*)msSmallMalloc(sz+1); /* add space for terminating NULL */
@@ -1549,7 +1549,7 @@ char *msPostGISBuildSQLBox(layerObj *layer, rectObj *rect, char *strSRID) {
                 return NULL;
             }
         } else {
-            static char *strBoxTemplate = "GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))')";
+            static char *strBoxTemplate = "ST_GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))')";
             /* 10 doubles + template characters */
             sz = 10 * 22 + strlen(strBoxTemplate);
             strBox = (char*)msSmallMalloc(sz+1); /* add space for terminating NULL */
@@ -2468,7 +2468,10 @@ int msPostGISLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery) {
 
     /* Something went wrong. */
     if (!pgresult || PQresultStatus(pgresult) != PGRES_TUPLES_OK) {
-        msSetError(MS_QUERYERR, "Error (%s) executing query: %s", "msPostGISLayerWhichShapes()", PQerrorMessage(layerinfo->pgconn), strSQL);
+        if ( layer->debug ) {
+	    msDebug("Error (%s) executing query: %s", "msPostGISLayerWhichShapes()\n", PQerrorMessage(layerinfo->pgconn), strSQL);
+	}
+        msSetError(MS_QUERYERR, "Error executing query: %s ", "msPostGISLayerWhichShapes()", PQerrorMessage(layerinfo->pgconn));
         free(strSQL);
         if (pgresult) {
             PQclear(pgresult);
@@ -2649,7 +2652,10 @@ int msPostGISLayerGetShape(layerObj *layer, shapeObj *shape, resultObj *record)
 
         /* Something went wrong. */
         if ( (!pgresult) || (PQresultStatus(pgresult) != PGRES_TUPLES_OK) ) {
-            msSetError(MS_QUERYERR, "Error (%s) executing SQL: %s", "msPostGISLayerGetShape()", PQerrorMessage(layerinfo->pgconn), strSQL );
+	    if ( layer->debug ) {
+	        msDebug("Error (%s) executing SQL: %s", "msPostGISLayerGetShape()\n", PQerrorMessage(layerinfo->pgconn), strSQL );
+	    }            
+            msSetError(MS_QUERYERR, "Error executing SQL: %s", "msPostGISLayerGetShape()", PQerrorMessage(layerinfo->pgconn));
 
             if (pgresult) {
                 PQclear(pgresult);
@@ -2872,7 +2878,10 @@ int msPostGISLayerGetItems(layerObj *layer) {
     pgresult = PQexecParams(layerinfo->pgconn, sql,0, NULL, NULL, NULL, NULL, 0);
     
     if ( (!pgresult) || (PQresultStatus(pgresult) != PGRES_TUPLES_OK) ) {
-        msSetError(MS_QUERYERR, "Error (%s) executing SQL: %s", "msPostGISLayerGetItems()", PQerrorMessage(layerinfo->pgconn), sql);
+        if ( layer->debug ) {
+	  msDebug("Error (%s) executing SQL: %s", "msPostGISLayerGetItems()\n", PQerrorMessage(layerinfo->pgconn), sql);
+	}
+        msSetError(MS_QUERYERR, "Error executing SQL: %s", "msPostGISLayerGetItems()", PQerrorMessage(layerinfo->pgconn));
         if (pgresult) {
             PQclear(pgresult);
         }
diff --git a/mappostgis.h b/mappostgis.h
index 01fb395..01221b0 100644
--- a/mappostgis.h
+++ b/mappostgis.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mappostgis.h 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  PostGIS CONNECTIONTYPE support.
diff --git a/mappostgresql.c b/mappostgresql.c
index a8c8efc..a240e19 100644
--- a/mappostgresql.c
+++ b/mappostgresql.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mappostgresql.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Postgres CONNECTIONTYPE support.
@@ -28,7 +28,7 @@
  ****************************************************************************/
 
 
-/* $Id: mappostgresql.c 10772 2010-11-29 18:27:02Z aboudreault $ */
+/* $Id$ */
 #include <assert.h>
 #include "mapserver.h"
 #include "maptime.h"
@@ -50,7 +50,7 @@
 #include <string.h>
 #include <ctype.h> /* tolower() */
 
-MS_CVSID("$Id: mappostgresql.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 
 typedef struct {
@@ -326,7 +326,7 @@ int msPOSTGRESQLJoinNext(joinObj *join) {
         }
 
         /* Create the query string. */
-        sql = (char *)malloc(24 + strlen(columns) + strlen(join->table) + 
+        sql = (char *)malloc(26 + strlen(columns) + strlen(join->table) + 
                 strlen(join->to) + strlen(joininfo->from_value));
         if(!sql) {
             msSetError(MS_MEMERR, "Failure to malloc.\n", 
diff --git a/mapprimitive.c b/mapprimitive.c
index 87a6e1e..c9a63ca 100644
--- a/mapprimitive.c
+++ b/mapprimitive.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapprimitive.c 11636 2011-05-03 16:10:44Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementations for rectObj, pointObj, lineObj, shapeObj, etc.
@@ -32,7 +32,7 @@
 #include <assert.h>
 #include <locale.h>
 
-MS_CVSID("$Id: mapprimitive.c 11636 2011-05-03 16:10:44Z assefa $")
+MS_CVSID("$Id$")
 
 typedef enum {CLIP_LEFT, CLIP_MIDDLE, CLIP_RIGHT} CLIP_STATE;
 
diff --git a/mapprimitive.h b/mapprimitive.h
index bbea6f7..caa3e2c 100644
--- a/mapprimitive.h
+++ b/mapprimitive.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapprimitive.h 11080 2011-03-05 16:41:32Z tamas $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Declarations for rectObj, pointObj, lineObj, shapeObj, etc.
diff --git a/mapproject.c b/mapproject.c
index 386ca96..83f0fcb 100644
--- a/mapproject.c
+++ b/mapproject.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapproject.c 11376 2011-03-30 01:11:13Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  projectionObj / PROJ.4 interface.
@@ -34,7 +34,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-MS_CVSID("$Id: mapproject.c 11376 2011-03-30 01:11:13Z dmorissette $")
+MS_CVSID("$Id$")
 
 #ifdef USE_PROJ
 static int msTestNeedWrap( pointObj pt1, pointObj pt2, pointObj pt2_geo,
diff --git a/mapproject.h b/mapproject.h
index bd1cc06..b788a84 100644
--- a/mapproject.h
+++ b/mapproject.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapproject.h 11376 2011-03-30 01:11:13Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Declarations of the projectionObj and related functions.
diff --git a/mapprojhack.c b/mapprojhack.c
index 251da28..24bbd64 100644
--- a/mapprojhack.c
+++ b/mapprojhack.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapprojhack.c 11832 2011-06-17 19:06:58Z warmerdam $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of utility functions related to the PROJ4 library
diff --git a/mapquantization.c b/mapquantization.c
index 0b457a8..ebbeb2e 100644
--- a/mapquantization.c
+++ b/mapquantization.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapquantization.c 11599 2011-04-19 05:14:17Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  RGB(A) to Palette Support Functions
diff --git a/mapquery.c b/mapquery.c
index 61ac572..8676fdc 100644
--- a/mapquery.c
+++ b/mapquery.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapquery.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  layer query support.
@@ -29,7 +29,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapquery.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 int msInitQuery(queryObj *query)
 {
diff --git a/mapraster.c b/mapraster.c
index 7c84ece..2dc31fa 100644
--- a/mapraster.c
+++ b/mapraster.c
@@ -35,7 +35,7 @@
 #include "mapresample.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: mapraster.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 extern int msyylex_destroy(void);
 extern int yyparse(parseObj *);
diff --git a/maprasterquery.c b/maprasterquery.c
index 49b4006..0b6a0cb 100644
--- a/maprasterquery.c
+++ b/maprasterquery.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maprasterquery.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of query operations on rasters. 
@@ -32,7 +32,7 @@
 #include "mapresample.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: maprasterquery.c 11881 2011-07-07 19:55:43Z sdlime $");
+MS_CVSID("$Id$");
 
 int msRASTERLayerGetShape(layerObj *layer, shapeObj *shape, resultObj *record);
 int msRASTERLayerGetItems(layerObj *layer);
diff --git a/mapregex.c b/mapregex.c
index 6701ef7..f65c239 100644
--- a/mapregex.c
+++ b/mapregex.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapregex.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Regex wrapper
diff --git a/mapregex.h b/mapregex.h
index e8e3c10..674e4f3 100644
--- a/mapregex.h
+++ b/mapregex.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapregex.h 9154 2009-07-08 18:40:27Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Regex wrapper
diff --git a/maprendering.c b/maprendering.c
index 3e45641..5beb690 100644
--- a/maprendering.c
+++ b/maprendering.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maprendering.c 11855 2011-06-28 17:29:16Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Rendering utility functions
diff --git a/mapresample.c b/mapresample.c
index 466c890..e283a70 100644
--- a/mapresample.c
+++ b/mapresample.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapresample.c 11734 2011-05-20 20:19:04Z warmerdam $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Assorted code related to resampling rasters.
@@ -31,7 +31,7 @@
 #include "mapresample.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: mapresample.c 11734 2011-05-20 20:19:04Z warmerdam $")
+MS_CVSID("$Id$")
 
 #ifndef MAX
 #  define MIN(a,b)      ((a<b) ? a : b)
diff --git a/mapresample.h b/mapresample.h
index 7e6c889..6a46b55 100644
--- a/mapresample.h
+++ b/mapresample.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapresample.h 9873 2010-02-23 05:06:40Z warmerdam $
+ * $Id$
  *
  * Project:  CFS OGC MapServer
  * Purpose:  Definitions related to raster resampling support.
diff --git a/mapscale.c b/mapscale.c
index dfb2566..4f1cf11 100644
--- a/mapscale.c
+++ b/mapscale.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapscale.c 11316 2011-03-23 20:57:10Z assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Scale object rendering. 
@@ -29,7 +29,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapscale.c 11316 2011-03-23 20:57:10Z assefa $")
+MS_CVSID("$Id$")
 
 #define VMARGIN 3 /* buffer around the scalebar */
 #define HMARGIN 3
diff --git a/mapscript/README.txt b/mapscript/README.txt
index 01a3f89..3242129 100644
--- a/mapscript/README.txt
+++ b/mapscript/README.txt
@@ -1,4 +1,4 @@
-.. $Id: README.txt 6844 2007-09-05 22:50:39Z hobu $
+.. $Id$
 
 MapServer Mapscript Modules
 ===========================
diff --git a/mapscript/csharp/DBFFieldType.cs b/mapscript/csharp/DBFFieldType.cs
index e9de37a..43f50eb 100644
--- a/mapscript/csharp/DBFFieldType.cs
+++ b/mapscript/csharp/DBFFieldType.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/DBFInfo.cs b/mapscript/csharp/DBFInfo.cs
index f19a14a..d514900 100644
--- a/mapscript/csharp/DBFInfo.cs
+++ b/mapscript/csharp/DBFInfo.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_ALIGN_VALUE.cs b/mapscript/csharp/MS_ALIGN_VALUE.cs
index 82000e7..421fa0f 100644
--- a/mapscript/csharp/MS_ALIGN_VALUE.cs
+++ b/mapscript/csharp/MS_ALIGN_VALUE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_BITMAP_FONT_SIZES.cs b/mapscript/csharp/MS_BITMAP_FONT_SIZES.cs
index 8f471c2..125ed8d 100644
--- a/mapscript/csharp/MS_BITMAP_FONT_SIZES.cs
+++ b/mapscript/csharp/MS_BITMAP_FONT_SIZES.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_CAPS_JOINS_AND_CORNERS.cs b/mapscript/csharp/MS_CAPS_JOINS_AND_CORNERS.cs
index 08e5a72..bf31dfc 100644
--- a/mapscript/csharp/MS_CAPS_JOINS_AND_CORNERS.cs
+++ b/mapscript/csharp/MS_CAPS_JOINS_AND_CORNERS.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_CONNECTION_TYPE.cs b/mapscript/csharp/MS_CONNECTION_TYPE.cs
index 559dccc..5e4d296 100644
--- a/mapscript/csharp/MS_CONNECTION_TYPE.cs
+++ b/mapscript/csharp/MS_CONNECTION_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_FILE_TYPE.cs b/mapscript/csharp/MS_FILE_TYPE.cs
index 802707f..4d62085 100644
--- a/mapscript/csharp/MS_FILE_TYPE.cs
+++ b/mapscript/csharp/MS_FILE_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_FONT_TYPE.cs b/mapscript/csharp/MS_FONT_TYPE.cs
index e09fa80..82cc4bc 100644
--- a/mapscript/csharp/MS_FONT_TYPE.cs
+++ b/mapscript/csharp/MS_FONT_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_GEOS_OPERATOR.cs b/mapscript/csharp/MS_GEOS_OPERATOR.cs
index e02f891..102e80b 100644
--- a/mapscript/csharp/MS_GEOS_OPERATOR.cs
+++ b/mapscript/csharp/MS_GEOS_OPERATOR.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_IMAGEMODE.cs b/mapscript/csharp/MS_IMAGEMODE.cs
index 4448456..2609ac7 100644
--- a/mapscript/csharp/MS_IMAGEMODE.cs
+++ b/mapscript/csharp/MS_IMAGEMODE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_JOIN_CONNECTION_TYPE.cs b/mapscript/csharp/MS_JOIN_CONNECTION_TYPE.cs
index c0ccb13..fec65c2 100644
--- a/mapscript/csharp/MS_JOIN_CONNECTION_TYPE.cs
+++ b/mapscript/csharp/MS_JOIN_CONNECTION_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_JOIN_TYPE.cs b/mapscript/csharp/MS_JOIN_TYPE.cs
index 1c99d5d..828677c 100644
--- a/mapscript/csharp/MS_JOIN_TYPE.cs
+++ b/mapscript/csharp/MS_JOIN_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_LABEL_BINDING_ENUM.cs b/mapscript/csharp/MS_LABEL_BINDING_ENUM.cs
index 6ebb0a0..b0cc5fa 100644
--- a/mapscript/csharp/MS_LABEL_BINDING_ENUM.cs
+++ b/mapscript/csharp/MS_LABEL_BINDING_ENUM.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_LAYER_TYPE.cs b/mapscript/csharp/MS_LAYER_TYPE.cs
index 787e229..52fc717 100644
--- a/mapscript/csharp/MS_LAYER_TYPE.cs
+++ b/mapscript/csharp/MS_LAYER_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_PARSE_TYPE_ENUM.cs b/mapscript/csharp/MS_PARSE_TYPE_ENUM.cs
index aca79b4..2dd5c03 100644
--- a/mapscript/csharp/MS_PARSE_TYPE_ENUM.cs
+++ b/mapscript/csharp/MS_PARSE_TYPE_ENUM.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_POSITIONS_ENUM.cs b/mapscript/csharp/MS_POSITIONS_ENUM.cs
index c8f3c5c..6d508db 100644
--- a/mapscript/csharp/MS_POSITIONS_ENUM.cs
+++ b/mapscript/csharp/MS_POSITIONS_ENUM.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_QUERYMAP_STYLES.cs b/mapscript/csharp/MS_QUERYMAP_STYLES.cs
index 1bd36fd..85e315e 100644
--- a/mapscript/csharp/MS_QUERYMAP_STYLES.cs
+++ b/mapscript/csharp/MS_QUERYMAP_STYLES.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_QUERY_MODE.cs b/mapscript/csharp/MS_QUERY_MODE.cs
index c54947e..6176c81 100644
--- a/mapscript/csharp/MS_QUERY_MODE.cs
+++ b/mapscript/csharp/MS_QUERY_MODE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_QUERY_TYPE.cs b/mapscript/csharp/MS_QUERY_TYPE.cs
index 6c61389..b1e036f 100644
--- a/mapscript/csharp/MS_QUERY_TYPE.cs
+++ b/mapscript/csharp/MS_QUERY_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_REQUEST_TYPE.cs b/mapscript/csharp/MS_REQUEST_TYPE.cs
index cc40b67..47472d9 100644
--- a/mapscript/csharp/MS_REQUEST_TYPE.cs
+++ b/mapscript/csharp/MS_REQUEST_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_RETURN_VALUE.cs b/mapscript/csharp/MS_RETURN_VALUE.cs
index f397854..de706f4 100644
--- a/mapscript/csharp/MS_RETURN_VALUE.cs
+++ b/mapscript/csharp/MS_RETURN_VALUE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_SHAPE_TYPE.cs b/mapscript/csharp/MS_SHAPE_TYPE.cs
index 468cdbc..f9b9bf7 100644
--- a/mapscript/csharp/MS_SHAPE_TYPE.cs
+++ b/mapscript/csharp/MS_SHAPE_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_STYLE_BINDING_ENUM.cs b/mapscript/csharp/MS_STYLE_BINDING_ENUM.cs
index eda4e73..b609995 100644
--- a/mapscript/csharp/MS_STYLE_BINDING_ENUM.cs
+++ b/mapscript/csharp/MS_STYLE_BINDING_ENUM.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_SYMBOL_TYPE.cs b/mapscript/csharp/MS_SYMBOL_TYPE.cs
index ceae2bc..421b7f3 100644
--- a/mapscript/csharp/MS_SYMBOL_TYPE.cs
+++ b/mapscript/csharp/MS_SYMBOL_TYPE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_TOKEN_BINDING_ENUM.cs b/mapscript/csharp/MS_TOKEN_BINDING_ENUM.cs
index d692d3c..65a8bf1 100644
--- a/mapscript/csharp/MS_TOKEN_BINDING_ENUM.cs
+++ b/mapscript/csharp/MS_TOKEN_BINDING_ENUM.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_TOKEN_COMPARISON_ENUM.cs b/mapscript/csharp/MS_TOKEN_COMPARISON_ENUM.cs
index ee73023..450ba2c 100644
--- a/mapscript/csharp/MS_TOKEN_COMPARISON_ENUM.cs
+++ b/mapscript/csharp/MS_TOKEN_COMPARISON_ENUM.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_TOKEN_FUNCTION_ENUM.cs b/mapscript/csharp/MS_TOKEN_FUNCTION_ENUM.cs
index 2a8ba5f..a97963f 100644
--- a/mapscript/csharp/MS_TOKEN_FUNCTION_ENUM.cs
+++ b/mapscript/csharp/MS_TOKEN_FUNCTION_ENUM.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_TOKEN_LITERAL_ENUM.cs b/mapscript/csharp/MS_TOKEN_LITERAL_ENUM.cs
index 4657231..9fe3e1b 100644
--- a/mapscript/csharp/MS_TOKEN_LITERAL_ENUM.cs
+++ b/mapscript/csharp/MS_TOKEN_LITERAL_ENUM.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_TOKEN_LOGICAL_ENUM.cs b/mapscript/csharp/MS_TOKEN_LOGICAL_ENUM.cs
index 88ccc02..de0bba1 100644
--- a/mapscript/csharp/MS_TOKEN_LOGICAL_ENUM.cs
+++ b/mapscript/csharp/MS_TOKEN_LOGICAL_ENUM.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_TRANSFORM_MODE.cs b/mapscript/csharp/MS_TRANSFORM_MODE.cs
index c68c0cd..9bd48c3 100644
--- a/mapscript/csharp/MS_TRANSFORM_MODE.cs
+++ b/mapscript/csharp/MS_TRANSFORM_MODE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/MS_UNITS.cs b/mapscript/csharp/MS_UNITS.cs
index 0ebcaa8..83be2fe 100644
--- a/mapscript/csharp/MS_UNITS.cs
+++ b/mapscript/csharp/MS_UNITS.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/Makefile.in b/mapscript/csharp/Makefile.in
index 034ec06..951961f 100644
--- a/mapscript/csharp/Makefile.in
+++ b/mapscript/csharp/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in 11285 2011-03-19 21:53:46Z tamas $
+# $Id$
 #
 # Run ./configure in the main MapServer directory to turn this Makefile.in
 # into a proper Makefile
diff --git a/mapscript/csharp/Makefile.vc b/mapscript/csharp/Makefile.vc
index 3ab5e45..63cb86a 100755
--- a/mapscript/csharp/Makefile.vc
+++ b/mapscript/csharp/Makefile.vc
@@ -8,7 +8,7 @@
 #  - Run the VCVARS32.BAT script to initialize the VC++ environment variables
 #  - Start the build with:  nmake /f makefile.vc
 #
-# $Id: Makefile.vc 10747 2010-11-20 23:39:58Z tamas $
+# $Id$
 #
 
 
diff --git a/mapscript/csharp/OWSRequest.cs b/mapscript/csharp/OWSRequest.cs
index 8a97bc4..fcd3755 100644
--- a/mapscript/csharp/OWSRequest.cs
+++ b/mapscript/csharp/OWSRequest.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/README b/mapscript/csharp/README
index 8ccb213..61f5b10 100644
--- a/mapscript/csharp/README
+++ b/mapscript/csharp/README
@@ -1,4 +1,4 @@
--- $Id: README 5798 2006-10-11 21:01:41Z tamas $
+-- $Id$
 
 The most recent version of this document can be found on
 http://mapserver.gis.umn.edu/docs/howto/mapscriptcscompile
diff --git a/mapscript/csharp/SWIGTYPE_p_double.cs b/mapscript/csharp/SWIGTYPE_p_double.cs
index 2517ab2..4e5fe05 100644
--- a/mapscript/csharp/SWIGTYPE_p_double.cs
+++ b/mapscript/csharp/SWIGTYPE_p_double.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/SWIGTYPE_p_int.cs b/mapscript/csharp/SWIGTYPE_p_int.cs
index f447b2b..cb49b54 100644
--- a/mapscript/csharp/SWIGTYPE_p_int.cs
+++ b/mapscript/csharp/SWIGTYPE_p_int.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/SWIGTYPE_p_tileCacheObj.cs b/mapscript/csharp/SWIGTYPE_p_tileCacheObj.cs
index 80b9903..dd68bff 100644
--- a/mapscript/csharp/SWIGTYPE_p_tileCacheObj.cs
+++ b/mapscript/csharp/SWIGTYPE_p_tileCacheObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/SWIGTYPE_p_uint32_t.cs b/mapscript/csharp/SWIGTYPE_p_uint32_t.cs
index 451ee9b..a864742 100644
--- a/mapscript/csharp/SWIGTYPE_p_uint32_t.cs
+++ b/mapscript/csharp/SWIGTYPE_p_uint32_t.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/classObj.cs b/mapscript/csharp/classObj.cs
index f481547..1455804 100644
--- a/mapscript/csharp/classObj.cs
+++ b/mapscript/csharp/classObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/clusterObj.cs b/mapscript/csharp/clusterObj.cs
index 72eedcb..f9d28a6 100644
--- a/mapscript/csharp/clusterObj.cs
+++ b/mapscript/csharp/clusterObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/colorObj.cs b/mapscript/csharp/colorObj.cs
index faba496..d2ca377 100644
--- a/mapscript/csharp/colorObj.cs
+++ b/mapscript/csharp/colorObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/config/AssemblyInfo.cs b/mapscript/csharp/config/AssemblyInfo.cs
index e5de9ce..e265aa8 100644
--- a/mapscript/csharp/config/AssemblyInfo.cs
+++ b/mapscript/csharp/config/AssemblyInfo.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: AssemblyInfo.cs 10129 2010-05-02 12:02:51Z tamas $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  MapScript CSharp Assembly Information
diff --git a/mapscript/csharp/csmodule.i b/mapscript/csharp/csmodule.i
index d2583e7..8a19d4a 100644
--- a/mapscript/csharp/csmodule.i
+++ b/mapscript/csharp/csmodule.i
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: csmodule.i 11081 2011-03-05 17:44:17Z tamas $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  C#-specific enhancements to MapScript
diff --git a/mapscript/csharp/debugLevel.cs b/mapscript/csharp/debugLevel.cs
index 5a3ead8..ff88d4d 100644
--- a/mapscript/csharp/debugLevel.cs
+++ b/mapscript/csharp/debugLevel.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/errorObj.cs b/mapscript/csharp/errorObj.cs
index cc729e2..b00c025 100644
--- a/mapscript/csharp/errorObj.cs
+++ b/mapscript/csharp/errorObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/examples/HTMLtemplate.cs b/mapscript/csharp/examples/HTMLtemplate.cs
index 066f392..5156fde 100644
--- a/mapscript/csharp/examples/HTMLtemplate.cs
+++ b/mapscript/csharp/examples/HTMLtemplate.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: HTMLtemplate.cs 11081 2011-03-05 17:44:17Z tamas $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  A C# based mapscript example to show the usage of HTML templates.
diff --git a/mapscript/csharp/examples/RFC24.cs b/mapscript/csharp/examples/RFC24.cs
index b22e8dc..8aba3c8 100644
--- a/mapscript/csharp/examples/RFC24.cs
+++ b/mapscript/csharp/examples/RFC24.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: RFC24.cs 7418 2008-02-29 00:02:49Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Tests for RFC24 implementation. 
diff --git a/mapscript/csharp/examples/drawmap.cs b/mapscript/csharp/examples/drawmap.cs
index 71294e9..0aa075d 100644
--- a/mapscript/csharp/examples/drawmap.cs
+++ b/mapscript/csharp/examples/drawmap.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: drawmap.cs 7418 2008-02-29 00:02:49Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  A C# based mapscript example to create an image given a mapfile.
diff --git a/mapscript/csharp/examples/drawmapDirect.cs b/mapscript/csharp/examples/drawmapDirect.cs
index ac8d51c..6edc611 100644
--- a/mapscript/csharp/examples/drawmapDirect.cs
+++ b/mapscript/csharp/examples/drawmapDirect.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: drawmapDirect.cs 10743 2010-11-19 17:05:38Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  A C# based mapscript example to draw the map directly onto a GDI
diff --git a/mapscript/csharp/examples/drawmapDirectPrint.cs b/mapscript/csharp/examples/drawmapDirectPrint.cs
index be86234..330b7ab 100644
--- a/mapscript/csharp/examples/drawmapDirectPrint.cs
+++ b/mapscript/csharp/examples/drawmapDirectPrint.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: drawmapDirectPrint.cs 10743 2010-11-19 17:05:38Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  A C# based mapscript example to draw the map directly onto a GDI
diff --git a/mapscript/csharp/examples/drawquery.cs b/mapscript/csharp/examples/drawquery.cs
index 643664f..457320f 100644
--- a/mapscript/csharp/examples/drawquery.cs
+++ b/mapscript/csharp/examples/drawquery.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: drawquery.cs 7418 2008-02-29 00:02:49Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  A C# based mapscript example to use the atribute query and 
diff --git a/mapscript/csharp/examples/getbytes.cs b/mapscript/csharp/examples/getbytes.cs
index d2feecf..1f792a0 100644
--- a/mapscript/csharp/examples/getbytes.cs
+++ b/mapscript/csharp/examples/getbytes.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: getbytes.cs 7418 2008-02-29 00:02:49Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  A C# based mapscript example to show the usage of 
diff --git a/mapscript/csharp/examples/shapeinfo.cs b/mapscript/csharp/examples/shapeinfo.cs
index ed6060b..5c18b86 100644
--- a/mapscript/csharp/examples/shapeinfo.cs
+++ b/mapscript/csharp/examples/shapeinfo.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: shapeinfo.cs 7418 2008-02-29 00:02:49Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  A C# based based mapscript example to dump information from 
diff --git a/mapscript/csharp/examples/shpdump.cs b/mapscript/csharp/examples/shpdump.cs
index 11f89ca..1584e79 100644
--- a/mapscript/csharp/examples/shpdump.cs
+++ b/mapscript/csharp/examples/shpdump.cs
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: shpdump.cs 7418 2008-02-29 00:02:49Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  A C# based based mapscript example to dump information from 
diff --git a/mapscript/csharp/fontSetObj.cs b/mapscript/csharp/fontSetObj.cs
index f8fa3e0..d9e34ce 100644
--- a/mapscript/csharp/fontSetObj.cs
+++ b/mapscript/csharp/fontSetObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/hashTableObj.cs b/mapscript/csharp/hashTableObj.cs
index 3f9411e..c43470e 100644
--- a/mapscript/csharp/hashTableObj.cs
+++ b/mapscript/csharp/hashTableObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/imageObj.cs b/mapscript/csharp/imageObj.cs
index b9f53f8..7a97aae 100644
--- a/mapscript/csharp/imageObj.cs
+++ b/mapscript/csharp/imageObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/intarray.cs b/mapscript/csharp/intarray.cs
index 2af7b68..2356cf9 100644
--- a/mapscript/csharp/intarray.cs
+++ b/mapscript/csharp/intarray.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/labelCacheMemberObj.cs b/mapscript/csharp/labelCacheMemberObj.cs
index 63f061e..ee7f858 100644
--- a/mapscript/csharp/labelCacheMemberObj.cs
+++ b/mapscript/csharp/labelCacheMemberObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/labelCacheObj.cs b/mapscript/csharp/labelCacheObj.cs
index ded1e63..f8ba58e 100644
--- a/mapscript/csharp/labelCacheObj.cs
+++ b/mapscript/csharp/labelCacheObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/labelCacheSlotObj.cs b/mapscript/csharp/labelCacheSlotObj.cs
index a412bb1..f977c4c 100644
--- a/mapscript/csharp/labelCacheSlotObj.cs
+++ b/mapscript/csharp/labelCacheSlotObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/labelObj.cs b/mapscript/csharp/labelObj.cs
index 77ba8fb..f39f4f2 100644
--- a/mapscript/csharp/labelObj.cs
+++ b/mapscript/csharp/labelObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -526,6 +526,38 @@ public class labelObj : IDisposable {
     return ret;
   }
 
+  public styleObj getStyle(int i) {
+    IntPtr cPtr = mapscriptPINVOKE.labelObj_getStyle(swigCPtr, i);
+    styleObj ret = (cPtr == IntPtr.Zero) ? null : new styleObj(cPtr, true, ThisOwn_false());
+    if (mapscriptPINVOKE.SWIGPendingException.Pending) throw mapscriptPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public int insertStyle(styleObj style, int index) {
+    int ret = mapscriptPINVOKE.labelObj_insertStyle(swigCPtr, styleObj.getCPtrAndSetReference(style, ThisOwn_false()), index);
+    if (mapscriptPINVOKE.SWIGPendingException.Pending) throw mapscriptPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public styleObj removeStyle(int index) {
+    IntPtr cPtr = mapscriptPINVOKE.labelObj_removeStyle(swigCPtr, index);
+    styleObj ret = (cPtr == IntPtr.Zero) ? null : new styleObj(cPtr, true, ThisOwn_true());
+    if (mapscriptPINVOKE.SWIGPendingException.Pending) throw mapscriptPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public int moveStyleUp(int index) {
+    int ret = mapscriptPINVOKE.labelObj_moveStyleUp(swigCPtr, index);
+    if (mapscriptPINVOKE.SWIGPendingException.Pending) throw mapscriptPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public int moveStyleDown(int index) {
+    int ret = mapscriptPINVOKE.labelObj_moveStyleDown(swigCPtr, index);
+    if (mapscriptPINVOKE.SWIGPendingException.Pending) throw mapscriptPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
   public labelObj() : this(mapscriptPINVOKE.new_labelObj(), true, null) {
     if (mapscriptPINVOKE.SWIGPendingException.Pending) throw mapscriptPINVOKE.SWIGPendingException.Retrieve();
   }
diff --git a/mapscript/csharp/labelStyleObj.cs b/mapscript/csharp/labelStyleObj.cs
index 0f0b63b..31939b4 100644
--- a/mapscript/csharp/labelStyleObj.cs
+++ b/mapscript/csharp/labelStyleObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/layerObj.cs b/mapscript/csharp/layerObj.cs
index 864ed13..190f4b5 100644
--- a/mapscript/csharp/layerObj.cs
+++ b/mapscript/csharp/layerObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/legendObj.cs b/mapscript/csharp/legendObj.cs
index 34073b7..4351a40 100644
--- a/mapscript/csharp/legendObj.cs
+++ b/mapscript/csharp/legendObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/lineObj.cs b/mapscript/csharp/lineObj.cs
index 26bd434..02fb64c 100644
--- a/mapscript/csharp/lineObj.cs
+++ b/mapscript/csharp/lineObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/mapObj.cs b/mapscript/csharp/mapObj.cs
index ea32b0a..3755602 100644
--- a/mapscript/csharp/mapObj.cs
+++ b/mapscript/csharp/mapObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/mapscript.cs b/mapscript/csharp/mapscript.cs
index 7b2b964..2c4731f 100644
--- a/mapscript/csharp/mapscript.cs
+++ b/mapscript/csharp/mapscript.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/mapscriptPINVOKE.cs b/mapscript/csharp/mapscriptPINVOKE.cs
index ae353f7..815d2e1 100644
--- a/mapscript/csharp/mapscriptPINVOKE.cs
+++ b/mapscript/csharp/mapscriptPINVOKE.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -1157,6 +1157,21 @@ class mapscriptPINVOKE {
   [DllImport("mapscript", EntryPoint="CSharp_labelObj_setBinding")]
   public static extern int labelObj_setBinding(HandleRef jarg1, int jarg2, string jarg3);
 
+  [DllImport("mapscript", EntryPoint="CSharp_labelObj_getStyle")]
+  public static extern IntPtr labelObj_getStyle(HandleRef jarg1, int jarg2);
+
+  [DllImport("mapscript", EntryPoint="CSharp_labelObj_insertStyle")]
+  public static extern int labelObj_insertStyle(HandleRef jarg1, HandleRef jarg2, int jarg3);
+
+  [DllImport("mapscript", EntryPoint="CSharp_labelObj_removeStyle")]
+  public static extern IntPtr labelObj_removeStyle(HandleRef jarg1, int jarg2);
+
+  [DllImport("mapscript", EntryPoint="CSharp_labelObj_moveStyleUp")]
+  public static extern int labelObj_moveStyleUp(HandleRef jarg1, int jarg2);
+
+  [DllImport("mapscript", EntryPoint="CSharp_labelObj_moveStyleDown")]
+  public static extern int labelObj_moveStyleDown(HandleRef jarg1, int jarg2);
+
   [DllImport("mapscript", EntryPoint="CSharp_new_labelObj")]
   public static extern IntPtr new_labelObj();
 
diff --git a/mapscript/csharp/mapscript_wrap.c b/mapscript/csharp/mapscript_wrap.c
index 8e1d2fd..cf78b5b 100644
--- a/mapscript/csharp/mapscript_wrap.c
+++ b/mapscript/csharp/mapscript_wrap.c
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -8,6 +8,8 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#define SWIGCSHARP
+
 /* -----------------------------------------------------------------------------
  *  This section contains generic SWIG labels for method/variable
  *  declarations/attributes, and other compiler dependent labels.
@@ -175,7 +177,7 @@ static SWIG_CSharpException_t SWIG_csharp_exceptions[] = {
 static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = {
   { SWIG_CSharpArgumentException, NULL },
   { SWIG_CSharpArgumentNullException, NULL },
-  { SWIG_CSharpArgumentOutOfRangeException, NULL },
+  { SWIG_CSharpArgumentOutOfRangeException, NULL }
 };
 
 static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) {
@@ -627,6 +629,30 @@ SWIGINTERN int labelObj_setBinding(labelObj *self,int binding,char *item){
 
     return MS_SUCCESS;
   }
+SWIGINTERN styleObj *labelObj_getStyle(labelObj *self,int i){
+      if (i >= 0 && i < self->numstyles) {
+          MS_REFCNT_INCR(self->styles[i]);
+          return self->styles[i];
+      } else {
+          msSetError(31, "Invalid index: %d", "getStyle()", i);
+          return NULL;
+      }
+  }
+SWIGINTERN int labelObj_insertStyle(labelObj *self,styleObj *style,int index){
+        return msInsertLabelStyle(self, style, index);
+    }
+SWIGINTERN styleObj *labelObj_removeStyle(labelObj *self,int index){
+	styleObj* style = (styleObj *) msRemoveLabelStyle(self, index);
+	if (style)
+		MS_REFCNT_INCR(style);
+        return style;
+    }
+SWIGINTERN int labelObj_moveStyleUp(labelObj *self,int index){
+        return msMoveLabelStyleUp(self, index);
+    }
+SWIGINTERN int labelObj_moveStyleDown(labelObj *self,int index){
+       return msMoveLabelStyleDown(self, index);
+    }
 SWIGINTERN classObj *new_classObj(layerObj *layer){
         classObj *new_class=NULL;
         
@@ -2895,8 +2921,12 @@ SWIGINTERN int symbolObj_setImagepath(symbolObj *self,char const *imagefile){
     }
 SWIGINTERN int symbolObj_setPoints(symbolObj *self,lineObj *line){
         int i;
+	self->sizex = 0;
+	self->sizey = 0;
         for (i=0; i<line->numpoints; i++) {
             MS_COPYPOINT(&(self->points[i]), &(line->point[i]));
+	    self->sizex = MS_MAX(self->sizex, self->points[i].x);
+	    self->sizey = MS_MAX(self->sizey, self->points[i].y);
         }
         self->numpoints = line->numpoints;
         return self->numpoints;
@@ -3055,7 +3085,7 @@ static char *msGetEnvURL( const char *key, void *thread_context )
 
 SWIGINTERN cgiRequestObj *new_cgiRequestObj(){
         cgiRequestObj *request;
-        
+
         request = msAllocCgiObj();
         if (!request) {
             msSetError(13, "Failed to initialize object","OWSRequest()");
@@ -3065,7 +3095,7 @@ SWIGINTERN cgiRequestObj *new_cgiRequestObj(){
         return request;
     }
 SWIGINTERN void delete_cgiRequestObj(cgiRequestObj *self){
-        free(self);
+        msFreeCgiObj(self);
     }
 SWIGINTERN int cgiRequestObj_loadParams(cgiRequestObj *self){
 	self->NumParams = loadParams( self, NULL, NULL, 0, NULL);
@@ -3163,7 +3193,7 @@ gdBuffer msIO_getStdoutBufferBytes() {
 
     gdBuf.data = buf->data;
     gdBuf.size = buf->data_offset;
-    gdBuf.owns_data = MS_FALSE;
+    gdBuf.owns_data = MS_TRUE;
 
     /* we are seizing ownership of the buffer contents */
     buf->data_offset = 0;
@@ -3251,7 +3281,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_MS_VERSION_get() {
   char * jresult ;
   char *result = 0 ;
   
-  result = (char *) "6.0.1";
+  result = (char *) "6.0.3";
   jresult = SWIG_csharp_string_callback((const char *)result); 
   return jresult;
 }
@@ -3281,7 +3311,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MS_VERSION_REV_get() {
   int jresult ;
   int result;
   
-  result = (int) 1;
+  result = (int) 3;
   jresult = result; 
   return jresult;
 }
@@ -3291,7 +3321,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MS_VERSION_NUM_get() {
   int jresult ;
   int result;
   
-  result = (int) (6*10000+0*100+1);
+  result = (int) (6*10000+0*100+3);
   jresult = result; 
   return jresult;
 }
@@ -7325,6 +7355,163 @@ SWIGEXPORT int SWIGSTDCALL CSharp_labelObj_setBinding(void * jarg1, int jarg2, c
 }
 
 
+SWIGEXPORT void * SWIGSTDCALL CSharp_labelObj_getStyle(void * jarg1, int jarg2) {
+  void * jresult ;
+  labelObj *arg1 = (labelObj *) 0 ;
+  int arg2 ;
+  styleObj *result = 0 ;
+  
+  arg1 = (labelObj *)jarg1; 
+  arg2 = (int)jarg2; 
+  {
+    errorObj *ms_error;
+    result = (styleObj *)labelObj_getStyle(arg1,arg2);
+    ms_error = msGetErrorObj();
+    if (ms_error != NULL && ms_error->code != MS_NOERR) {
+      if (ms_error->code != MS_NOTFOUND && ms_error->code != -1) {
+        char* msg = msGetErrorString(";"); 
+        if (msg) {
+          SWIG_CSharpException(SWIG_SystemError, msg);
+          free(msg);
+        }
+        else SWIG_CSharpException(SWIG_SystemError, "MapScript unknown error");
+        msResetErrorList();
+        return 0;
+      }
+      msResetErrorList();
+    }
+  }
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_labelObj_insertStyle(void * jarg1, void * jarg2, int jarg3) {
+  int jresult ;
+  labelObj *arg1 = (labelObj *) 0 ;
+  styleObj *arg2 = (styleObj *) 0 ;
+  int arg3 = (int) -1 ;
+  int result;
+  
+  arg1 = (labelObj *)jarg1; 
+  arg2 = (styleObj *)jarg2; 
+  arg3 = (int)jarg3; 
+  {
+    errorObj *ms_error;
+    result = (int)labelObj_insertStyle(arg1,arg2,arg3);
+    ms_error = msGetErrorObj();
+    if (ms_error != NULL && ms_error->code != MS_NOERR) {
+      if (ms_error->code != MS_NOTFOUND && ms_error->code != -1) {
+        char* msg = msGetErrorString(";"); 
+        if (msg) {
+          SWIG_CSharpException(SWIG_SystemError, msg);
+          free(msg);
+        }
+        else SWIG_CSharpException(SWIG_SystemError, "MapScript unknown error");
+        msResetErrorList();
+        return 0;
+      }
+      msResetErrorList();
+    }
+  }
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_labelObj_removeStyle(void * jarg1, int jarg2) {
+  void * jresult ;
+  labelObj *arg1 = (labelObj *) 0 ;
+  int arg2 ;
+  styleObj *result = 0 ;
+  
+  arg1 = (labelObj *)jarg1; 
+  arg2 = (int)jarg2; 
+  {
+    errorObj *ms_error;
+    result = (styleObj *)labelObj_removeStyle(arg1,arg2);
+    ms_error = msGetErrorObj();
+    if (ms_error != NULL && ms_error->code != MS_NOERR) {
+      if (ms_error->code != MS_NOTFOUND && ms_error->code != -1) {
+        char* msg = msGetErrorString(";"); 
+        if (msg) {
+          SWIG_CSharpException(SWIG_SystemError, msg);
+          free(msg);
+        }
+        else SWIG_CSharpException(SWIG_SystemError, "MapScript unknown error");
+        msResetErrorList();
+        return 0;
+      }
+      msResetErrorList();
+    }
+  }
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_labelObj_moveStyleUp(void * jarg1, int jarg2) {
+  int jresult ;
+  labelObj *arg1 = (labelObj *) 0 ;
+  int arg2 ;
+  int result;
+  
+  arg1 = (labelObj *)jarg1; 
+  arg2 = (int)jarg2; 
+  {
+    errorObj *ms_error;
+    result = (int)labelObj_moveStyleUp(arg1,arg2);
+    ms_error = msGetErrorObj();
+    if (ms_error != NULL && ms_error->code != MS_NOERR) {
+      if (ms_error->code != MS_NOTFOUND && ms_error->code != -1) {
+        char* msg = msGetErrorString(";"); 
+        if (msg) {
+          SWIG_CSharpException(SWIG_SystemError, msg);
+          free(msg);
+        }
+        else SWIG_CSharpException(SWIG_SystemError, "MapScript unknown error");
+        msResetErrorList();
+        return 0;
+      }
+      msResetErrorList();
+    }
+  }
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_labelObj_moveStyleDown(void * jarg1, int jarg2) {
+  int jresult ;
+  labelObj *arg1 = (labelObj *) 0 ;
+  int arg2 ;
+  int result;
+  
+  arg1 = (labelObj *)jarg1; 
+  arg2 = (int)jarg2; 
+  {
+    errorObj *ms_error;
+    result = (int)labelObj_moveStyleDown(arg1,arg2);
+    ms_error = msGetErrorObj();
+    if (ms_error != NULL && ms_error->code != MS_NOERR) {
+      if (ms_error->code != MS_NOTFOUND && ms_error->code != -1) {
+        char* msg = msGetErrorString(";"); 
+        if (msg) {
+          SWIG_CSharpException(SWIG_SystemError, msg);
+          free(msg);
+        }
+        else SWIG_CSharpException(SWIG_SystemError, "MapScript unknown error");
+        msResetErrorList();
+        return 0;
+      }
+      msResetErrorList();
+    }
+  }
+  jresult = result; 
+  return jresult;
+}
+
+
 SWIGEXPORT void * SWIGSTDCALL CSharp_new_labelObj() {
   void * jresult ;
   labelObj *result = 0 ;
@@ -22644,8 +22831,12 @@ SWIGEXPORT void SWIGSTDCALL CSharp_errorObj_routine_set(void * jarg1, char * jar
   arg1 = (errorObj *)jarg1; 
   arg2 = (char *)jarg2; 
   {
-    if (arg2) strncpy((char *)arg1->routine, (const char *)arg2, 64);
-    else arg1->routine[0] = 0;
+    if(arg2) {
+      strncpy((char*)arg1->routine, (const char *)arg2, 64-1);
+      arg1->routine[64-1] = 0;
+    } else {
+      arg1->routine[0] = 0;
+    }
   }
 }
 
@@ -22669,8 +22860,12 @@ SWIGEXPORT void SWIGSTDCALL CSharp_errorObj_message_set(void * jarg1, char * jar
   arg1 = (errorObj *)jarg1; 
   arg2 = (char *)jarg2; 
   {
-    if (arg2) strncpy((char *)arg1->message, (const char *)arg2, 2048);
-    else arg1->message[0] = 0;
+    if(arg2) {
+      strncpy((char*)arg1->message, (const char *)arg2, 2048-1);
+      arg1->message[2048-1] = 0;
+    } else {
+      arg1->message[0] = 0;
+    }
   }
 }
 
@@ -23628,6 +23823,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_msIO_stripStdoutBufferContentType() {
     }
   }
   jresult = SWIG_csharp_string_callback((const char *)result); 
+  free(result);
   return jresult;
 }
 
diff --git a/mapscript/csharp/markerCacheMemberObj.cs b/mapscript/csharp/markerCacheMemberObj.cs
index c3be1c0..54984f3 100644
--- a/mapscript/csharp/markerCacheMemberObj.cs
+++ b/mapscript/csharp/markerCacheMemberObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/outputFormatObj.cs b/mapscript/csharp/outputFormatObj.cs
index dd15845..7ff3107 100644
--- a/mapscript/csharp/outputFormatObj.cs
+++ b/mapscript/csharp/outputFormatObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/pointObj.cs b/mapscript/csharp/pointObj.cs
index e7de998..67e1937 100644
--- a/mapscript/csharp/pointObj.cs
+++ b/mapscript/csharp/pointObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/projectionObj.cs b/mapscript/csharp/projectionObj.cs
index 93dd028..2062e95 100644
--- a/mapscript/csharp/projectionObj.cs
+++ b/mapscript/csharp/projectionObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/queryMapObj.cs b/mapscript/csharp/queryMapObj.cs
index 4f50994..327091b 100644
--- a/mapscript/csharp/queryMapObj.cs
+++ b/mapscript/csharp/queryMapObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/rectObj.cs b/mapscript/csharp/rectObj.cs
index a149202..70efd76 100644
--- a/mapscript/csharp/rectObj.cs
+++ b/mapscript/csharp/rectObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/referenceMapObj.cs b/mapscript/csharp/referenceMapObj.cs
index c937161..9370639 100644
--- a/mapscript/csharp/referenceMapObj.cs
+++ b/mapscript/csharp/referenceMapObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/resultCacheObj.cs b/mapscript/csharp/resultCacheObj.cs
index 2d3ca7b..bc0b88b 100644
--- a/mapscript/csharp/resultCacheObj.cs
+++ b/mapscript/csharp/resultCacheObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/resultObj.cs b/mapscript/csharp/resultObj.cs
index 7ee4e2c..e1ebac0 100644
--- a/mapscript/csharp/resultObj.cs
+++ b/mapscript/csharp/resultObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/scalebarObj.cs b/mapscript/csharp/scalebarObj.cs
index b7601ab..60bdf63 100644
--- a/mapscript/csharp/scalebarObj.cs
+++ b/mapscript/csharp/scalebarObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/shapeObj.cs b/mapscript/csharp/shapeObj.cs
index 3f48f2d..37bac43 100644
--- a/mapscript/csharp/shapeObj.cs
+++ b/mapscript/csharp/shapeObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/shapefileObj.cs b/mapscript/csharp/shapefileObj.cs
index c2c0808..56c1d1e 100644
--- a/mapscript/csharp/shapefileObj.cs
+++ b/mapscript/csharp/shapefileObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/strokeStyleObj.cs b/mapscript/csharp/strokeStyleObj.cs
index 55dc884..2caa345 100644
--- a/mapscript/csharp/strokeStyleObj.cs
+++ b/mapscript/csharp/strokeStyleObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/styleObj.cs b/mapscript/csharp/styleObj.cs
index 2054004..f2dbcb7 100644
--- a/mapscript/csharp/styleObj.cs
+++ b/mapscript/csharp/styleObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/swig_csharp_extensions.i b/mapscript/csharp/swig_csharp_extensions.i
index 76819e6..452727a 100644
--- a/mapscript/csharp/swig_csharp_extensions.i
+++ b/mapscript/csharp/swig_csharp_extensions.i
@@ -1,6 +1,6 @@
 
 /******************************************************************************
- * $Id: swig_csharp_extensions.i 10807 2010-12-20 15:58:22Z tamas $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Fix for the SWIG Interface problems (early GC)
diff --git a/mapscript/csharp/symbolObj.cs b/mapscript/csharp/symbolObj.cs
index 24980cc..7198d9d 100644
--- a/mapscript/csharp/symbolObj.cs
+++ b/mapscript/csharp/symbolObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/symbolSetObj.cs b/mapscript/csharp/symbolSetObj.cs
index 8b1507a..993cd35 100644
--- a/mapscript/csharp/symbolSetObj.cs
+++ b/mapscript/csharp/symbolSetObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/symbolStyleObj.cs b/mapscript/csharp/symbolStyleObj.cs
index 9467489..ec5e0ab 100644
--- a/mapscript/csharp/symbolStyleObj.cs
+++ b/mapscript/csharp/symbolStyleObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/tileCacheObj.cs b/mapscript/csharp/tileCacheObj.cs
index 393c55b..f8deb5c 100644
--- a/mapscript/csharp/tileCacheObj.cs
+++ b/mapscript/csharp/tileCacheObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/csharp/webObj.cs b/mapscript/csharp/webObj.cs
index 963859a..6f027a5 100644
--- a/mapscript/csharp/webObj.cs
+++ b/mapscript/csharp/webObj.cs
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/mapscript/doc/default.css b/mapscript/doc/default.css
index 763a577..5b2e1be 100644
--- a/mapscript/doc/default.css
+++ b/mapscript/doc/default.css
@@ -1,8 +1,8 @@
 /*
 :Author: David Goodger
 :Contact: goodger at users.sourceforge.net
-:date: $Date: 2004-02-18 17:46:26 -0500 (Wed, 18 Feb 2004) $
-:version: $Revision: 2764 $
+:date: $Date$
+:version: $Revision$
 :copyright: This stylesheet has been placed in the public domain.
 
 Default cascading style sheet for the HTML output of Docutils.
diff --git a/mapscript/java/javaextend.i b/mapscript/java/javaextend.i
index 1d83d9c..c05dbc1 100644
--- a/mapscript/java/javaextend.i
+++ b/mapscript/java/javaextend.i
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: javaextend.i 4558 2005-04-21 15:09:30Z julien $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Java-specific extensions to MapScript objects
diff --git a/mapscript/java/tests/threadtest/MapTest.java b/mapscript/java/tests/threadtest/MapTest.java
index b1a6664..9dcd4b3 100644
--- a/mapscript/java/tests/threadtest/MapTest.java
+++ b/mapscript/java/tests/threadtest/MapTest.java
@@ -1,4 +1,4 @@
-// $Id: MapTest.java 5531 2006-06-28 13:46:22Z umberto $
+// $Id$
 //
 // See README_THREADTEST.TXT for usage details.
 //
diff --git a/mapscript/java/tests/threadtest/MapThread.java b/mapscript/java/tests/threadtest/MapThread.java
index 8a685a7..8ef9e88 100644
--- a/mapscript/java/tests/threadtest/MapThread.java
+++ b/mapscript/java/tests/threadtest/MapThread.java
@@ -1,4 +1,4 @@
-// $Id: MapThread.java 11750 2011-05-23 07:43:09Z unicoletti $
+// $Id$
 //
 // See README_THREADTEST.TXT for usage details.
 //
diff --git a/mapscript/java/tests/threadtest/README_THREADTEST.TXT b/mapscript/java/tests/threadtest/README_THREADTEST.TXT
index fca1263..7250dce 100644
--- a/mapscript/java/tests/threadtest/README_THREADTEST.TXT
+++ b/mapscript/java/tests/threadtest/README_THREADTEST.TXT
@@ -129,4 +129,4 @@ Jerry Pisk
 
 
 ----------
-$Id: README_THREADTEST.TXT 5531 2006-06-28 13:46:22Z umberto $
+$Id$
diff --git a/mapscript/mapscript.i b/mapscript/mapscript.i
index 87efc9b..e92481c 100644
--- a/mapscript/mapscript.i
+++ b/mapscript/mapscript.i
@@ -1,6 +1,6 @@
 /* 
 ===========================================================================
- $Id: mapscript.i 11324 2011-03-24 08:59:58Z unicoletti $
+ $Id$
  
  Project:  MapServer
  Purpose:  SWIG interface file for the MapServer mapscript module
diff --git a/mapscript/mserror.i b/mapscript/mserror.i
index e552ee3..d6065d1 100644
--- a/mapscript/mserror.i
+++ b/mapscript/mserror.i
@@ -1,6 +1,6 @@
 /* 
 ===========================================================================
- $Id: mserror.i 6016 2007-04-17 10:36:55Z umberto $
+ $Id$
  
  Project:  MapServer
  Purpose:  MapScript exceptions
diff --git a/mapscript/perl/examples/buffer.pl b/mapscript/perl/examples/buffer.pl
index 52dce84..e4c907b 100644
--- a/mapscript/perl/examples/buffer.pl
+++ b/mapscript/perl/examples/buffer.pl
@@ -5,7 +5,7 @@
 # Purpose: Applies buffer to shapefile dataset using geos support
 #          buffer units as are per units of data
 #
-# $Id: buffer.pl 5816 2006-10-30 16:28:44Z tkralidi $
+# $Id$
 #
 
 use strict;
diff --git a/mapscript/perl/examples/distanceToPoint.pl b/mapscript/perl/examples/distanceToPoint.pl
index f3e94e6..5afdbe4 100755
--- a/mapscript/perl/examples/distanceToPoint.pl
+++ b/mapscript/perl/examples/distanceToPoint.pl
@@ -4,7 +4,7 @@
 #
 # Purpose: Returns distance between a shape and a point
 #
-# $Id: distanceToPoint.pl 5820 2006-10-30 18:28:14Z tkralidi $
+# $Id$
 #
 
 use strict;
diff --git a/mapscript/perl/examples/distanceToShape.pl b/mapscript/perl/examples/distanceToShape.pl
index ce2f77a..c8b1f01 100755
--- a/mapscript/perl/examples/distanceToShape.pl
+++ b/mapscript/perl/examples/distanceToShape.pl
@@ -4,7 +4,7 @@
 #
 # Purpose: Returns distance between two shapes
 #
-# $Id: distanceToShape.pl 5819 2006-10-30 18:22:56Z tkralidi $
+# $Id$
 #
 
 use strict;
diff --git a/mapscript/perl/examples/shapeprops.pl b/mapscript/perl/examples/shapeprops.pl
index 10e433e..ef54fa0 100755
--- a/mapscript/perl/examples/shapeprops.pl
+++ b/mapscript/perl/examples/shapeprops.pl
@@ -5,7 +5,7 @@
 # Purpose: Applies area, perimeter and centroid calculations to a shapes
 #          in a shapefile (requires mapserver/mapscript to be built with GEOS)
 #
-# $Id: shapeprops.pl 5845 2006-11-14 23:16:52Z tkralidi $
+# $Id$
 #
 
 use strict;
diff --git a/mapscript/perl/examples/shpPoint2GPX.pl b/mapscript/perl/examples/shpPoint2GPX.pl
index 3ab6c8c..5a74f47 100755
--- a/mapscript/perl/examples/shpPoint2GPX.pl
+++ b/mapscript/perl/examples/shpPoint2GPX.pl
@@ -5,7 +5,7 @@
 # Purpose: Converts a Point shapefile to a GPX document
 #          as per http://www.topografix.com/gpx.asp
 #
-# $Id: shpPoint2GPX.pl 5920 2007-02-27 18:46:13Z tkralidi $
+# $Id$
 #
 
 use strict;
diff --git a/mapscript/perl/examples/shp_in_shp.pl b/mapscript/perl/examples/shp_in_shp.pl
index bec0354..b6e842a 100644
--- a/mapscript/perl/examples/shp_in_shp.pl
+++ b/mapscript/perl/examples/shp_in_shp.pl
@@ -4,7 +4,7 @@
 #
 # Purpose: Tests whether a shape is within another shape
 #
-# $Id: shp_in_shp.pl 5817 2006-10-30 17:42:52Z tkralidi $
+# $Id$
 #
 
 use strict;
diff --git a/mapscript/perl/examples/thin.pl b/mapscript/perl/examples/thin.pl
index 0ce288c..b44561c 100644
--- a/mapscript/perl/examples/thin.pl
+++ b/mapscript/perl/examples/thin.pl
@@ -5,7 +5,7 @@
 #          basically the Douglas-Peucker generalization algorithm.
 #          (http://mapserver.gis.umn.edu/community/scripts/thin.pl)
 #
-# $Id: thin.pl 5814 2006-10-30 13:44:44Z tkralidi $
+# $Id$
 #
 
 use strict;
diff --git a/mapscript/perl/mapscript.pm b/mapscript/perl/mapscript.pm
index 2fc6fa2..cdacc61 100644
--- a/mapscript/perl/mapscript.pm
+++ b/mapscript/perl/mapscript.pm
@@ -1,7 +1,8 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.36
+# Version 1.3.40
 #
-# Don't modify this file, modify the SWIG interface instead.
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
 
 package mapscript;
 use base qw(Exporter);
@@ -586,6 +587,11 @@ use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
 *removeBinding = *mapscriptc::labelObj_removeBinding;
 *getBinding = *mapscriptc::labelObj_getBinding;
 *setBinding = *mapscriptc::labelObj_setBinding;
+*getStyle = *mapscriptc::labelObj_getStyle;
+*insertStyle = *mapscriptc::labelObj_insertStyle;
+*removeStyle = *mapscriptc::labelObj_removeStyle;
+*moveStyleUp = *mapscriptc::labelObj_moveStyleUp;
+*moveStyleDown = *mapscriptc::labelObj_moveStyleDown;
 sub new {
     my $pkg = shift;
     my $self = mapscriptc::new_labelObj(@_);
@@ -2596,12 +2602,6 @@ sub new {
     bless $self, $pkg if defined($self);
 }
 
-*loadParams = *mapscriptc::OWSRequest_loadParams;
-*loadParamsFromURL = *mapscriptc::OWSRequest_loadParamsFromURL;
-*setParameter = *mapscriptc::OWSRequest_setParameter;
-*getName = *mapscriptc::OWSRequest_getName;
-*getValue = *mapscriptc::OWSRequest_getValue;
-*getValueByName = *mapscriptc::OWSRequest_getValueByName;
 sub DESTROY {
     return unless $_[0]->isa('HASH');
     my $self = tied(%{$_[0]});
@@ -2613,6 +2613,12 @@ sub DESTROY {
     }
 }
 
+*loadParams = *mapscriptc::OWSRequest_loadParams;
+*loadParamsFromURL = *mapscriptc::OWSRequest_loadParamsFromURL;
+*setParameter = *mapscriptc::OWSRequest_setParameter;
+*getName = *mapscriptc::OWSRequest_getName;
+*getValue = *mapscriptc::OWSRequest_getValue;
+*getValueByName = *mapscriptc::OWSRequest_getValueByName;
 sub DISOWN {
     my $self = shift;
     my $ptr = tied(%$self);
diff --git a/mapscript/perl/mapscript_wrap.c b/mapscript/perl/mapscript_wrap.c
index 038a849..36bf859 100644
--- a/mapscript/perl/mapscript_wrap.c
+++ b/mapscript/perl/mapscript_wrap.c
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -10,6 +10,7 @@
 
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
+
 /* -----------------------------------------------------------------------------
  *  This section contains generic SWIG labels for method/variable
  *  declarations/attributes, and other compiler dependent labels.
@@ -122,7 +123,7 @@
 /* -----------------------------------------------------------------------------
  * swigrun.swg
  *
- * This file contains generic CAPI SWIG runtime support for pointer
+ * This file contains generic C API SWIG runtime support for pointer
  * type checking.
  * ----------------------------------------------------------------------------- */
 
@@ -141,11 +142,11 @@
 
 /*
   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
   
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
 */
 
 #ifndef SWIGRUNTIME
@@ -172,14 +173,14 @@
 /* 
    Flags/methods for returning states.
    
-   The swig conversion methods, as ConvertPtr, return and integer 
+   The SWIG conversion methods, as ConvertPtr, return and integer 
    that tells if the conversion was successful or not. And if not,
    an error code can be returned (see swigerrors.swg for the codes).
    
    Use the following macros/flags to set or process the returning
    states.
    
-   In old swig versions, you usually write code as:
+   In old versions of SWIG, code such as the following was usually written:
 
      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
        // success code
@@ -187,7 +188,7 @@
        //fail code
      }
 
-   Now you can be more explicit as:
+   Now you can be more explicit:
 
     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
     if (SWIG_IsOK(res)) {
@@ -196,7 +197,7 @@
       // fail code
     }
 
-   that seems to be the same, but now you can also do
+   which is the same really, but now you can also do
 
     Type *ptr;
     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
@@ -214,7 +215,7 @@
     
    I.e., now SWIG_ConvertPtr can return new objects and you can
    identify the case and take care of the deallocation. Of course that
-   requires also to SWIG_ConvertPtr to return new result values, as
+   also requires SWIG_ConvertPtr to return new result values, such as
 
       int SWIG_ConvertPtr(obj, ptr,...) {         
         if (<obj is ok>) {			       
@@ -232,7 +233,7 @@
 
    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   swig errors code.
+   SWIG errors code.
 
    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
    allows to return the 'cast rank', for example, if you have this
@@ -246,9 +247,8 @@
       fooi(1)   // cast rank '0'
 
    just use the SWIG_AddCast()/SWIG_CheckState()
+*/
 
-
- */
 #define SWIG_OK                    (0) 
 #define SWIG_ERROR                 (-1)
 #define SWIG_IsOK(r)               (r >= 0)
@@ -273,7 +273,6 @@
 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
-
 /* Cast-Rank Mode */
 #if defined(SWIG_CASTRANK_MODE)
 #  ifndef SWIG_TypeRank
@@ -296,8 +295,6 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
 #endif
 
 
-
-
 #include <string.h>
 
 #ifdef __cplusplus
@@ -394,40 +391,58 @@ SWIG_TypeCompare(const char *nb, const char *tb) {
 }
 
 
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
 /*
   Check the typename
 */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
+/* 
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
 SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
 /*
@@ -879,6 +894,7 @@ SWIG_Perl_ErrorType(int code) {
 
 /* for raw pointers */
 #define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
 #define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
 
 /* for raw packed data */
@@ -1066,20 +1082,43 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) {
   }
 }
 
+/* Identical to SWIG_TypeCheck, except for strcmp comparison */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) 
-			    || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if ( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) ||
+            (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0)) ) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-
 /* Function for getting a pointer value */
 
 SWIGRUNTIME int
-SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
   swig_cast_info *tc;
   void *voidptr = (void *)0;
   SV *tsv = 0;
+
+  if (own)
+    *own = 0;
+
   /* If magical, apply more magic */
   if (SvGMAGICAL(sv))
     mg_get(sv);
@@ -1129,7 +1168,11 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
     {
       int newmemory = 0;
       *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
-      assert(!newmemory); /* newmemory handling not yet implemented */
+      if (newmemory == SWIG_CAST_NEW_MEMORY) {
+        assert(own);
+        if (own)
+          *own = *own | SWIG_CAST_NEW_MEMORY;
+      }
     }
   } else {
     *ptr = voidptr;
@@ -1159,9 +1202,14 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
   return SWIG_OK;
 }
 
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
+}
+
 SWIGRUNTIME void
 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
-  if (ptr && (flags & SWIG_SHADOW)) {
+  if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
     SV *self;
     SV *obj=newSV(0);
     HV *hash=newHV();
@@ -1336,6 +1384,9 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #ifdef do_close
   #undef do_close
 #endif
+#ifdef do_exec
+  #undef do_exec
+#endif
 #ifdef scalar
   #undef scalar
 #endif
@@ -1420,6 +1471,12 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #ifdef open
   #undef open
 #endif
+#ifdef readdir
+  #undef readdir
+#endif
+#ifdef bind
+  #undef bind
+#endif
 
 
 
@@ -1495,7 +1552,7 @@ static swig_module_info swig_module = {swig_types, 49, 0, 0, 0, 0};
 #define SWIG_name   "mapscriptc::boot_mapscript"
 #define SWIG_prefix "mapscriptc::"
 
-#define SWIGVERSION 0x010336 
+#define SWIGVERSION 0x010340 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -1813,6 +1870,11 @@ SWIG_pchar_descriptor(void)
 SWIGINTERN int
 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
 {
+  if (SvMAGICAL(obj)) {
+     SV *tmp = sv_newmortal();
+     SvSetSV(tmp, obj);
+     obj = tmp;
+  }
   if (SvPOK(obj)) {
     STRLEN len = 0;
     char *cstr = SvPV(obj, len); 
@@ -2135,6 +2197,30 @@ SWIGINTERN int labelObj_setBinding(labelObj *self,int binding,char *item){
 
     return MS_SUCCESS;
   }
+SWIGINTERN styleObj *labelObj_getStyle(labelObj *self,int i){
+      if (i >= 0 && i < self->numstyles) {
+          MS_REFCNT_INCR(self->styles[i]);
+          return self->styles[i];
+      } else {
+          msSetError(31, "Invalid index: %d", "getStyle()", i);
+          return NULL;
+      }
+  }
+SWIGINTERN int labelObj_insertStyle(labelObj *self,styleObj *style,int index){
+        return msInsertLabelStyle(self, style, index);
+    }
+SWIGINTERN styleObj *labelObj_removeStyle(labelObj *self,int index){
+	styleObj* style = (styleObj *) msRemoveLabelStyle(self, index);
+	if (style)
+		MS_REFCNT_INCR(style);
+        return style;
+    }
+SWIGINTERN int labelObj_moveStyleUp(labelObj *self,int index){
+        return msMoveLabelStyleUp(self, index);
+    }
+SWIGINTERN int labelObj_moveStyleDown(labelObj *self,int index){
+       return msMoveLabelStyleDown(self, index);
+    }
 SWIGINTERN classObj *new_classObj(layerObj *layer){
         classObj *new_class=NULL;
         
@@ -4444,8 +4530,12 @@ SWIGINTERN int symbolObj_setImagepath(symbolObj *self,char const *imagefile){
     }
 SWIGINTERN int symbolObj_setPoints(symbolObj *self,lineObj *line){
         int i;
+	self->sizex = 0;
+	self->sizey = 0;
         for (i=0; i<line->numpoints; i++) {
             MS_COPYPOINT(&(self->points[i]), &(line->point[i]));
+	    self->sizex = MS_MAX(self->sizex, self->points[i].x);
+	    self->sizey = MS_MAX(self->sizey, self->points[i].y);
         }
         self->numpoints = line->numpoints;
         return self->numpoints;
@@ -4602,7 +4692,7 @@ static char *msGetEnvURL( const char *key, void *thread_context )
 
 SWIGINTERN cgiRequestObj *new_cgiRequestObj(){
         cgiRequestObj *request;
-        
+
         request = msAllocCgiObj();
         if (!request) {
             msSetError(13, "Failed to initialize object","OWSRequest()");
@@ -4611,6 +4701,9 @@ SWIGINTERN cgiRequestObj *new_cgiRequestObj(){
         
         return request;
     }
+SWIGINTERN void delete_cgiRequestObj(cgiRequestObj *self){
+        msFreeCgiObj(self);
+    }
 SWIGINTERN int cgiRequestObj_loadParams(cgiRequestObj *self){
 	self->NumParams = loadParams( self, NULL, NULL, 0, NULL);
 	return self->NumParams;
@@ -4707,7 +4800,7 @@ gdBuffer msIO_getStdoutBufferBytes() {
 
     gdBuf.data = buf->data;
     gdBuf.size = buf->data_offset;
-    gdBuf.owns_data = MS_FALSE;
+    gdBuf.owns_data = MS_TRUE;
 
     /* we are seizing ownership of the buffer contents */
     buf->data_offset = 0;
@@ -4792,7 +4885,7 @@ XS(_wrap_delete_intarray) {
     }
     arg1 = (intarray *)(argp1);
     delete_intarray(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -4873,7 +4966,7 @@ XS(_wrap_intarray_setitem) {
     } 
     arg3 = (int)(val3);
     intarray_setitem(arg1,arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     
     
@@ -5062,7 +5155,7 @@ XS(_wrap_delete_fontSetObj) {
     }
     arg1 = (fontSetObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -5097,7 +5190,7 @@ XS(_wrap_clusterObj_maxdistance_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxdistance = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -5162,7 +5255,7 @@ XS(_wrap_clusterObj_buffer_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->buffer = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -5236,7 +5329,7 @@ XS(_wrap_clusterObj_region_set) {
         arg1->region = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -5486,7 +5579,7 @@ XS(_wrap_delete_clusterObj) {
     }
     arg1 = (clusterObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -5530,7 +5623,7 @@ XS(_wrap_outputFormatObj_name_set) {
         arg1->name = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -5604,7 +5697,7 @@ XS(_wrap_outputFormatObj_mimetype_set) {
         arg1->mimetype = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -5678,7 +5771,7 @@ XS(_wrap_outputFormatObj_driver_set) {
         arg1->driver = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -5752,7 +5845,7 @@ XS(_wrap_outputFormatObj_extension_set) {
         arg1->extension = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -5817,7 +5910,7 @@ XS(_wrap_outputFormatObj_renderer_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->renderer = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -5882,7 +5975,7 @@ XS(_wrap_outputFormatObj_imagemode_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->imagemode = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -5947,7 +6040,7 @@ XS(_wrap_outputFormatObj_transparent_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->transparent = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6012,7 +6105,7 @@ XS(_wrap_outputFormatObj_bands_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->bands = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6077,7 +6170,7 @@ XS(_wrap_outputFormatObj_numformatoptions_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->numformatoptions = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6142,7 +6235,7 @@ XS(_wrap_outputFormatObj_formatoptions_set) {
     }
     arg2 = (char **)(argp2);
     if (arg1) (arg1)->formatoptions = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6207,7 +6300,7 @@ XS(_wrap_outputFormatObj_refcount_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->refcount = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6272,7 +6365,7 @@ XS(_wrap_outputFormatObj_inmapfile_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->inmapfile = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6371,7 +6464,7 @@ XS(_wrap_delete_outputFormatObj) {
     }
     arg1 = (outputFormatObj *)(argp1);
     delete_outputFormatObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -6407,7 +6500,7 @@ XS(_wrap_outputFormatObj_setExtension) {
     }
     arg2 = (char *)(buf2);
     outputFormatObj_setExtension(arg1,(char const *)arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -6445,7 +6538,7 @@ XS(_wrap_outputFormatObj_setMimetype) {
     }
     arg2 = (char *)(buf2);
     outputFormatObj_setMimetype(arg1,(char const *)arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -6492,7 +6585,7 @@ XS(_wrap_outputFormatObj_setOption) {
     }
     arg3 = (char *)(buf3);
     outputFormatObj_setOption(arg1,(char const *)arg2,(char const *)arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
@@ -6610,7 +6703,7 @@ XS(_wrap_outputFormatObj_attachDevice) {
       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "outputFormatObj_attachDevice" "', argument " "2"" of type '" "void *""'"); 
     }
     outputFormatObj_attachDevice(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6647,7 +6740,7 @@ XS(_wrap_queryMapObj_height_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->height = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6712,7 +6805,7 @@ XS(_wrap_queryMapObj_width_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->width = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6777,7 +6870,7 @@ XS(_wrap_queryMapObj_status_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->status = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6842,7 +6935,7 @@ XS(_wrap_queryMapObj_style_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->style = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -6907,7 +7000,7 @@ XS(_wrap_queryMapObj_color_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->color = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -7021,7 +7114,7 @@ XS(_wrap_delete_queryMapObj) {
     }
     arg1 = (queryMapObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -7065,7 +7158,7 @@ XS(_wrap_webObj_log_set) {
         arg1->log = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -7139,7 +7232,7 @@ XS(_wrap_webObj_imagepath_set) {
         arg1->imagepath = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -7213,7 +7306,7 @@ XS(_wrap_webObj_imageurl_set) {
         arg1->imageurl = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -7287,7 +7380,7 @@ XS(_wrap_webObj_temppath_set) {
         arg1->temppath = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -7393,7 +7486,7 @@ XS(_wrap_webObj_template_set) {
         arg1->template = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -7467,7 +7560,7 @@ XS(_wrap_webObj_header_set) {
         arg1->header = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -7541,7 +7634,7 @@ XS(_wrap_webObj_footer_set) {
         arg1->footer = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -7615,7 +7708,7 @@ XS(_wrap_webObj_empty_set) {
         arg1->empty = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -7689,7 +7782,7 @@ XS(_wrap_webObj_error_set) {
         arg1->error = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -7754,7 +7847,7 @@ XS(_wrap_webObj_extent_set) {
     }
     arg2 = (rectObj *)(argp2);
     if (arg1) (arg1)->extent = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -7819,7 +7912,7 @@ XS(_wrap_webObj_minscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -7884,7 +7977,7 @@ XS(_wrap_webObj_maxscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -7958,7 +8051,7 @@ XS(_wrap_webObj_mintemplate_set) {
         arg1->mintemplate = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -8032,7 +8125,7 @@ XS(_wrap_webObj_maxtemplate_set) {
         arg1->maxtemplate = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -8106,7 +8199,7 @@ XS(_wrap_webObj_queryformat_set) {
         arg1->queryformat = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -8180,7 +8273,7 @@ XS(_wrap_webObj_legendformat_set) {
         arg1->legendformat = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -8254,7 +8347,7 @@ XS(_wrap_webObj_browseformat_set) {
         arg1->browseformat = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -8385,7 +8478,7 @@ XS(_wrap_delete_webObj) {
     }
     arg1 = (webObj *)(argp1);
     delete_webObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -8487,7 +8580,7 @@ XS(_wrap_styleObj_autoangle_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->autoangle = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -8552,7 +8645,7 @@ XS(_wrap_styleObj_color_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->color = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -8617,7 +8710,7 @@ XS(_wrap_styleObj_backgroundcolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->backgroundcolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -8682,7 +8775,7 @@ XS(_wrap_styleObj_outlinecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->outlinecolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -8747,7 +8840,7 @@ XS(_wrap_styleObj_opacity_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->opacity = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -8812,7 +8905,7 @@ XS(_wrap_styleObj_mincolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->mincolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -8877,7 +8970,7 @@ XS(_wrap_styleObj_maxcolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->maxcolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -8942,7 +9035,7 @@ XS(_wrap_styleObj_minvalue_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minvalue = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9007,7 +9100,7 @@ XS(_wrap_styleObj_maxvalue_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxvalue = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9081,7 +9174,7 @@ XS(_wrap_styleObj_rangeitem_set) {
         arg1->rangeitem = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -9146,7 +9239,7 @@ XS(_wrap_styleObj_rangeitemindex_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->rangeitemindex = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9211,7 +9304,7 @@ XS(_wrap_styleObj_symbol_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->symbol = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9285,7 +9378,7 @@ XS(_wrap_styleObj_symbolname_set) {
         arg1->symbolname = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -9350,7 +9443,7 @@ XS(_wrap_styleObj_size_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->size = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9415,7 +9508,7 @@ XS(_wrap_styleObj_minsize_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9480,7 +9573,7 @@ XS(_wrap_styleObj_maxsize_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9545,7 +9638,7 @@ XS(_wrap_styleObj_patternlength_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->patternlength = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9617,7 +9710,7 @@ XS(_wrap_styleObj_pattern_set) {
         SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""pattern""' of type '""double [MS_MAXPATTERNLENGTH]""'");
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9682,7 +9775,7 @@ XS(_wrap_styleObj_gap_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->gap = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9747,7 +9840,7 @@ XS(_wrap_styleObj_position_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->position = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9812,7 +9905,7 @@ XS(_wrap_styleObj_linecap_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->linecap = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9877,7 +9970,7 @@ XS(_wrap_styleObj_linejoin_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->linejoin = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -9942,7 +10035,7 @@ XS(_wrap_styleObj_linejoinmaxsize_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->linejoinmaxsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10007,7 +10100,7 @@ XS(_wrap_styleObj_width_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->width = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10072,7 +10165,7 @@ XS(_wrap_styleObj_outlinewidth_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->outlinewidth = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10137,7 +10230,7 @@ XS(_wrap_styleObj_minwidth_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minwidth = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10202,7 +10295,7 @@ XS(_wrap_styleObj_maxwidth_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxwidth = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10267,7 +10360,7 @@ XS(_wrap_styleObj_offsetx_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->offsetx = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10332,7 +10425,7 @@ XS(_wrap_styleObj_offsety_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->offsety = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10397,7 +10490,7 @@ XS(_wrap_styleObj_angle_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->angle = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10462,7 +10555,7 @@ XS(_wrap_styleObj_antialias_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->antialias = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10527,7 +10620,7 @@ XS(_wrap_styleObj_minscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10592,7 +10685,7 @@ XS(_wrap_styleObj_maxscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -10679,7 +10772,7 @@ XS(_wrap_delete_styleObj) {
     }
     arg1 = (styleObj *)(argp1);
     delete_styleObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -10984,7 +11077,7 @@ XS(_wrap_styleObj_setGeomTransform) {
     }
     arg2 = (char *)(buf2);
     styleObj_setGeomTransform(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -11030,7 +11123,7 @@ XS(_wrap_labelObj_font_set) {
         arg1->font = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -11095,7 +11188,7 @@ XS(_wrap_labelObj_type_set) {
     } 
     arg2 = (enum MS_FONT_TYPE)(val2);
     if (arg1) (arg1)->type = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11160,7 +11253,7 @@ XS(_wrap_labelObj_color_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->color = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11225,7 +11318,7 @@ XS(_wrap_labelObj_outlinecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->outlinecolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11290,7 +11383,7 @@ XS(_wrap_labelObj_outlinewidth_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->outlinewidth = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11355,7 +11448,7 @@ XS(_wrap_labelObj_shadowcolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->shadowcolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11420,7 +11513,7 @@ XS(_wrap_labelObj_shadowsizex_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->shadowsizex = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11485,7 +11578,7 @@ XS(_wrap_labelObj_shadowsizey_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->shadowsizey = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11550,7 +11643,7 @@ XS(_wrap_labelObj_size_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->size = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11615,7 +11708,7 @@ XS(_wrap_labelObj_minsize_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11680,7 +11773,7 @@ XS(_wrap_labelObj_maxsize_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11745,7 +11838,7 @@ XS(_wrap_labelObj_position_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->position = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11810,7 +11903,7 @@ XS(_wrap_labelObj_offsetx_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->offsetx = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11875,7 +11968,7 @@ XS(_wrap_labelObj_offsety_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->offsety = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -11940,7 +12033,7 @@ XS(_wrap_labelObj_angle_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->angle = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12005,7 +12098,7 @@ XS(_wrap_labelObj_anglemode_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->anglemode = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12070,7 +12163,7 @@ XS(_wrap_labelObj_buffer_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->buffer = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12135,7 +12228,7 @@ XS(_wrap_labelObj_antialias_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->antialias = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12200,7 +12293,7 @@ XS(_wrap_labelObj_align_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->align = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12265,7 +12358,7 @@ XS(_wrap_labelObj_wrap_set) {
     } 
     arg2 = (char)(val2);
     if (arg1) (arg1)->wrap = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12330,7 +12423,7 @@ XS(_wrap_labelObj_maxlength_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->maxlength = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12395,7 +12488,7 @@ XS(_wrap_labelObj_minlength_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->minlength = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12460,7 +12553,7 @@ XS(_wrap_labelObj_space_size_10_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->space_size_10 = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12525,7 +12618,7 @@ XS(_wrap_labelObj_minfeaturesize_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->minfeaturesize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12590,7 +12683,7 @@ XS(_wrap_labelObj_autominfeaturesize_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->autominfeaturesize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12655,7 +12748,7 @@ XS(_wrap_labelObj_minscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12720,7 +12813,7 @@ XS(_wrap_labelObj_maxscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12785,7 +12878,7 @@ XS(_wrap_labelObj_mindistance_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->mindistance = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12850,7 +12943,7 @@ XS(_wrap_labelObj_repeatdistance_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->repeatdistance = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12915,7 +13008,7 @@ XS(_wrap_labelObj_maxoverlapangle_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxoverlapangle = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -12980,7 +13073,7 @@ XS(_wrap_labelObj_partials_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->partials = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -13045,7 +13138,7 @@ XS(_wrap_labelObj_force_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->force = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -13119,7 +13212,7 @@ XS(_wrap_labelObj_encoding_set) {
         arg1->encoding = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -13184,7 +13277,7 @@ XS(_wrap_labelObj_priority_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->priority = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -13249,7 +13342,7 @@ XS(_wrap_labelObj_numstyles_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->numstyles = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -13453,6 +13546,208 @@ XS(_wrap_labelObj_setBinding) {
 }
 
 
+XS(_wrap_labelObj_getStyle) {
+  {
+    labelObj *arg1 = (labelObj *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int val2 ;
+    int ecode2 = 0 ;
+    int argvi = 0;
+    styleObj *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: labelObj_getStyle(self,i);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_getStyle" "', argument " "1"" of type '" "labelObj *""'"); 
+    }
+    arg1 = (labelObj *)(argp1);
+    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+    if (!SWIG_IsOK(ecode2)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "labelObj_getStyle" "', argument " "2"" of type '" "int""'");
+    } 
+    arg2 = (int)(val2);
+    result = (styleObj *)labelObj_getStyle(arg1,arg2);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_styleObj, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_labelObj_insertStyle) {
+  {
+    labelObj *arg1 = (labelObj *) 0 ;
+    styleObj *arg2 = (styleObj *) 0 ;
+    int arg3 = (int) -1 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 = 0 ;
+    int res2 = 0 ;
+    int val3 ;
+    int ecode3 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 3)) {
+      SWIG_croak("Usage: labelObj_insertStyle(self,style,index);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_insertStyle" "', argument " "1"" of type '" "labelObj *""'"); 
+    }
+    arg1 = (labelObj *)(argp1);
+    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_styleObj, 0 |  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "labelObj_insertStyle" "', argument " "2"" of type '" "styleObj *""'"); 
+    }
+    arg2 = (styleObj *)(argp2);
+    if (items > 2) {
+      ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
+      if (!SWIG_IsOK(ecode3)) {
+        SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "labelObj_insertStyle" "', argument " "3"" of type '" "int""'");
+      } 
+      arg3 = (int)(val3);
+    }
+    result = (int)labelObj_insertStyle(arg1,arg2,arg3);
+    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_labelObj_removeStyle) {
+  {
+    labelObj *arg1 = (labelObj *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int val2 ;
+    int ecode2 = 0 ;
+    int argvi = 0;
+    styleObj *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: labelObj_removeStyle(self,index);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_removeStyle" "', argument " "1"" of type '" "labelObj *""'"); 
+    }
+    arg1 = (labelObj *)(argp1);
+    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+    if (!SWIG_IsOK(ecode2)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "labelObj_removeStyle" "', argument " "2"" of type '" "int""'");
+    } 
+    arg2 = (int)(val2);
+    result = (styleObj *)labelObj_removeStyle(arg1,arg2);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_styleObj, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_labelObj_moveStyleUp) {
+  {
+    labelObj *arg1 = (labelObj *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int val2 ;
+    int ecode2 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: labelObj_moveStyleUp(self,index);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_moveStyleUp" "', argument " "1"" of type '" "labelObj *""'"); 
+    }
+    arg1 = (labelObj *)(argp1);
+    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+    if (!SWIG_IsOK(ecode2)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "labelObj_moveStyleUp" "', argument " "2"" of type '" "int""'");
+    } 
+    arg2 = (int)(val2);
+    result = (int)labelObj_moveStyleUp(arg1,arg2);
+    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_labelObj_moveStyleDown) {
+  {
+    labelObj *arg1 = (labelObj *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int val2 ;
+    int ecode2 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: labelObj_moveStyleDown(self,index);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_moveStyleDown" "', argument " "1"" of type '" "labelObj *""'"); 
+    }
+    arg1 = (labelObj *)(argp1);
+    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+    if (!SWIG_IsOK(ecode2)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "labelObj_moveStyleDown" "', argument " "2"" of type '" "int""'");
+    } 
+    arg2 = (int)(val2);
+    result = (int)labelObj_moveStyleDown(arg1,arg2);
+    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_new_labelObj) {
   {
     int argvi = 0;
@@ -13488,7 +13783,7 @@ XS(_wrap_delete_labelObj) {
     }
     arg1 = (labelObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -13523,7 +13818,7 @@ XS(_wrap_classObj_status_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->status = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -13588,7 +13883,7 @@ XS(_wrap_classObj_numstyles_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->numstyles = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -13690,7 +13985,7 @@ XS(_wrap_classObj_name_set) {
         arg1->name = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -13764,7 +14059,7 @@ XS(_wrap_classObj_title_set) {
         arg1->title = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -13838,7 +14133,7 @@ XS(_wrap_classObj_template_set) {
         arg1->template = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -13903,7 +14198,7 @@ XS(_wrap_classObj_type_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->type = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -14024,7 +14319,7 @@ XS(_wrap_classObj_minscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -14089,7 +14384,7 @@ XS(_wrap_classObj_maxscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -14154,7 +14449,7 @@ XS(_wrap_classObj_minfeaturesize_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->minfeaturesize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -14279,7 +14574,7 @@ XS(_wrap_classObj_debug_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->debug = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -14353,7 +14648,7 @@ XS(_wrap_classObj_keyimage_set) {
         arg1->keyimage = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -14427,7 +14722,7 @@ XS(_wrap_classObj_group_set) {
         arg1->group = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -14514,7 +14809,7 @@ XS(_wrap_delete_classObj) {
     }
     arg1 = (classObj *)(argp1);
     delete_classObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -15678,7 +15973,7 @@ XS(_wrap_delete_labelCacheMemberObj) {
     }
     arg1 = (labelCacheMemberObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -15779,7 +16074,7 @@ XS(_wrap_delete_markerCacheMemberObj) {
     }
     arg1 = (markerCacheMemberObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -15992,7 +16287,7 @@ XS(_wrap_delete_labelCacheSlotObj) {
     }
     arg1 = (labelCacheSlotObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -16075,7 +16370,7 @@ XS(_wrap_labelCacheObj_freeCache) {
     }
     arg1 = (labelCacheObj *)(argp1);
     labelCacheObj_freeCache(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -16120,7 +16415,7 @@ XS(_wrap_delete_labelCacheObj) {
     }
     arg1 = (labelCacheObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -16287,7 +16582,7 @@ XS(_wrap_delete_resultObj) {
     }
     arg1 = (resultObj *)(argp1);
     delete_resultObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -16378,7 +16673,7 @@ XS(_wrap_resultCacheObj_usegetshape_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->usegetshape = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -16491,7 +16786,7 @@ XS(_wrap_delete_resultCacheObj) {
     }
     arg1 = (resultCacheObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -16535,7 +16830,7 @@ XS(_wrap_symbolSetObj_filename_set) {
         arg1->filename = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -16600,7 +16895,7 @@ XS(_wrap_symbolSetObj_imagecachesize_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->imagecachesize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -16744,7 +17039,7 @@ XS(_wrap_delete_symbolSetObj) {
     }
     arg1 = (symbolSetObj *)(argp1);
     delete_symbolSetObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -17010,7 +17305,7 @@ XS(_wrap_referenceMapObj_extent_set) {
     }
     arg2 = (rectObj *)(argp2);
     if (arg1) (arg1)->extent = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17075,7 +17370,7 @@ XS(_wrap_referenceMapObj_height_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->height = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17140,7 +17435,7 @@ XS(_wrap_referenceMapObj_width_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->width = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17205,7 +17500,7 @@ XS(_wrap_referenceMapObj_color_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->color = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17270,7 +17565,7 @@ XS(_wrap_referenceMapObj_outlinecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->outlinecolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17344,7 +17639,7 @@ XS(_wrap_referenceMapObj_image_set) {
         arg1->image = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -17409,7 +17704,7 @@ XS(_wrap_referenceMapObj_status_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->status = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17474,7 +17769,7 @@ XS(_wrap_referenceMapObj_marker_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->marker = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17548,7 +17843,7 @@ XS(_wrap_referenceMapObj_markername_set) {
         arg1->markername = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -17613,7 +17908,7 @@ XS(_wrap_referenceMapObj_markersize_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->markersize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17678,7 +17973,7 @@ XS(_wrap_referenceMapObj_minboxsize_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->minboxsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17743,7 +18038,7 @@ XS(_wrap_referenceMapObj_maxboxsize_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->maxboxsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17889,7 +18184,7 @@ XS(_wrap_delete_referenceMapObj) {
     }
     arg1 = (referenceMapObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -17924,7 +18219,7 @@ XS(_wrap_scalebarObj_imagecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->imagecolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -17989,7 +18284,7 @@ XS(_wrap_scalebarObj_height_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->height = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18054,7 +18349,7 @@ XS(_wrap_scalebarObj_width_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->width = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18119,7 +18414,7 @@ XS(_wrap_scalebarObj_style_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->style = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18184,7 +18479,7 @@ XS(_wrap_scalebarObj_intervals_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->intervals = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18249,7 +18544,7 @@ XS(_wrap_scalebarObj_label_set) {
     }
     arg2 = (labelObj *)(argp2);
     if (arg1) (arg1)->label = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18314,7 +18609,7 @@ XS(_wrap_scalebarObj_color_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->color = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18379,7 +18674,7 @@ XS(_wrap_scalebarObj_backgroundcolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->backgroundcolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18444,7 +18739,7 @@ XS(_wrap_scalebarObj_outlinecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->outlinecolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18509,7 +18804,7 @@ XS(_wrap_scalebarObj_units_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->units = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18574,7 +18869,7 @@ XS(_wrap_scalebarObj_status_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->status = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18639,7 +18934,7 @@ XS(_wrap_scalebarObj_position_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->position = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18704,7 +18999,7 @@ XS(_wrap_scalebarObj_postlabelcache_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->postlabelcache = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18769,7 +19064,7 @@ XS(_wrap_scalebarObj_align_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->align = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -18883,7 +19178,7 @@ XS(_wrap_delete_scalebarObj) {
     }
     arg1 = (scalebarObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -18918,7 +19213,7 @@ XS(_wrap_legendObj_imagecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->imagecolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19011,7 +19306,7 @@ XS(_wrap_legendObj_keysizex_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->keysizex = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19076,7 +19371,7 @@ XS(_wrap_legendObj_keysizey_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->keysizey = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19141,7 +19436,7 @@ XS(_wrap_legendObj_keyspacingx_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->keyspacingx = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19206,7 +19501,7 @@ XS(_wrap_legendObj_keyspacingy_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->keyspacingy = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19271,7 +19566,7 @@ XS(_wrap_legendObj_outlinecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->outlinecolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19336,7 +19631,7 @@ XS(_wrap_legendObj_status_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->status = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19401,7 +19696,7 @@ XS(_wrap_legendObj_height_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->height = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19466,7 +19761,7 @@ XS(_wrap_legendObj_width_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->width = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19531,7 +19826,7 @@ XS(_wrap_legendObj_position_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->position = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19596,7 +19891,7 @@ XS(_wrap_legendObj_postlabelcache_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->postlabelcache = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -19670,7 +19965,7 @@ XS(_wrap_legendObj_template_set) {
         arg1->template = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -19816,7 +20111,7 @@ XS(_wrap_delete_legendObj) {
     }
     arg1 = (legendObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -19860,7 +20155,7 @@ XS(_wrap_layerObj_classitem_set) {
         arg1->classitem = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -20078,7 +20373,7 @@ XS(_wrap_layerObj_header_set) {
         arg1->header = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -20152,7 +20447,7 @@ XS(_wrap_layerObj_footer_set) {
         arg1->footer = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -20226,7 +20521,7 @@ XS(_wrap_layerObj_template_set) {
         arg1->template = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -20300,7 +20595,7 @@ XS(_wrap_layerObj_name_set) {
         arg1->name = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -20374,7 +20669,7 @@ XS(_wrap_layerObj_group_set) {
         arg1->group = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -20439,7 +20734,7 @@ XS(_wrap_layerObj_status_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->status = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -20513,7 +20808,7 @@ XS(_wrap_layerObj_data_set) {
         arg1->data = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -20578,7 +20873,7 @@ XS(_wrap_layerObj_type_set) {
     } 
     arg2 = (enum MS_LAYER_TYPE)(val2);
     if (arg1) (arg1)->type = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -20643,7 +20938,7 @@ XS(_wrap_layerObj_tolerance_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->tolerance = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -20708,7 +21003,7 @@ XS(_wrap_layerObj_toleranceunits_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->toleranceunits = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -20773,7 +21068,7 @@ XS(_wrap_layerObj_symbolscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->symbolscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -20838,7 +21133,7 @@ XS(_wrap_layerObj_minscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -20903,7 +21198,7 @@ XS(_wrap_layerObj_maxscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -20968,7 +21263,7 @@ XS(_wrap_layerObj_minfeaturesize_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->minfeaturesize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21033,7 +21328,7 @@ XS(_wrap_layerObj_labelminscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->labelminscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21098,7 +21393,7 @@ XS(_wrap_layerObj_labelmaxscaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->labelmaxscaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21163,7 +21458,7 @@ XS(_wrap_layerObj_mingeowidth_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->mingeowidth = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21228,7 +21523,7 @@ XS(_wrap_layerObj_maxgeowidth_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxgeowidth = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21293,7 +21588,7 @@ XS(_wrap_layerObj_sizeunits_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->sizeunits = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21358,7 +21653,7 @@ XS(_wrap_layerObj_maxfeatures_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->maxfeatures = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21423,7 +21718,7 @@ XS(_wrap_layerObj_startindex_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->startindex = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21488,7 +21783,7 @@ XS(_wrap_layerObj_offsite_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->offsite = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21553,7 +21848,7 @@ XS(_wrap_layerObj_transform_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->transform = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21618,7 +21913,7 @@ XS(_wrap_layerObj_labelcache_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->labelcache = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21683,7 +21978,7 @@ XS(_wrap_layerObj_postlabelcache_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->postlabelcache = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -21757,7 +22052,7 @@ XS(_wrap_layerObj_labelitem_set) {
         arg1->labelitem = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -21831,7 +22126,7 @@ XS(_wrap_layerObj_tileitem_set) {
         arg1->tileitem = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -21905,7 +22200,7 @@ XS(_wrap_layerObj_tileindex_set) {
         arg1->tileindex = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -21970,7 +22265,7 @@ XS(_wrap_layerObj_units_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->units = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -22044,7 +22339,7 @@ XS(_wrap_layerObj_connection_set) {
         arg1->connection = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -22118,7 +22413,7 @@ XS(_wrap_layerObj_plugin_library_set) {
         arg1->plugin_library = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -22192,7 +22487,7 @@ XS(_wrap_layerObj_plugin_library_original_set) {
         arg1->plugin_library_original = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -22257,7 +22552,7 @@ XS(_wrap_layerObj_connectiontype_set) {
     } 
     arg2 = (enum MS_CONNECTION_TYPE)(val2);
     if (arg1) (arg1)->connectiontype = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -22359,7 +22654,7 @@ XS(_wrap_layerObj_bandsitem_set) {
         arg1->bandsitem = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -22433,7 +22728,7 @@ XS(_wrap_layerObj_filteritem_set) {
         arg1->filteritem = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -22507,7 +22802,7 @@ XS(_wrap_layerObj_styleitem_set) {
         arg1->styleitem = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -22581,7 +22876,7 @@ XS(_wrap_layerObj_requires_set) {
         arg1->requires = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -22655,7 +22950,7 @@ XS(_wrap_layerObj_labelrequires_set) {
         arg1->labelrequires = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -22832,7 +23127,7 @@ XS(_wrap_layerObj_opacity_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->opacity = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -22897,7 +23192,7 @@ XS(_wrap_layerObj_dump_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->dump = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -22962,7 +23257,7 @@ XS(_wrap_layerObj_debug_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->debug = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -23120,7 +23415,7 @@ XS(_wrap_layerObj_classgroup_set) {
         arg1->classgroup = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -23207,7 +23502,7 @@ XS(_wrap_delete_layerObj) {
     }
     arg1 = (layerObj *)(argp1);
     delete_layerObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -23487,7 +23782,7 @@ XS(_wrap_layerObj_close) {
     }
     arg1 = (layerObj *)(argp1);
     layerObj_close(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -25161,7 +25456,7 @@ XS(_wrap_layerObj_setProcessingKey) {
     }
     arg3 = (char *)(buf3);
     layerObj_setProcessingKey(arg1,(char const *)arg2,(char const *)arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
@@ -25201,7 +25496,7 @@ XS(_wrap_layerObj_setProcessing) {
     }
     arg2 = (char *)(buf2);
     layerObj_setProcessing(arg1,(char const *)arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -25239,7 +25534,7 @@ XS(_wrap_layerObj_addProcessing) {
     }
     arg2 = (char *)(buf2);
     layerObj_addProcessing(arg1,(char const *)arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -25511,7 +25806,7 @@ XS(_wrap_mapObj_name_set) {
         arg1->name = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -25576,7 +25871,7 @@ XS(_wrap_mapObj_status_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->status = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -25641,7 +25936,7 @@ XS(_wrap_mapObj_height_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->height = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -25706,7 +26001,7 @@ XS(_wrap_mapObj_width_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->width = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -25771,7 +26066,7 @@ XS(_wrap_mapObj_maxsize_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->maxsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26004,7 +26299,7 @@ XS(_wrap_mapObj_transparent_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->transparent = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26069,7 +26364,7 @@ XS(_wrap_mapObj_interlace_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->interlace = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26134,7 +26429,7 @@ XS(_wrap_mapObj_imagequality_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->imagequality = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26199,7 +26494,7 @@ XS(_wrap_mapObj_extent_set) {
     }
     arg2 = (rectObj *)(argp2);
     if (arg1) (arg1)->extent = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26264,7 +26559,7 @@ XS(_wrap_mapObj_cellsize_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->cellsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26329,7 +26624,7 @@ XS(_wrap_mapObj_units_set) {
     } 
     arg2 = (enum MS_UNITS)(val2);
     if (arg1) (arg1)->units = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26394,7 +26689,7 @@ XS(_wrap_mapObj_scaledenom_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->scaledenom = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26459,7 +26754,7 @@ XS(_wrap_mapObj_resolution_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->resolution = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26524,7 +26819,7 @@ XS(_wrap_mapObj_defresolution_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->defresolution = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -26598,7 +26893,7 @@ XS(_wrap_mapObj_shapepath_set) {
         arg1->shapepath = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -26672,7 +26967,7 @@ XS(_wrap_mapObj_mappath_set) {
         arg1->mappath = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -26737,7 +27032,7 @@ XS(_wrap_mapObj_imagecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->imagecolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -27054,7 +27349,7 @@ XS(_wrap_mapObj_layerorder_set) {
     }
     arg2 = (int *)(argp2);
     if (arg1) (arg1)->layerorder = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -27119,7 +27414,7 @@ XS(_wrap_mapObj_debug_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->debug = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -27193,7 +27488,7 @@ XS(_wrap_mapObj_datapattern_set) {
         arg1->datapattern = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -27267,7 +27562,7 @@ XS(_wrap_mapObj_templatepattern_set) {
         arg1->templatepattern = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -27383,7 +27678,7 @@ XS(_wrap_delete_mapObj) {
     }
     arg1 = (mapObj *)(argp1);
     delete_mapObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -27940,7 +28235,7 @@ XS(_wrap_mapObj_prepareQuery) {
     }
     arg1 = (mapObj *)(argp1);
     mapObj_prepareQuery(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -28004,7 +28299,7 @@ XS(_wrap_mapObj_setImageType) {
     }
     arg2 = (char *)(buf2);
     mapObj_setImageType(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -28042,7 +28337,7 @@ XS(_wrap_mapObj_selectOutputFormat) {
     }
     arg2 = (char *)(buf2);
     mapObj_selectOutputFormat(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -28079,7 +28374,7 @@ XS(_wrap_mapObj_setOutputFormat) {
     }
     arg2 = (outputFormatObj *)(argp2);
     mapObj_setOutputFormat(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -28889,7 +29184,7 @@ XS(_wrap_mapObj_freeQuery) {
       arg2 = (int)(val2);
     }
     mapObj_freeQuery(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -29521,7 +29816,7 @@ XS(_wrap_mapObj_setConfigOption) {
     }
     arg3 = (char *)(buf3);
     mapObj_setConfigOption(arg1,arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
@@ -29591,7 +29886,7 @@ XS(_wrap_mapObj_applyConfigOptions) {
     }
     arg1 = (mapObj *)(argp1);
     mapObj_applyConfigOptions(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -30654,7 +30949,7 @@ XS(_wrap_delete_imageObj) {
     }
     arg1 = (imageObj *)(argp1);
     delete_imageObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -30700,7 +30995,7 @@ XS(_wrap_imageObj_save) {
       arg3 = (mapObj *)(argp3);
     }
     imageObj_save(arg1,arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     
@@ -30884,7 +31179,7 @@ XS(_wrap_msFreeImage) {
     }
     arg1 = (imageObj *)(argp1);
     msFreeImage(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -30921,7 +31216,7 @@ XS(_wrap_msCleanup) {
       SWIG_croak("Usage: msCleanup();");
     }
     msCleanup();
-    
+    ST(argvi) = sv_newmortal();
     XSRETURN(argvi);
   fail:
     SWIG_croak_null();
@@ -30994,7 +31289,7 @@ XS(_wrap_strokeStyleObj_width_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->width = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31059,7 +31354,7 @@ XS(_wrap_strokeStyleObj_patternlength_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->patternlength = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31131,7 +31426,7 @@ XS(_wrap_strokeStyleObj_pattern_set) {
         SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""pattern""' of type '""double [MS_MAXPATTERNLENGTH]""'");
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31196,7 +31491,7 @@ XS(_wrap_strokeStyleObj_color_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->color = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31261,7 +31556,7 @@ XS(_wrap_strokeStyleObj_linecap_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->linecap = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31326,7 +31621,7 @@ XS(_wrap_strokeStyleObj_linejoin_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->linejoin = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31391,7 +31686,7 @@ XS(_wrap_strokeStyleObj_linejoinmaxsize_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->linejoinmaxsize = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31466,7 +31761,7 @@ XS(_wrap_delete_strokeStyleObj) {
     }
     arg1 = (strokeStyleObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -31501,7 +31796,7 @@ XS(_wrap_symbolStyleObj_color_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->color = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31566,7 +31861,7 @@ XS(_wrap_symbolStyleObj_backgroundcolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->backgroundcolor = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31631,7 +31926,7 @@ XS(_wrap_symbolStyleObj_outlinewidth_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->outlinewidth = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31696,7 +31991,7 @@ XS(_wrap_symbolStyleObj_outlinecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->outlinecolor = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31761,7 +32056,7 @@ XS(_wrap_symbolStyleObj_scale_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->scale = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31826,7 +32121,7 @@ XS(_wrap_symbolStyleObj_rotation_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->rotation = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31891,7 +32186,7 @@ XS(_wrap_symbolStyleObj_gap_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->gap = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -31956,7 +32251,7 @@ XS(_wrap_symbolStyleObj_style_set) {
     }
     arg2 = (styleObj *)(argp2);
     if (arg1) (arg1)->style = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32031,7 +32326,7 @@ XS(_wrap_delete_symbolStyleObj) {
     }
     arg1 = (symbolStyleObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -32066,7 +32361,7 @@ XS(_wrap_tileCacheObj_symbol_set) {
     }
     arg2 = (symbolObj *)(argp2);
     if (arg1) (arg1)->symbol = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32131,7 +32426,7 @@ XS(_wrap_tileCacheObj_width_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->width = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32196,7 +32491,7 @@ XS(_wrap_tileCacheObj_height_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->height = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32261,7 +32556,7 @@ XS(_wrap_tileCacheObj_color_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->color = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32326,7 +32621,7 @@ XS(_wrap_tileCacheObj_outlinecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->outlinecolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32391,7 +32686,7 @@ XS(_wrap_tileCacheObj_backgroundcolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->backgroundcolor = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32456,7 +32751,7 @@ XS(_wrap_tileCacheObj_outlinewidth_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->outlinewidth = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32521,7 +32816,7 @@ XS(_wrap_tileCacheObj_rotation_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->rotation = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32586,7 +32881,7 @@ XS(_wrap_tileCacheObj_scale_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->scale = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32651,7 +32946,7 @@ XS(_wrap_tileCacheObj_image_set) {
     }
     arg2 = (imageObj *)(argp2);
     if (arg1) (arg1)->image = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32716,7 +33011,7 @@ XS(_wrap_tileCacheObj_next_set) {
     }
     arg2 = (tileCacheObj *)(argp2);
     if (arg1) (arg1)->next = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32791,7 +33086,7 @@ XS(_wrap_delete_tileCacheObj) {
     }
     arg1 = (struct tileCacheObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -32835,7 +33130,7 @@ XS(_wrap_labelStyleObj_font_set) {
         arg1->font = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -32900,7 +33195,7 @@ XS(_wrap_labelStyleObj_size_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->size = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -32965,7 +33260,7 @@ XS(_wrap_labelStyleObj_rotation_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->rotation = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -33030,7 +33325,7 @@ XS(_wrap_labelStyleObj_color_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->color = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -33095,7 +33390,7 @@ XS(_wrap_labelStyleObj_outlinewidth_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->outlinewidth = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -33160,7 +33455,7 @@ XS(_wrap_labelStyleObj_outlinecolor_set) {
     }
     arg2 = (colorObj *)(argp2);
     if (arg1) (arg1)->outlinecolor = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -33235,7 +33530,7 @@ XS(_wrap_delete_labelStyleObj) {
     }
     arg1 = (labelStyleObj *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -33270,7 +33565,7 @@ XS(_wrap_rectObj_minx_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minx = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -33335,7 +33630,7 @@ XS(_wrap_rectObj_miny_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->miny = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -33400,7 +33695,7 @@ XS(_wrap_rectObj_maxx_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxx = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -33465,7 +33760,7 @@ XS(_wrap_rectObj_maxy_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxy = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -33600,7 +33895,7 @@ XS(_wrap_delete_rectObj) {
     }
     arg1 = (rectObj *)(argp1);
     delete_rectObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -33895,7 +34190,7 @@ XS(_wrap_pointObj_x_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->x = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -33960,7 +34255,7 @@ XS(_wrap_pointObj_y_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->y = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -34083,7 +34378,7 @@ XS(_wrap_delete_pointObj) {
     }
     arg1 = (pointObj *)(argp1);
     delete_pointObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -34662,7 +34957,7 @@ XS(_wrap_delete_lineObj) {
     }
     arg1 = (lineObj *)(argp1);
     delete_lineObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -34925,7 +35220,7 @@ XS(_wrap_shapeObj_bounds_set) {
     }
     arg2 = (rectObj *)(argp2);
     if (arg1) (arg1)->bounds = *arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -34990,7 +35285,7 @@ XS(_wrap_shapeObj_type_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->type = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -35055,7 +35350,7 @@ XS(_wrap_shapeObj_index_set) {
     } 
     arg2 = (long)(val2);
     if (arg1) (arg1)->index = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -35120,7 +35415,7 @@ XS(_wrap_shapeObj_tileindex_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->tileindex = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -35185,7 +35480,7 @@ XS(_wrap_shapeObj_classindex_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->classindex = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -35259,7 +35554,7 @@ XS(_wrap_shapeObj_text_set) {
         arg1->text = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -35324,7 +35619,7 @@ XS(_wrap_shapeObj_scratch_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->scratch = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -35389,7 +35684,7 @@ XS(_wrap_shapeObj_resultindex_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->resultindex = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -35476,7 +35771,7 @@ XS(_wrap_delete_shapeObj) {
     }
     arg1 = (shapeObj *)(argp1);
     delete_shapeObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -35714,7 +36009,7 @@ XS(_wrap_shapeObj_setBounds) {
     }
     arg1 = (shapeObj *)(argp1);
     shapeObj_setBounds(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -36863,7 +37158,7 @@ XS(_wrap_shapeObj_initValues) {
     } 
     arg2 = (int)(val2);
     shapeObj_initValues(arg1,arg2);
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -37538,7 +37833,7 @@ XS(_wrap_delete_DBFInfo) {
     }
     arg1 = (DBFInfo *)(argp1);
     free((char *) arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -37836,7 +38131,7 @@ XS(_wrap_delete_shapefileObj) {
     }
     arg1 = (shapefileObj *)(argp1);
     delete_shapefileObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -38071,7 +38366,7 @@ XS(_wrap_shapefileObj_getExtent) {
     }
     arg3 = (rectObj *)(argp3);
     shapefileObj_getExtent(arg1,arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     
     
@@ -38291,7 +38586,7 @@ XS(_wrap_delete_projectionObj) {
     }
     arg1 = (projectionObj *)(argp1);
     delete_projectionObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -38393,7 +38688,7 @@ XS(_wrap_colorObj_pen_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->pen = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -38458,7 +38753,7 @@ XS(_wrap_colorObj_red_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->red = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -38523,7 +38818,7 @@ XS(_wrap_colorObj_green_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->green = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -38588,7 +38883,7 @@ XS(_wrap_colorObj_blue_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->blue = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -38653,7 +38948,7 @@ XS(_wrap_colorObj_alpha_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->alpha = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -38776,7 +39071,7 @@ XS(_wrap_delete_colorObj) {
     }
     arg1 = (colorObj *)(argp1);
     delete_colorObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -38946,7 +39241,7 @@ XS(_wrap_symbolObj_name_set) {
         arg1->name = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -39011,7 +39306,7 @@ XS(_wrap_symbolObj_type_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->type = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39076,7 +39371,7 @@ XS(_wrap_symbolObj_inmapfile_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->inmapfile = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39141,7 +39436,7 @@ XS(_wrap_symbolObj_sizex_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->sizex = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39206,7 +39501,7 @@ XS(_wrap_symbolObj_sizey_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->sizey = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39271,7 +39566,7 @@ XS(_wrap_symbolObj_minx_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->minx = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39336,7 +39631,7 @@ XS(_wrap_symbolObj_miny_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->miny = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39401,7 +39696,7 @@ XS(_wrap_symbolObj_maxx_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxx = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39466,7 +39761,7 @@ XS(_wrap_symbolObj_maxy_set) {
     } 
     arg2 = (double)(val2);
     if (arg1) (arg1)->maxy = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39587,7 +39882,7 @@ XS(_wrap_symbolObj_filled_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->filled = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39680,7 +39975,7 @@ XS(_wrap_symbolObj_transparent_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->transparent = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39745,7 +40040,7 @@ XS(_wrap_symbolObj_transparentcolor_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->transparentcolor = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39819,7 +40114,7 @@ XS(_wrap_symbolObj_character_set) {
         arg1->character = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -39884,7 +40179,7 @@ XS(_wrap_symbolObj_antialias_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->antialias = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -39958,7 +40253,7 @@ XS(_wrap_symbolObj_font_set) {
         arg1->font = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -40032,7 +40327,7 @@ XS(_wrap_symbolObj_svg_text_set) {
         arg1->svg_text = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -40131,7 +40426,7 @@ XS(_wrap_delete_symbolObj) {
     }
     arg1 = (symbolObj *)(argp1);
     delete_symbolObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -40347,7 +40642,7 @@ XS(_wrap_errorObj_code_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->code = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -40413,7 +40708,7 @@ XS(_wrap_errorObj_routine_set) {
     arg2 = (char *)(temp2);
     if (arg2) memcpy(arg1->routine,arg2,64*sizeof(char));
     else memset(arg1->routine,0,64*sizeof(char));
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -40485,7 +40780,7 @@ XS(_wrap_errorObj_message_set) {
     arg2 = (char *)(temp2);
     if (arg2) memcpy(arg1->message,arg2,2048*sizeof(char));
     else memset(arg1->message,0,2048*sizeof(char));
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -40556,7 +40851,7 @@ XS(_wrap_errorObj_isreported_set) {
     } 
     arg2 = (int)(val2);
     if (arg1) (arg1)->isreported = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -40631,7 +40926,7 @@ XS(_wrap_delete_errorObj) {
     }
     arg1 = (errorObj *)(argp1);
     delete_errorObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -40696,7 +40991,7 @@ XS(_wrap_msResetErrorList) {
       SWIG_croak("Usage: msResetErrorList();");
     }
     msResetErrorList();
-    
+    ST(argvi) = sv_newmortal();
     XSRETURN(argvi);
   fail:
     SWIG_croak_null();
@@ -40832,7 +41127,7 @@ XS(_wrap_delete_hashTableObj) {
     }
     arg1 = (hashTableObj *)(argp1);
     delete_hashTableObj(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -41000,7 +41295,7 @@ XS(_wrap_hashTableObj_clear) {
     }
     arg1 = (hashTableObj *)(argp1);
     hashTableObj_clear(arg1);
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -41104,7 +41399,7 @@ XS(_wrap_OWSRequest_type_set) {
     } 
     arg2 = (enum MS_REQUEST_TYPE)(val2);
     if (arg1) (arg1)->type = arg2;
-    
+    ST(argvi) = sv_newmortal();
     
     
     XSRETURN(argvi);
@@ -41178,7 +41473,7 @@ XS(_wrap_OWSRequest_contenttype_set) {
         arg1->contenttype = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -41252,7 +41547,7 @@ XS(_wrap_OWSRequest_postrequest_set) {
         arg1->postrequest = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -41326,7 +41621,7 @@ XS(_wrap_OWSRequest_httpcookiedata_set) {
         arg1->httpcookiedata = 0;
       }
     }
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     XSRETURN(argvi);
@@ -41384,6 +41679,33 @@ XS(_wrap_new_OWSRequest) {
 }
 
 
+XS(_wrap_delete_OWSRequest) {
+  {
+    cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: delete_OWSRequest(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_cgiRequestObj, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OWSRequest" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
+    }
+    arg1 = (cgiRequestObj *)(argp1);
+    delete_cgiRequestObj(arg1);
+    ST(argvi) = sv_newmortal();
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_OWSRequest_loadParams) {
   {
     cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
@@ -41486,7 +41808,7 @@ XS(_wrap_OWSRequest_setParameter) {
     }
     arg3 = (char *)(buf3);
     cgiRequestObj_setParameter(arg1,arg2,arg3);
-    
+    ST(argvi) = sv_newmortal();
     
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
@@ -41615,72 +41937,6 @@ XS(_wrap_OWSRequest_getValueByName) {
 }
 
 
-XS(_wrap_delete_OWSRequest__SWIG_1) {
-  {
-    cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
-    void *argp1 = 0 ;
-    int res1 = 0 ;
-    int argvi = 0;
-    dXSARGS;
-    
-    if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: delete_OWSRequest(self);");
-    }
-    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_cgiRequestObj, SWIG_POINTER_DISOWN |  0 );
-    if (!SWIG_IsOK(res1)) {
-      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OWSRequest" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
-    }
-    arg1 = (cgiRequestObj *)(argp1);
-    free((char *) arg1);
-    
-    
-    XSRETURN(argvi);
-  fail:
-    
-    SWIG_croak_null();
-  }
-}
-
-
-XS(_wrap_delete_OWSRequest) {
-  dXSARGS;
-  
-  {
-    unsigned long _index = 0;
-    SWIG_TypeRank _rank = 0; 
-    if (items == 1) {
-      SWIG_TypeRank _ranki = 0;
-      SWIG_TypeRank _rankm = 0;
-      SWIG_TypeRank _pi = 1;
-      int _v = 0;
-      {
-        void *vptr = 0;
-        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_cgiRequestObj, 0);
-        _v = SWIG_CheckState(res);
-      }
-      if (!_v) goto check_1;
-      _ranki += _v*_pi;
-      _rankm += _pi;
-      _pi *= SWIG_MAXCASTRANK;
-      if (!_index || (_ranki < _rank)) {
-        _rank = _ranki; _index = 1;
-        if (_rank == _rankm) goto dispatch;
-      }
-    }
-  check_1:
-    
-  dispatch:
-    switch(_index) {
-    case 1:
-      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_delete_OWSRequest__SWIG_1); return;
-    }
-  }
-  
-  croak("No matching function for overloaded 'delete_OWSRequest'");
-  XSRETURN(0);
-}
-
-
 XS(_wrap_msConnPoolCloseUnreferenced) {
   {
     int argvi = 0;
@@ -41690,7 +41946,7 @@ XS(_wrap_msConnPoolCloseUnreferenced) {
       SWIG_croak("Usage: msConnPoolCloseUnreferenced();");
     }
     msConnPoolCloseUnreferenced();
-    
+    ST(argvi) = sv_newmortal();
     XSRETURN(argvi);
   fail:
     SWIG_croak_null();
@@ -41707,7 +41963,7 @@ XS(_wrap_msIO_resetHandlers) {
       SWIG_croak("Usage: msIO_resetHandlers();");
     }
     msIO_resetHandlers();
-    
+    ST(argvi) = sv_newmortal();
     XSRETURN(argvi);
   fail:
     SWIG_croak_null();
@@ -41724,7 +41980,7 @@ XS(_wrap_msIO_installStdoutToBuffer) {
       SWIG_croak("Usage: msIO_installStdoutToBuffer();");
     }
     msIO_installStdoutToBuffer();
-    
+    ST(argvi) = sv_newmortal();
     XSRETURN(argvi);
   fail:
     SWIG_croak_null();
@@ -41741,7 +41997,7 @@ XS(_wrap_msIO_installStdinFromBuffer) {
       SWIG_croak("Usage: msIO_installStdinFromBuffer();");
     }
     msIO_installStdinFromBuffer();
-    
+    ST(argvi) = sv_newmortal();
     XSRETURN(argvi);
   fail:
     SWIG_croak_null();
@@ -41760,6 +42016,7 @@ XS(_wrap_msIO_stripStdoutBufferContentType) {
     }
     result = (char *)msIO_stripStdoutBufferContentType();
     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    free((char*)result);
     XSRETURN(argvi);
   fail:
     SWIG_croak_null();
@@ -41776,7 +42033,7 @@ XS(_wrap_msIO_stripStdoutBufferContentHeaders) {
       SWIG_croak("Usage: msIO_stripStdoutBufferContentHeaders();");
     }
     msIO_stripStdoutBufferContentHeaders();
-    
+    ST(argvi) = sv_newmortal();
     XSRETURN(argvi);
   fail:
     SWIG_croak_null();
@@ -42315,6 +42572,11 @@ static swig_command_info swig_commands[] = {
 {"mapscriptc::labelObj_removeBinding", _wrap_labelObj_removeBinding},
 {"mapscriptc::labelObj_getBinding", _wrap_labelObj_getBinding},
 {"mapscriptc::labelObj_setBinding", _wrap_labelObj_setBinding},
+{"mapscriptc::labelObj_getStyle", _wrap_labelObj_getStyle},
+{"mapscriptc::labelObj_insertStyle", _wrap_labelObj_insertStyle},
+{"mapscriptc::labelObj_removeStyle", _wrap_labelObj_removeStyle},
+{"mapscriptc::labelObj_moveStyleUp", _wrap_labelObj_moveStyleUp},
+{"mapscriptc::labelObj_moveStyleDown", _wrap_labelObj_moveStyleDown},
 {"mapscriptc::new_labelObj", _wrap_new_labelObj},
 {"mapscriptc::delete_labelObj", _wrap_delete_labelObj},
 {"mapscriptc::classObj_status_set", _wrap_classObj_status_set},
@@ -43121,13 +43383,13 @@ static swig_command_info swig_commands[] = {
 {"mapscriptc::OWSRequest_httpcookiedata_set", _wrap_OWSRequest_httpcookiedata_set},
 {"mapscriptc::OWSRequest_httpcookiedata_get", _wrap_OWSRequest_httpcookiedata_get},
 {"mapscriptc::new_OWSRequest", _wrap_new_OWSRequest},
+{"mapscriptc::delete_OWSRequest", _wrap_delete_OWSRequest},
 {"mapscriptc::OWSRequest_loadParams", _wrap_OWSRequest_loadParams},
 {"mapscriptc::OWSRequest_loadParamsFromURL", _wrap_OWSRequest_loadParamsFromURL},
 {"mapscriptc::OWSRequest_setParameter", _wrap_OWSRequest_setParameter},
 {"mapscriptc::OWSRequest_getName", _wrap_OWSRequest_getName},
 {"mapscriptc::OWSRequest_getValue", _wrap_OWSRequest_getValue},
 {"mapscriptc::OWSRequest_getValueByName", _wrap_OWSRequest_getValueByName},
-{"mapscriptc::delete_OWSRequest", _wrap_delete_OWSRequest},
 {"mapscriptc::msConnPoolCloseUnreferenced", _wrap_msConnPoolCloseUnreferenced},
 {"mapscriptc::msIO_resetHandlers", _wrap_msIO_resetHandlers},
 {"mapscriptc::msIO_installStdoutToBuffer", _wrap_msIO_installStdoutToBuffer},
@@ -43436,1085 +43698,1085 @@ XS(SWIG_init) {
     msSetError(MS_MISCERR, "Error initializing MapServer/Mapscript.", "msSetup()");
   }
   
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_VERSION", TRUE | 0x2 | GV_ADDMULTI);
-    sv_setsv(sv, SWIG_FromCharPtr("6.0.1"));
+    sv_setsv(sv, SWIG_FromCharPtr("6.0.3"));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_VERSION_MAJOR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(6)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_VERSION_MINOR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(0)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_VERSION_REV", TRUE | 0x2 | GV_ADDMULTI);
-    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1)));
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(3)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_VERSION_NUM", TRUE | 0x2 | GV_ADDMULTI);
-    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)((6*10000+0*100+1))));
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)((6*10000+0*100+3))));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "__FUNCTION__", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_FromCharPtr("MapServer"));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TRUE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_FALSE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(0)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_UNKNOWN", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(-1)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_ON", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_OFF", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(0)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DEFAULT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(2)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_EMBED", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(3)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DELETE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(4)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_YES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_NO", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(0)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GD_ALPHA", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1000)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_ALLOCSIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(64)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CLASS_ALLOCSIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(8)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_ALLOCSIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(4)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MAX_LABEL_PRIORITY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(10)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DEFAULT_LABEL_PRIORITY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_SWF", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(2)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_RAWDATA", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(3)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_IMAGEMAP", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(5)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_TEMPLATE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(8)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_OGR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(16)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_PLUGIN", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(100)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_CAIRO_RASTER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(101)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_CAIRO_PDF", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(102)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_CAIRO_SVG", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(103)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_OGL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(104)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_AGG", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(105)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_GD", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(106)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDER_WITH_KML", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(107)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_FILE_MAP", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_FILE_MAP)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_FILE_SYMBOL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_FILE_SYMBOL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_INCHES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_INCHES)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_FEET", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_FEET)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MILES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_MILES)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_METERS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_METERS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_KILOMETERS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_KILOMETERS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DD", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DD)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_PIXELS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_PIXELS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_PERCENTAGES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_PERCENTAGES)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_NAUTICALMILES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_NAUTICALMILES)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHAPE_POINT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SHAPE_POINT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHAPE_LINE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SHAPE_LINE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHAPE_POLYGON", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SHAPE_POLYGON)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHAPE_NULL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SHAPE_NULL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_POINT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LAYER_POINT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_LINE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LAYER_LINE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_POLYGON", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LAYER_POLYGON)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_RASTER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LAYER_RASTER)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_ANNOTATION", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LAYER_ANNOTATION)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_QUERY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LAYER_QUERY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_CIRCLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LAYER_CIRCLE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_TILEINDEX", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LAYER_TILEINDEX)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LAYER_CHART", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LAYER_CHART)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TRUETYPE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TRUETYPE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_BITMAP", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_BITMAP)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_POSITIONS_LENGTH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(14)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_UL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_UL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_UR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_UR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_UC", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_UC)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LC", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LC)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CC", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CC)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_AUTO", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_AUTO)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_XY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_XY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_FOLLOW", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_FOLLOW)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_NONE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_NONE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_AUTO2", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_AUTO2)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TINY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TINY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SMALL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SMALL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MEDIUM", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_MEDIUM)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LARGE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LARGE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GIANT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GIANT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_NORMAL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_NORMAL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_HILITE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_HILITE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SELECTED", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SELECTED)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_INLINE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_INLINE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHAPEFILE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SHAPEFILE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TILED_SHAPEFILE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TILED_SHAPEFILE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SDE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SDE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_OGR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_OGR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_UNUSED_1", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_UNUSED_1)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_POSTGIS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_POSTGIS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_WMS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_WMS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_ORACLESPATIAL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_ORACLESPATIAL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_WFS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_WFS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GRATICULE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GRATICULE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MYSQL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_MYSQL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RASTER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_RASTER)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_PLUGIN", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_PLUGIN)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_UNION", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_UNION)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DB_XBASE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DB_XBASE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DB_CSV", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DB_CSV)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DB_MYSQL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DB_MYSQL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DB_ORACLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DB_ORACLE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DB_POSTGRES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DB_POSTGRES)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_JOIN_ONE_TO_ONE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_JOIN_ONE_TO_ONE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_JOIN_ONE_TO_MANY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_JOIN_ONE_TO_MANY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SINGLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(0)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MULTIPLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERY_SINGLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_QUERY_SINGLE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERY_MULTIPLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_QUERY_MULTIPLE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERY_IS_NULL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_QUERY_IS_NULL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERY_BY_POINT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_QUERY_BY_POINT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERY_BY_RECT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_QUERY_BY_RECT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERY_BY_SHAPE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_QUERY_BY_SHAPE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERY_BY_ATTRIBUTE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_QUERY_BY_ATTRIBUTE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERY_BY_INDEX", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_QUERY_BY_INDEX)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERY_BY_FILTER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_QUERY_BY_FILTER)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_ALIGN_LEFT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_ALIGN_LEFT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_ALIGN_CENTER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_ALIGN_CENTER)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_ALIGN_RIGHT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_ALIGN_RIGHT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CJC_NONE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CJC_NONE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CJC_BEVEL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CJC_BEVEL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CJC_BUTT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CJC_BUTT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CJC_MITER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CJC_MITER)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CJC_ROUND", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CJC_ROUND)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CJC_SQUARE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CJC_SQUARE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CJC_TRIANGLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_CJC_TRIANGLE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CJC_DEFAULT_JOIN_MAXSIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(3)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SUCCESS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SUCCESS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_FAILURE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_FAILURE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DONE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DONE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMAGEMODE_PC256", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_IMAGEMODE_PC256)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMAGEMODE_RGB", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_IMAGEMODE_RGB)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMAGEMODE_RGBA", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_IMAGEMODE_RGBA)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMAGEMODE_INT16", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_IMAGEMODE_INT16)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMAGEMODE_FLOAT32", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_IMAGEMODE_FLOAT32)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMAGEMODE_BYTE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_IMAGEMODE_BYTE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMAGEMODE_FEATURE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_IMAGEMODE_FEATURE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMAGEMODE_NULL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_IMAGEMODE_NULL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_EQUALS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_EQUALS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_DISJOINT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_DISJOINT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_TOUCHES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_TOUCHES)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_OVERLAPS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_OVERLAPS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_CROSSES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_CROSSES)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_INTERSECTS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_INTERSECTS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_WITHIN", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_WITHIN)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_CONTAINS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_CONTAINS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_BEYOND", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_BEYOND)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOS_DWITHIN", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GEOS_DWITHIN)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TRANSFORM_NONE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TRANSFORM_NONE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TRANSFORM_ROUND", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TRANSFORM_ROUND)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TRANSFORM_SNAPTOGRID", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TRANSFORM_SNAPTOGRID)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TRANSFORM_FULLRESOLUTION", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TRANSFORM_FULLRESOLUTION)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TRANSFORM_SIMPLIFY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TRANSFORM_SIMPLIFY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_BINDING_LENGTH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(8)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_BINDING_SIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_STYLE_BINDING_SIZE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_BINDING_WIDTH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_STYLE_BINDING_WIDTH)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_BINDING_ANGLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_STYLE_BINDING_ANGLE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_BINDING_COLOR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_STYLE_BINDING_COLOR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_BINDING_OUTLINECOLOR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_STYLE_BINDING_OUTLINECOLOR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_BINDING_SYMBOL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_STYLE_BINDING_SYMBOL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_BINDING_OUTLINEWIDTH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_STYLE_BINDING_OUTLINEWIDTH)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_STYLE_BINDING_OPACITY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_STYLE_BINDING_OPACITY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_LENGTH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(9)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_SIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LABEL_BINDING_SIZE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_ANGLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LABEL_BINDING_ANGLE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_COLOR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LABEL_BINDING_COLOR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_OUTLINECOLOR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LABEL_BINDING_OUTLINECOLOR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_FONT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LABEL_BINDING_FONT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_PRIORITY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LABEL_BINDING_PRIORITY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_POSITION", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LABEL_BINDING_POSITION)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_SHADOWSIZEX", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LABEL_BINDING_SHADOWSIZEX)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_LABEL_BINDING_SHADOWSIZEY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_LABEL_BINDING_SHADOWSIZEY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   SWIG_TypeClientData(SWIGTYPE_p_fontSetObj, (void*) "mapscript::fontSetObj");
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_LOGICAL_AND", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_LOGICAL_AND)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_LOGICAL_OR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_LOGICAL_OR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_LOGICAL_NOT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_LOGICAL_NOT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_LITERAL_NUMBER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_LITERAL_NUMBER)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_LITERAL_STRING", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_LITERAL_STRING)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_LITERAL_TIME", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_LITERAL_TIME)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_LITERAL_SHAPE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_LITERAL_SHAPE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_EQ", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_EQ)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_NE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_NE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_GT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_GT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_LT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_LT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_LE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_LE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_GE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_GE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_IEQ", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_IEQ)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_RE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_RE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_IRE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_IRE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_IN", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_IN)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_LIKE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_LIKE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_INTERSECTS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_INTERSECTS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_DISJOINT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_DISJOINT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_TOUCHES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_TOUCHES)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_OVERLAPS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_OVERLAPS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_CROSSES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_CROSSES)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_WITHIN", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_WITHIN)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_CONTAINS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_CONTAINS)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_BEYOND", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_BEYOND)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_COMPARISON_DWITHIN", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_COMPARISON_DWITHIN)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_FUNCTION_LENGTH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_FUNCTION_LENGTH)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_FUNCTION_TOSTRING", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_FUNCTION_TOSTRING)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_FUNCTION_COMMIFY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_FUNCTION_COMMIFY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_FUNCTION_AREA", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_FUNCTION_AREA)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_FUNCTION_ROUND", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_FUNCTION_ROUND)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_FUNCTION_FROMTEXT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_FUNCTION_FROMTEXT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_FUNCTION_BUFFER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_FUNCTION_BUFFER)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_BINDING_DOUBLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_BINDING_DOUBLE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_BINDING_INTEGER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_BINDING_INTEGER)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_BINDING_STRING", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_BINDING_STRING)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_BINDING_TIME", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_BINDING_TIME)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TOKEN_BINDING_SHAPE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_TOKEN_BINDING_SHAPE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_PARSE_TYPE_BOOLEAN", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_PARSE_TYPE_BOOLEAN)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_PARSE_TYPE_STRING", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_PARSE_TYPE_STRING)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_PARSE_TYPE_SHAPE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_PARSE_TYPE_SHAPE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   SWIG_TypeClientData(SWIGTYPE_p_clusterObj, (void*) "mapscript::clusterObj");
   SWIG_TypeClientData(SWIGTYPE_p_outputFormatObj, (void*) "mapscript::outputFormatObj");
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_NOOVERRIDE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(-1111)));
     SvREADONLY_on(sv);
@@ -44545,434 +44807,434 @@ XS(SWIG_init) {
   SWIG_TypeClientData(SWIGTYPE_p_pointObj, (void*) "mapscript::pointObj");
   SWIG_TypeClientData(SWIGTYPE_p_lineObj, (void*) "mapscript::lineObj");
   SWIG_TypeClientData(SWIGTYPE_p_shapeObj, (void*) "mapscript::shapeObj");
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "SHX_BUFFER_PAGE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1024)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHAPEFILE_POINT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHAPEFILE_ARC", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(3)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHAPEFILE_POLYGON", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(5)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHAPEFILE_MULTIPOINT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(8)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHP_POINTZ", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(11)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHP_ARCZ", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(13)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHP_POLYGONZ", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(15)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHP_MULTIPOINTZ", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(18)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHP_POINTM", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(21)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHP_ARCM", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(23)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHP_POLYGONM", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(25)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHP_MULTIPOINTM", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(28)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   SWIG_TypeClientData(SWIGTYPE_p_DBFInfo, (void*) "mapscript::DBFInfo");
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "FTString", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FTString)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "FTInteger", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FTInteger)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "FTDouble", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FTDouble)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "FTInvalid", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FTInvalid)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   SWIG_TypeClientData(SWIGTYPE_p_shapefileObj, (void*) "mapscript::shapefileObj");
   SWIG_TypeClientData(SWIGTYPE_p_projectionObj, (void*) "mapscript::projectionObj");
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SYMBOL_SIMPLE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SYMBOL_SIMPLE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SYMBOL_VECTOR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SYMBOL_VECTOR)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SYMBOL_ELLIPSE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SYMBOL_ELLIPSE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SYMBOL_PIXMAP", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SYMBOL_PIXMAP)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SYMBOL_TRUETYPE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SYMBOL_TRUETYPE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SYMBOL_HATCH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SYMBOL_HATCH)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SYMBOL_SVG", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_SYMBOL_SVG)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SYMBOL_ALLOCSIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(64)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MAXVECTORPOINTS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(100)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MAXPATTERNLENGTH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(10)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMAGECACHESIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(6)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   SWIG_TypeClientData(SWIGTYPE_p_colorObj, (void*) "mapscript::colorObj");
   SWIG_TypeClientData(SWIGTYPE_p_symbolObj, (void*) "mapscript::symbolObj");
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_NOERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(0)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IOERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(1)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MEMERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(2)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TYPEERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(3)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SYMERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(4)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_REGEXERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(5)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TTFERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(6)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DBFERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(7)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GDERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(8)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IDENTERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(9)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_EOFERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(10)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_PROJERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(11)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MISCERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(12)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CGIERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(13)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_WEBERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(14)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_IMGERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(15)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_HASHERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(16)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_JOINERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(17)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_NOTFOUND", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(18)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SHPERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(19)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_PARSEERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(20)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SDEERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(21)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_OGRERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(22)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_QUERYERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(23)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_WMSERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(24)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_WMSCONNERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(25)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_ORACLESPATIALERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(26)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_WFSERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(27)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_WFSCONNERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(28)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_MAPCONTEXTERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(29)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_HTTPERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(30)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_CHILDERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(31)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_WCSERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(32)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GEOSERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(33)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RECTERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(34)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_TIMEERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(35)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GMLERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(36)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_SOSERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(37)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_NULLPARENTERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(38)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_AGGERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(39)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_OWSERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(40)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_OGLERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(42)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_RENDERERERR", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(43)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_NUMERRORCODES", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(44)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MESSAGELENGTH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(2048)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "ROUTINELENGTH", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(64)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_ERROR_LANGUAGE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_FromCharPtr("en-US"));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   SWIG_TypeClientData(SWIGTYPE_p_error_obj, (void*) "mapscript::errorObj");
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DEBUGLEVEL_ERRORSONLY", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DEBUGLEVEL_ERRORSONLY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DEBUGLEVEL_DEBUG", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DEBUGLEVEL_DEBUG)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DEBUGLEVEL_TUNING", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DEBUGLEVEL_TUNING)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DEBUGLEVEL_V", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DEBUGLEVEL_V)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DEBUGLEVEL_VV", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DEBUGLEVEL_VV)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DEBUGLEVEL_VVV", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_DEBUGLEVEL_VVV)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_HASHSIZE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(41)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   SWIG_TypeClientData(SWIGTYPE_p_hashTableObj, (void*) "mapscript::hashTableObj");
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_DEFAULT_CGI_PARAMS", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(100)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_GET_REQUEST", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_GET_REQUEST)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/local/share/swig/1.3.36/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+  /*@SWIG:/usr/share/swig1.3/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "MS_POST_REQUEST", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MS_POST_REQUEST)));
     SvREADONLY_on(sv);
diff --git a/mapscript/perl/plmodule.i b/mapscript/perl/plmodule.i
index 8cfa175..c44df98 100644
--- a/mapscript/perl/plmodule.i
+++ b/mapscript/perl/plmodule.i
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: plmodule.i 8847 2009-03-30 17:48:25Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Perl-specific enhancements to MapScript
diff --git a/mapscript/php/Makefile.in b/mapscript/php/Makefile.in
index f1d0e36..15c9bfb 100644
--- a/mapscript/php/Makefile.in
+++ b/mapscript/php/Makefile.in
@@ -5,7 +5,7 @@
 # This is an adapted version of php-3.0.14/dl/Makefile.tmpl for the 
 # MapServer php_mapscript.so module.
 #
-# $Id: Makefile.in 11455 2011-04-04 16:42:42Z aboudreault $
+# $Id$
 #
 
 # +----------------------------------------------------------------------+
diff --git a/mapscript/php/Makefile.vc b/mapscript/php/Makefile.vc
index 939b86a..439ed89 100644
--- a/mapscript/php/Makefile.vc
+++ b/mapscript/php/Makefile.vc
@@ -8,7 +8,7 @@
 #  - Run the VCVARS32.BAT script to initialize the VC++ environment variables
 #  - Start the build with:  nmake /f makefile.vc
 #
-# $Id: Makefile.vc 11455 2011-04-04 16:42:42Z aboudreault $
+# $Id$
 #
 
 # Flag indicating to the option files that this is the build of PHP/MapScript
@@ -30,7 +30,11 @@ PHP4_FLAGS=/DZEND_WIN32 /DPHP_WIN32 /DPHP4 /DZTS /PHP_COMPILER_ID=VC9 /DZEND_DEB
 # Set flag for Visual Studio > 2003 & PHP < 5.3
 # see http://bugs.php.net/bug.php?id=39130
 !IF $(MSVC_VER) >= 1400
-VCFLAGS = -D_USE_32BIT_TIME_T
+!IFDEF WIN64
+VCFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
+!ELSE
+VCFLAGS = -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
+!ENDIF
 !ENDIF
 
 BASE_CFLAGS = 	$(OPTFLAGS) -DWIN32 -D_WIN32 $(PHP4_FLAGS) $(VCFLAGS)
@@ -78,12 +82,13 @@ install:	all
 $(PHPMS_DLL):	$(PHPMS_OBJS)
 	link $(LDFLAGS) /out:$(PHPMS_DLL) $(PHPMS_OBJS) $(MS_LIBS) \
 		$(PHP_HOME)\lib\$(PHP_TS_LIB_NAME)
+    if exist $(PHPMS_DLL).manifest mt -manifest $(PHPMS_DLL).manifest -outputresource:$(PHPMS_DLL);2
 
 $(PHPPROJ_DLL):	$(PHPPROJ_OBJS)
 	link $(LDFLAGS) /out:$(PHPPROJ_DLL) $(PHPPROJ_OBJS) $(MS_LIBS) \
 		$(PHP_HOME)\lib\$(PHP_TS_LIB_NAME)
 
-$(PHPMS_OBJS):	php_mapscript_util.h php_mapscript.h $(MS_LIBS)
+$(PHPMS_OBJS):	php_mapscript_util.h php_mapscript.h
 
 .c.obj:
 	$(CC) $(CFLAGS) /DCOMPILE_DL=1 /c $*.c /Fo$*.obj
@@ -99,4 +104,4 @@ clean:
 	del *.pdb
 	del *.exp
 	del *.ilk
-
+    del *.manifest
diff --git a/mapscript/php/README.WIN32 b/mapscript/php/README.WIN32
index cdc7307..3744193 100644
--- a/mapscript/php/README.WIN32
+++ b/mapscript/php/README.WIN32
@@ -92,5 +92,5 @@ included in the list of extensions in the phpinfo() report.
 
 
 --------------------------
-$Id: README.WIN32 11148 2011-03-11 03:42:53Z dmorissette $
+$Id$
 --------------------------
diff --git a/mapscript/php/label.c b/mapscript/php/label.c
index 01ad0e7..95ab2ea 100644
--- a/mapscript/php/label.c
+++ b/mapscript/php/label.c
@@ -60,6 +60,22 @@ ZEND_BEGIN_ARG_INFO_EX(label_removeBinding_args, 0, 0, 1)
   ZEND_ARG_INFO(0, labelBinding)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(label_getStyle_args, 0, 0, 1)
+  ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(label_moveStyleUp_args, 0, 0, 1)
+  ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(label_moveStyleDown_args, 0, 0, 1)
+  ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(label_deleteStyle_args, 0, 0, 1)
+  ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
 /* {{{ proto void __construct() 
    labelObj CANNOT be instanciated, this will throw an exception on use */
 PHP_METHOD(labelObj, __construct)
@@ -104,6 +120,7 @@ PHP_METHOD(labelObj, __get)
     else IF_GET_LONG("minfeaturesize", php_label->label->minfeaturesize)
     else IF_GET_LONG("autominfeaturesize", php_label->label->autominfeaturesize)
     else IF_GET_LONG("repeatdistance", php_label->label->repeatdistance)
+    else IF_GET_LONG("numstyles", php_label->label->numstyles) 
     else IF_GET_LONG("mindistance", php_label->label->mindistance)
     else IF_GET_LONG("partials", php_label->label->partials)
     else IF_GET_LONG("force", php_label->label->force)
@@ -174,6 +191,10 @@ PHP_METHOD(labelObj, __set)
     {
         mapscript_throw_exception("Property '%s' is an object and can only be modified through its accessors." TSRMLS_CC, property);
     }
+    else if (STRING_EQUAL("numstyles", property))
+    {
+        mapscript_throw_exception("Property '%s' is read-only and cannot be set." TSRMLS_CC, property);
+    }
     else 
     {
         mapscript_throw_exception("Property '%s' does not exist in this object." TSRMLS_CC, property);
@@ -331,6 +352,111 @@ PHP_METHOD(labelObj, removeBinding)
 }
 /* }}} */
 
+/* {{{ proto int getstyle(int index)
+   return the style object. */
+PHP_METHOD(labelObj, getStyle)
+{
+    long index;
+    zval *zobj = getThis();
+    php_label_object *php_label;
+    styleObj *style = NULL;
+    parent_object parent;
+
+    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
+                              &index) == FAILURE) {
+        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+        return;
+    }
+    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+    
+    php_label = (php_label_object *) zend_object_store_get_object(zobj TSRMLS_CC);
+
+    if (index < 0 || index >= php_label->label->numstyles)
+    {
+        mapscript_throw_exception("Invalid style index." TSRMLS_CC);
+        return;
+    }
+    
+    style = php_label->label->styles[index];
+
+    MAPSCRIPT_MAKE_PARENT(zobj, NULL);
+    mapscript_create_style(style, parent, return_value TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto int moveStyleUp(int index)  */
+PHP_METHOD(labelObj, moveStyleUp)
+{
+    long index;
+    zval *zobj = getThis();
+    php_label_object *php_label;
+    int status = MS_FAILURE;
+
+    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
+                              &index) == FAILURE) {
+        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+        return;
+    }
+    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+    
+    php_label = (php_label_object *) zend_object_store_get_object(zobj TSRMLS_CC);
+
+    status = labelObj_moveStyleUp(php_label->label, index);
+
+    RETURN_LONG(status);
+}
+/* }}} */
+
+/* {{{ proto int moveStyleDown(int index) */
+PHP_METHOD(labelObj, moveStyleDown)
+{
+    long index;
+    zval *zobj = getThis();
+    php_label_object *php_label;
+    int status = MS_FAILURE;
+
+    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
+                              &index) == FAILURE) {
+        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+        return;
+    }
+    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+    
+    php_label = (php_label_object *) zend_object_store_get_object(zobj TSRMLS_CC);
+
+    status = labelObj_moveStyleDown(php_label->label, index);
+
+    RETURN_LONG(status);
+}
+/* }}} */
+
+ /* {{{ proto int deleteStyle(int index) */
+PHP_METHOD(labelObj, deleteStyle)
+{
+    long index;
+    zval *zobj = getThis();
+    php_label_object *php_label;
+    int status = MS_FAILURE;
+
+    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
+                              &index) == FAILURE) {
+        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+        return;
+    }
+    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+    
+    php_label = (php_label_object *) zend_object_store_get_object(zobj TSRMLS_CC);
+
+    status =  labelObj_deleteStyle(php_label->label, index);
+
+    RETURN_LONG(status);
+}
+/* }}} */
+
 /* {{{ proto int label.free()
    Free the object */
 PHP_METHOD(labelObj, free)
@@ -362,6 +488,10 @@ zend_function_entry label_functions[] = {
     PHP_ME(labelObj, setBinding, label_setBinding_args, ZEND_ACC_PUBLIC)
     PHP_ME(labelObj, getBinding, label_getBinding_args, ZEND_ACC_PUBLIC)
     PHP_ME(labelObj, removeBinding, label_removeBinding_args, ZEND_ACC_PUBLIC)
+    PHP_ME(labelObj, getStyle, label_getStyle_args, ZEND_ACC_PUBLIC)
+    PHP_ME(labelObj, moveStyleUp, label_moveStyleUp_args, ZEND_ACC_PUBLIC)
+    PHP_ME(labelObj, moveStyleDown, label_moveStyleDown_args, ZEND_ACC_PUBLIC)
+    PHP_ME(labelObj, deleteStyle, label_deleteStyle_args, ZEND_ACC_PUBLIC)
     PHP_ME(labelObj, free, NULL, ZEND_ACC_PUBLIC)
     {NULL, NULL, NULL}
 };
diff --git a/mapscript/php/mapscript_i.c b/mapscript/php/mapscript_i.c
index 1ba4062..42e604b 100644
--- a/mapscript/php/mapscript_i.c
+++ b/mapscript/php/mapscript_i.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapscript_i.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Interface file for MapServer PHP scripting extension 
@@ -723,6 +723,21 @@ int labelObj_updateFromString(labelObj *self, char *snippet) {
    return msUpdateLabelFromString(self, snippet);
 }
 
+int labelObj_moveStyleUp(labelObj *self, int index)
+{
+    return msMoveLabelStyleUp(self, index);
+}
+
+int labelObj_moveStyleDown(labelObj *self, int index)
+{
+    return msMoveLabelStyleDown(self, index);
+}
+
+int labelObj_deleteStyle(labelObj *self, int index)
+{
+    return msDeleteLabelStyle(self, index);
+}
+
 /**********************************************************************
  * class extensions for legendObj
  **********************************************************************/
@@ -777,6 +792,7 @@ classObj *classObj_new(layerObj *layer, classObj *class) {
     }
 
     layer->class[layer->numclasses]->type = layer->type;
+    layer->class[layer->numclasses]->layer = layer;
 
     layer->numclasses++;
 
@@ -1389,6 +1405,21 @@ styleObj *styleObj_new(classObj *class, styleObj *style) {
     return class->styles[class->numstyles-1];
   }
 
+styleObj *styleObj_label_new(labelObj *label, styleObj *style) {
+    if(msGrowLabelStyles(label) == NULL)
+      return NULL;
+
+    if(initStyle(label->styles[label->numstyles]) == -1)
+      return NULL;
+
+    if (style)
+      msCopyStyle(label->styles[label->numstyles], style);
+        
+    label->numstyles++;
+
+    return label->styles[label->numstyles-1];
+  }
+
 int styleObj_updateFromString(styleObj *self, char *snippet) {
    return msUpdateStyleFromString(self, snippet, MS_FALSE);
 }
diff --git a/mapscript/php/nmake.opt b/mapscript/php/nmake.opt
index 4265669..692c635 100644
--- a/mapscript/php/nmake.opt
+++ b/mapscript/php/nmake.opt
@@ -8,7 +8,7 @@
 #  - Run the VCVARS32.BAT script to initialize the VC++ environment variables
 #  - Start the build with:  nmake /f makefile.vc
 #
-# $Id: nmake.opt 8496 2009-02-04 16:46:23Z assefa $
+# $Id$
 #
 
 ########################################################################
diff --git a/mapscript/php/php_mapscript.c b/mapscript/php/php_mapscript.c
index 0110669..201f3fa 100644
--- a/mapscript/php/php_mapscript.c
+++ b/mapscript/php/php_mapscript.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: php_mapscript.c 11473 2011-04-06 03:05:02Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  PHP/MapScript extension for MapServer.  External interface 
@@ -1193,6 +1193,15 @@ PHP_MINIT_FUNCTION(mapscript)
     REGISTER_LONG_CONSTANT("MS_LABEL_BINDING_SHADOWSIZEX", MS_LABEL_BINDING_SHADOWSIZEX, const_flag);
     REGISTER_LONG_CONSTANT("MS_LABEL_BINDING_SHADOWSIZEY", MS_LABEL_BINDING_SHADOWSIZEY, const_flag);
 
+    /* MS_CAPS_JOINS_AND_CORNERS */
+    REGISTER_LONG_CONSTANT("MS_CJC_NONE", MS_CJC_NONE, const_flag);
+    REGISTER_LONG_CONSTANT("MS_CJC_BEVEL", MS_CJC_BEVEL, const_flag);
+    REGISTER_LONG_CONSTANT("MS_CJC_BUTT", MS_CJC_BUTT, const_flag); 
+    REGISTER_LONG_CONSTANT("MS_CJC_MITER", MS_CJC_MITER, const_flag); 
+    REGISTER_LONG_CONSTANT("MS_CJC_ROUND", MS_CJC_ROUND, const_flag); 
+    REGISTER_LONG_CONSTANT("MS_CJC_SQUARE", MS_CJC_SQUARE, const_flag); 
+    REGISTER_LONG_CONSTANT("MS_CJC_TRIANGLE", MS_CJC_TRIANGLE, const_flag); 
+
     /*cgi request types*/
     REGISTER_LONG_CONSTANT("MS_GET_REQUEST", MS_GET_REQUEST, const_flag);
     REGISTER_LONG_CONSTANT("MS_POST_REQUEST", MS_POST_REQUEST, const_flag);
diff --git a/mapscript/php/php_mapscript.h b/mapscript/php/php_mapscript.h
index 98d8600..065c6dd 100644
--- a/mapscript/php/php_mapscript.h
+++ b/mapscript/php/php_mapscript.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: php_mapscript.h 11619 2011-04-27 15:23:07Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  PHP/MapScript extension for MapServer. Header file 
@@ -58,7 +58,7 @@
 #include "maptemplate.h"
 #include "mapogcsld.h"
 
-#define MAPSCRIPT_VERSION "($Revision: 11619 $ $Date: 2011-04-27 11:23:07 -0400 (Wed, 27 Apr 2011) $)"
+#define MAPSCRIPT_VERSION "($Revision$ $Date$)"
 
 extern zend_module_entry mapscript_module_entry;
 #define phpext_mapscript_ptr &mapscript_module_entry
@@ -68,16 +68,9 @@ extern zend_module_entry mapscript_module_entry;
 	zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
 #endif
 
-#ifndef Z_ADDREF_P
-#define Z_ADDREF_P(pz)                (pz)->refcount++
-#endif
-
-#ifndef Z_DELREF_P
-#define Z_DELREF_P(pz)                (pz)->refcount--
-#endif
-
-#ifndef Z_SET_REFCOUNT_P
-#define Z_SET_REFCOUNT_P(pz, rc)      (pz)->refcount = rc
+/* it looks like that macro is not always defined: ticket #3926 */
+#ifndef TRUE
+#define TRUE 1
 #endif
 
 /* Taken from the CAIRO php extension */
@@ -221,6 +214,8 @@ typedef struct _php_style_object {
     zval *color;
     zval *outlinecolor;
     zval *backgroundcolor;
+    zval *mincolor;
+    zval *maxcolor;
     styleObj *style;
 } php_style_object;
 
@@ -443,8 +438,7 @@ extern zend_object_value mapscript_object_new_ex(zend_object *zobj, zend_class_e
                                                  void (*zend_objects_free_object),
                                                  zend_object_handlers *object_handlers TSRMLS_DC);
 extern void mapscript_fetch_object(zend_class_entry *ce, zval* zval_parent, php_layer_object* layer, 
-                                   void *internal_object, zval **php_object_storage, 
-                                   zval ***return_value_ptr TSRMLS_DC);
+                                   void *internal_object, zval **php_object_storage TSRMLS_DC);
 extern void mapscript_create_color(colorObj *color, parent_object parent, zval *return_value TSRMLS_DC);
 extern void mapscript_create_rect(rectObj *rect, parent_object php_parent, zval *return_value TSRMLS_DC);
 extern void mapscript_create_hashtable(hashTableObj *hashtable, parent_object parent, zval *return_value TSRMLS_DC);
@@ -616,6 +610,9 @@ int             layerObj_setConnectionType(layerObj *self, int connectiontype,
                                            const char *library_str) ;
 
 int             labelObj_updateFromString(labelObj *self, char *snippet);
+int             labelObj_moveStyleUp(labelObj *self, int index);
+int             labelObj_moveStyleDown(labelObj *self, int index);
+int             labelObj_deleteStyle(labelObj *self, int index);
 
 int             legendObj_updateFromString(legendObj *self, char *snippet);
 
@@ -747,6 +744,7 @@ int             DBFInfo_getFieldDecimals(DBFInfo *self, int iField);
 DBFFieldType    DBFInfo_getFieldType(DBFInfo *self, int iField);
 
 styleObj       *styleObj_new(classObj *class, styleObj *style);
+styleObj       *styleObj_label_new(labelObj *label, styleObj *style);
 int             styleObj_updateFromString(styleObj *self, char *snippet);
 int             styleObj_setSymbolByName(styleObj *self, mapObj *map, 
                                          char* pszSymbolName);
diff --git a/mapscript/php/php_mapscript_util.c b/mapscript/php/php_mapscript_util.c
index 53bacb4..528f2c6 100644
--- a/mapscript/php/php_mapscript_util.c
+++ b/mapscript/php/php_mapscript_util.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: php_mapscript_util.c 11456 2011-04-04 17:50:20Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  PHP/MapScript extension for MapServer : Utility functions
@@ -95,7 +95,7 @@ int mapscript_extract_associative_array(HashTable *php, char **array)
    otherwise it creates it */
 void mapscript_fetch_object(zend_class_entry *ce, zval* zval_parent, php_layer_object* layer, 
                             void *internal_object, 
-                            zval **php_object_storage, zval ***return_value_ptr TSRMLS_DC)
+                            zval **php_object_storage TSRMLS_DC)
 {
     parent_object p;
 
@@ -150,14 +150,5 @@ void mapscript_fetch_object(zend_class_entry *ce, zval* zval_parent, php_layer_o
         mapscript_create_layer((layerObj*)internal_object, p, *php_object_storage TSRMLS_CC);
     else if (ce == mapscript_ce_cluster)
         mapscript_create_cluster((clusterObj*)internal_object, p, *php_object_storage TSRMLS_CC);
-        
-    MAPSCRIPT_ADDREF(*php_object_storage);
-
-    // return a reference to the object
-    if (return_value_ptr) {
-        zval_ptr_dtor(*return_value_ptr);
-        zval_set_isref_p(*php_object_storage);
-        **return_value_ptr = *php_object_storage;
-    }
 }
 
diff --git a/mapscript/php/php_mapscript_util.h b/mapscript/php/php_mapscript_util.h
index 6a9b665..cbb9ed9 100644
--- a/mapscript/php/php_mapscript_util.h
+++ b/mapscript/php/php_mapscript_util.h
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: php_mapscript_util.h 11619 2011-04-27 15:23:07Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  PHP/MapScript extension for MapServer : Utility functions
@@ -43,6 +43,78 @@
 #define TSRMLS_CC
 #endif
 
+/* Add pseudo refcount macros for PHP version < 5.3 */
+#ifndef Z_REFCOUNT_PP
+
+#define Z_REFCOUNT_PP(ppz)				Z_REFCOUNT_P(*(ppz))
+#define Z_SET_REFCOUNT_PP(ppz, rc)		Z_SET_REFCOUNT_P(*(ppz), rc)
+#define Z_ADDREF_PP(ppz)				Z_ADDREF_P(*(ppz))
+#define Z_DELREF_PP(ppz)				Z_DELREF_P(*(ppz))
+#define Z_ISREF_PP(ppz)					Z_ISREF_P(*(ppz))
+#define Z_SET_ISREF_PP(ppz)				Z_SET_ISREF_P(*(ppz))
+#define Z_UNSET_ISREF_PP(ppz)			Z_UNSET_ISREF_P(*(ppz))
+#define Z_SET_ISREF_TO_PP(ppz, isref)	Z_SET_ISREF_TO_P(*(ppz), isref)
+
+#define Z_REFCOUNT_P(pz)				zval_refcount_p(pz)
+#define Z_SET_REFCOUNT_P(pz, rc)		zval_set_refcount_p(pz, rc)
+#define Z_ADDREF_P(pz)					zval_addref_p(pz)
+#define Z_DELREF_P(pz)					zval_delref_p(pz)
+#define Z_ISREF_P(pz)					zval_isref_p(pz)
+#define Z_SET_ISREF_P(pz)				zval_set_isref_p(pz)
+#define Z_UNSET_ISREF_P(pz)				zval_unset_isref_p(pz)
+#define Z_SET_ISREF_TO_P(pz, isref)		zval_set_isref_to_p(pz, isref)
+
+#define Z_REFCOUNT(z)					Z_REFCOUNT_P(&(z))
+#define Z_SET_REFCOUNT(z, rc)			Z_SET_REFCOUNT_P(&(z), rc)
+#define Z_ADDREF(z)						Z_ADDREF_P(&(z))
+#define Z_DELREF(z)						Z_DELREF_P(&(z))
+#define Z_ISREF(z)						Z_ISREF_P(&(z))
+#define Z_SET_ISREF(z)					Z_SET_ISREF_P(&(z))
+#define Z_UNSET_ISREF(z)				Z_UNSET_ISREF_P(&(z))
+#define Z_SET_ISREF_TO(z, isref)		Z_SET_ISREF_TO_P(&(z), isref)
+
+#if defined(__GNUC__)
+#define zend_always_inline inline __attribute__((always_inline))
+#elif defined(_MSC_VER)
+#define zend_always_inline __forceinline
+#else
+#define zend_always_inline inline
+#endif
+
+static zend_always_inline zend_uint zval_refcount_p(zval* pz) {
+	return pz->refcount;
+}
+
+static zend_always_inline zend_uint zval_set_refcount_p(zval* pz, zend_uint rc) {
+	return pz->refcount = rc;
+}
+
+static zend_always_inline zend_uint zval_addref_p(zval* pz) {
+	return ++pz->refcount;
+}
+
+static zend_always_inline zend_uint zval_delref_p(zval* pz) {
+	return --pz->refcount;
+}
+
+static zend_always_inline zend_bool zval_isref_p(zval* pz) {
+	return pz->is_ref;
+}
+
+static zend_always_inline zend_bool zval_set_isref_p(zval* pz) {
+	return pz->is_ref = 1;
+}
+
+static zend_always_inline zend_bool zval_unset_isref_p(zval* pz) {
+	return pz->is_ref = 0;
+}
+
+static zend_always_inline zend_bool zval_set_isref_to_p(zval* pz, zend_bool isref) {
+	return pz->is_ref = isref;
+}
+
+#endif
+
 /* PHP >=5.3 replaced ZVAL_DELREF by Z_DELREF_P */
 #if ZEND_MODULE_API_NO >= 20090626
 #define ZVAL_DELREF Z_DELREF_P
@@ -67,7 +139,7 @@
 #define MAPSCRIPT_DELREF(zobj) \
     if (zobj) \
     { \
-        if (READY_TO_DESTROY(zobj)) { \
+        if (Z_REFCOUNT_P(zobj) == 1) {    \
             zval_ptr_dtor(&zobj);       \
         } \
         else { \
@@ -121,22 +193,17 @@
 #define IF_GET_OBJECT(property_name, mapscript_ce, php_object_storage, internal_object) \
     if (strcmp(property, property_name)==0)  \
     {   \
-        if (php_object_storage) {                             \
-            MAPSCRIPT_ADDREF(php_object_storage); \
-            zval_ptr_dtor(return_value_ptr); \
-            zval_set_isref_p(php_object_storage); \
-            *return_value_ptr = php_object_storage; \
-            return; \
-        }                                               \
-       mapscript_fetch_object(mapscript_ce, zobj, NULL, (void*)internal_object, \
-                              &php_object_storage, &return_value_ptr TSRMLS_CC); \
-        return;                                                         \
+        if (!php_object_storage) {                             \
+            mapscript_fetch_object(mapscript_ce, zobj, NULL, (void*)internal_object, \
+                                   &php_object_storage TSRMLS_CC); \
+        }                                                               \
+        RETURN_ZVAL(php_object_storage, 1, 0);                          \
     } 
 
 #define CHECK_OBJECT(mapscript_ce, php_object_storage, internal_object) \
     if (!php_object_storage) {                                          \
         mapscript_fetch_object(mapscript_ce, zobj, NULL, (void*)internal_object, \
-                           &php_object_storage, NULL TSRMLS_CC); \
+                           &php_object_storage TSRMLS_CC); \
     }
 
 /* helpers for setters */
diff --git a/mapscript/php/php_proj.c b/mapscript/php/php_proj.c
index b228d37..2a17885 100644
--- a/mapscript/php/php_proj.c
+++ b/mapscript/php/php_proj.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: php_proj.c 9937 2010-03-11 15:17:39Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  PHP wraper function to PROJ4 projection module.
diff --git a/mapscript/php/php_regex.c b/mapscript/php/php_regex.c
index 561b994..1b1ff0d 100644
--- a/mapscript/php/php_regex.c
+++ b/mapscript/php/php_regex.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: php_regex.c 9154 2009-07-08 18:40:27Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Regex wrapper
diff --git a/mapscript/php/style.c b/mapscript/php/style.c
index 4bfab23..54c1425 100644
--- a/mapscript/php/style.c
+++ b/mapscript/php/style.c
@@ -35,7 +35,7 @@ zend_class_entry *mapscript_ce_style;
 zend_object_handlers mapscript_style_object_handlers;
 
 ZEND_BEGIN_ARG_INFO_EX(style___construct_args, 0, 0, 1)
-  ZEND_ARG_OBJ_INFO(0, class, classObj, 0)
+  ZEND_ARG_INFO(0, parent)
   ZEND_ARG_OBJ_INFO(0, style, styleObj, 0)
 ZEND_END_ARG_INFO()
 
@@ -69,21 +69,25 @@ ZEND_BEGIN_ARG_INFO_EX(style_setGeomTransform_args, 0, 0, 1)
   ZEND_ARG_INFO(0, transform)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(style_setPattern_args, 0, 0, 1)
+  ZEND_ARG_INFO(0, pattern)
+ZEND_END_ARG_INFO()
 
-/* {{{ proto void __construct(classObj class [, styleObj style]) 
-   Create a new styleObj instance */
+/* {{{ proto void __construct(parent [, styleObj style]) 
+   Create a new styleObj instance. parent has to be a classObj or labelObj. */
 PHP_METHOD(styleObj, __construct)
 {
     zval *zobj = getThis();
-    zval *zclass, *zstyle = NULL;
+    zval *zparent, *zstyle = NULL;
     styleObj *style;
-    php_class_object *php_class;
+    php_class_object *php_class = NULL;
+    php_label_object *php_label = NULL;
     php_style_object *php_style, *php_style2;
     parent_object parent;
 
     PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
-    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|O",
-                              &zclass, mapscript_ce_class,
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|O",
+                              &zparent,
                               &zstyle, mapscript_ce_style) == FAILURE) {
         PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
         return;
@@ -91,21 +95,42 @@ PHP_METHOD(styleObj, __construct)
     PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
 
     php_style = (php_style_object *)zend_object_store_get_object(zobj TSRMLS_CC);
-    php_class = (php_class_object *)zend_object_store_get_object(zclass TSRMLS_CC);
+    
+    if (Z_TYPE_P(zparent) == IS_OBJECT && Z_OBJCE_P(zparent) == mapscript_ce_class)
+        php_class = (php_class_object *)zend_object_store_get_object(zparent TSRMLS_CC);
+    else if (Z_TYPE_P(zparent) == IS_OBJECT && Z_OBJCE_P(zparent) == mapscript_ce_label)
+        php_label = (php_label_object *)zend_object_store_get_object(zparent TSRMLS_CC);
+    else 
+    {
+        mapscript_throw_mapserver_exception("Invalid argument 1: should be a classObj or labelObj" TSRMLS_CC);
+        return;
+    }
+
     if (zstyle)
         php_style2 = (php_style_object *)zend_object_store_get_object(zstyle TSRMLS_CC);
 
-    if ((style = styleObj_new(php_class->class, (zstyle ? php_style2->style : NULL))) == NULL)
+    if (php_class)
     {
-        mapscript_throw_mapserver_exception("" TSRMLS_CC);
-        return;
+        if ((style = styleObj_new(php_class->class, (zstyle ? php_style2->style : NULL))) == NULL)
+        {
+            mapscript_throw_mapserver_exception("" TSRMLS_CC);
+            return;
+        }
+    }
+    else
+    {
+        if ((style = styleObj_label_new(php_label->label, (zstyle ? php_style2->style : NULL))) == NULL)
+        {
+            mapscript_throw_mapserver_exception("" TSRMLS_CC);
+            return;
+        }
     }
 
     php_style->style = style;
-    
-    MAPSCRIPT_MAKE_PARENT(zclass, NULL);
+
+    MAPSCRIPT_MAKE_PARENT(zparent, NULL);
     php_style->parent = parent;
-    MAPSCRIPT_ADDREF(zclass);  
+    MAPSCRIPT_ADDREF(zparent);  
 }
 /* }}} */
 
@@ -132,6 +157,7 @@ PHP_METHOD(styleObj, __get)
     else IF_GET_DOUBLE("minsize", php_style->style->minsize)
     else IF_GET_DOUBLE("maxsize", php_style->style->maxsize)
     else IF_GET_DOUBLE("width", php_style->style->width)
+    else IF_GET_DOUBLE("outlinewidth", php_style->style->outlinewidth)
     else IF_GET_DOUBLE("minwidth", php_style->style->minwidth)
     else IF_GET_DOUBLE("maxwidth", php_style->style->maxwidth)
     else IF_GET_LONG("offsetx", php_style->style->offsetx)
@@ -141,10 +167,21 @@ PHP_METHOD(styleObj, __get)
     else IF_GET_DOUBLE("minvalue", php_style->style->minvalue)
     else IF_GET_DOUBLE("maxvalue", php_style->style->maxvalue)
     else IF_GET_STRING("rangeitem", php_style->style->rangeitem)
+    else IF_GET_LONG("rangeitemindex", php_style->style->rangeitemindex)
+    else IF_GET_DOUBLE("gap", php_style->style->gap)
+    else IF_GET_LONG("patternlength", php_style->style->patternlength)  
+    else IF_GET_LONG("position", php_style->style->position)
+    else IF_GET_LONG("linecap", php_style->style->linecap)
+    else IF_GET_LONG("linejoin", php_style->style->linejoin)
+    else IF_GET_LONG("linejoinmaxsize", php_style->style->linejoinmaxsize)
+    else IF_GET_DOUBLE("angle", php_style->style->angle)
+    else IF_GET_LONG("autoangle", php_style->style->autoangle)
     else IF_GET_LONG("opacity", php_style->style->opacity)
     else IF_GET_OBJECT("color", mapscript_ce_color, php_style->color, &php_style->style->color) 
     else IF_GET_OBJECT("outlinecolor", mapscript_ce_color, php_style->outlinecolor, &php_style->style->outlinecolor) 
     else IF_GET_OBJECT("backgroundcolor", mapscript_ce_color, php_style->backgroundcolor, &php_style->style->backgroundcolor) 
+    else IF_GET_OBJECT("mincolor", mapscript_ce_color, php_style->mincolor, &php_style->style->mincolor) 
+    else IF_GET_OBJECT("maxcolor", mapscript_ce_color, php_style->maxcolor, &php_style->style->maxcolor) 
     else 
     {
         mapscript_throw_exception("Property '%s' does not exist in this object." TSRMLS_CC, property);
@@ -178,6 +215,7 @@ PHP_METHOD(styleObj, __set)
     else IF_SET_DOUBLE("minsize", php_style->style->minsize, value)
     else IF_SET_DOUBLE("maxsize", php_style->style->maxsize, value)
     else IF_SET_DOUBLE("width", php_style->style->width, value)
+    else IF_SET_DOUBLE("outlinewidth", php_style->style->outlinewidth, value)
     else IF_SET_DOUBLE("minwidth", php_style->style->minwidth, value)
     else IF_SET_DOUBLE("maxwidth", php_style->style->maxwidth, value)
     else IF_SET_LONG("offsetx", php_style->style->offsetx, value)
@@ -187,7 +225,33 @@ PHP_METHOD(styleObj, __set)
     else IF_SET_DOUBLE("minvalue", php_style->style->minvalue, value)
     else IF_SET_DOUBLE("maxvalue", php_style->style->maxvalue, value)
     else IF_SET_STRING("rangeitem", php_style->style->rangeitem, value)
-    else IF_SET_LONG("opacity", php_style->style->opacity, value)
+    else IF_SET_LONG("rangeitemindex", php_style->style->rangeitemindex, value)
+    else IF_SET_DOUBLE("gap", php_style->style->gap, value)
+    else IF_SET_LONG("patternlength", php_style->style->patternlength, value)  
+    else IF_SET_LONG("position", php_style->style->position, value)
+    else IF_SET_LONG("linecap", php_style->style->linecap, value)
+    else IF_SET_LONG("linejoin", php_style->style->linejoin, value)
+    else IF_SET_LONG("linejoinmaxsize", php_style->style->linejoinmaxsize, value)
+    else IF_SET_DOUBLE("angle", php_style->style->angle, value)
+    else IF_SET_LONG("autoangle", php_style->style->autoangle, value)
+    else if (STRING_EQUAL("opacity", property))
+    {
+        int alpha;
+        convert_to_long(value);
+        php_style->style->opacity = Z_LVAL_P(value);
+
+        /* apply opacity as the alpha channel color(s) */
+        if(php_style->style->opacity < 100)
+          alpha = MS_NINT(php_style->style->opacity*2.55);
+        else
+            alpha = 255;
+
+        php_style->style->color.alpha = alpha; 
+        php_style->style->outlinecolor.alpha = alpha;
+        php_style->style->backgroundcolor.alpha = alpha;
+        php_style->style->mincolor.alpha = alpha;
+        php_style->style->maxcolor.alpha = alpha;
+    }
     else if (STRING_EQUAL("symbolname", property))
     {
         convert_to_string(value);
@@ -230,10 +294,15 @@ PHP_METHOD(styleObj, __set)
     }
     else if ( (STRING_EQUAL("color", property)) ||
               (STRING_EQUAL("outlinecolor", property)) ||
-              (STRING_EQUAL("backgroundcolor", property)))
+              (STRING_EQUAL("backgroundcolor", property)) ||
+              (STRING_EQUAL("maxcolor", property)) ||
+              (STRING_EQUAL("mincolor", property)))
     {
         mapscript_throw_exception("Property '%s' is an object and can only be modified through its accessors." TSRMLS_CC, property);
     }
+    else if ( (STRING_EQUAL("patternlength", property)))    {
+        mapscript_throw_exception("Property '%s' is read-only and cannot be set." TSRMLS_CC, property);
+    }
     else 
     {
         mapscript_throw_exception("Property '%s' does not exist in this object." TSRMLS_CC, property);
@@ -472,6 +541,83 @@ PHP_METHOD(styleObj, setGeomTransform)
 }
 /* }}} */
 
+/* {{{ proto int style.setpattern(array points)
+   Set the pattern of the style ) */ 
+PHP_METHOD(styleObj, setPattern)
+{
+    zval *zpattern, **ppzval;
+    HashTable *pattern_hash = NULL;
+    zval *zobj = getThis();
+    int index = 0, numelements = 0;
+    php_style_object *php_style;
+
+    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a",
+                              &zpattern) == FAILURE) {
+        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+        return;
+    }
+    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+    
+    php_style = (php_style_object *) zend_object_store_get_object(zobj TSRMLS_CC);
+    pattern_hash = Z_ARRVAL_P(zpattern);
+
+    numelements = zend_hash_num_elements(pattern_hash);
+    if (numelements == 0)
+    {
+        mapscript_report_php_error(E_WARNING, 
+                                   "style->setpoints : invalid array of %d element(s) as parameter." TSRMLS_CC, numelements);
+        RETURN_LONG(MS_FAILURE);
+    }
+
+    for(zend_hash_internal_pointer_reset(pattern_hash); 
+        zend_hash_has_more_elements(pattern_hash) == SUCCESS; 
+        zend_hash_move_forward(pattern_hash))
+    { 
+        
+        zend_hash_get_current_data(pattern_hash, (void **)&ppzval);
+        if (Z_TYPE_PP(ppzval) != IS_LONG)
+            convert_to_long(*ppzval);
+	     
+        php_style->style->pattern[index] = Z_LVAL_PP(ppzval);
+        index++;
+    }
+
+    php_style->style->patternlength = numelements;
+
+    RETURN_LONG(MS_SUCCESS);
+}
+/* }}} */
+
+/* {{{ proto int style.getPatternArray()
+   Returns an array containing the pattern.*/
+PHP_METHOD(styleObj, getPatternArray)
+{
+    zval *zobj = getThis();
+    php_style_object *php_style;
+    int index;
+
+    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
+    if (zend_parse_parameters_none() == FAILURE) {
+        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+        return;
+    }
+    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
+    
+    php_style = (php_style_object *) zend_object_store_get_object(zobj TSRMLS_CC);
+    
+    array_init(return_value);
+    
+    if (php_style->style->patternlength > 0)
+    {
+        for (index=0; index < php_style->style->patternlength; index++)
+        {
+            add_next_index_long(return_value, php_style->style->pattern[index]);
+        }
+    }
+}
+/* }}} */
+
 zend_function_entry style_functions[] = {
     PHP_ME(styleObj, __construct, style___construct_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
     PHP_ME(styleObj, __get, style___get_args, ZEND_ACC_PUBLIC)
@@ -483,6 +629,8 @@ zend_function_entry style_functions[] = {
     PHP_ME(styleObj, removeBinding, style_removeBinding_args, ZEND_ACC_PUBLIC)
     PHP_ME(styleObj, getGeomTransform, NULL, ZEND_ACC_PUBLIC)
     PHP_ME(styleObj, setGeomTransform, style_setGeomTransform_args, ZEND_ACC_PUBLIC)
+    PHP_ME(styleObj, setPattern, style_setPattern_args, ZEND_ACC_PUBLIC) 
+    PHP_ME(styleObj, getPatternArray, NULL, ZEND_ACC_PUBLIC) 
     PHP_ME(styleObj, free, NULL, ZEND_ACC_PUBLIC)
     {NULL, NULL, NULL}
 };
diff --git a/mapscript/php/symbol.c b/mapscript/php/symbol.c
index 2df32a8..72da0f6 100644
--- a/mapscript/php/symbol.c
+++ b/mapscript/php/symbol.c
@@ -51,10 +51,6 @@ ZEND_BEGIN_ARG_INFO_EX(symbol_setPoints_args, 0, 0, 1)
   ZEND_ARG_INFO(0, points)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(symbol_setPattern_args, 0, 0, 1)
-  ZEND_ARG_INFO(0, pattern)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(symbol_setImagePath_args, 0, 0, 1)
   ZEND_ARG_INFO(0, filename)
 ZEND_END_ARG_INFO()
@@ -165,7 +161,6 @@ PHP_METHOD(symbolObj, __set)
     else IF_SET_LONG("antialias", php_symbol->symbol->antialias, value) 
     else IF_SET_STRING("font", php_symbol->symbol->font, value)
     else if ( (STRING_EQUAL("numpoints", property)) ||
-         (STRING_EQUAL("patternlength", property)) ||
          (STRING_EQUAL("imagepath", property)))
     {
         mapscript_throw_exception("Property '%s' is read-only and cannot be set." TSRMLS_CC, property);
diff --git a/mapscript/python/README b/mapscript/python/README
index 1fb5900..c7c1ab2 100644
--- a/mapscript/python/README
+++ b/mapscript/python/README
@@ -1,4 +1,4 @@
-.. $Id: README 6843 2007-09-05 22:49:32Z hobu $
+.. $Id$
 
 Python MapScript for MapServer 5.0 README
 ================================================================
diff --git a/mapscript/python/examples/geocode_addresses.py b/mapscript/python/examples/geocode_addresses.py
index 488335b..7f421f0 100755
--- a/mapscript/python/examples/geocode_addresses.py
+++ b/mapscript/python/examples/geocode_addresses.py
@@ -5,7 +5,7 @@
 # Purpose: simple script to read a csv file, geocode the addresses
 # with the Geocoder API and write to a new shapefile
 #
-# $Id: geocode_addresses.py 9921 2010-03-06 17:08:20Z tomkralidis $
+# $Id$
 #
 
 import sys
diff --git a/mapscript/python/examples/project_csv.py b/mapscript/python/examples/project_csv.py
index d239277..ba58e6c 100755
--- a/mapscript/python/examples/project_csv.py
+++ b/mapscript/python/examples/project_csv.py
@@ -4,7 +4,7 @@
 #
 # Purpose: Simple example to read a csv file and reproject point x/y data
 #
-# $Id: project_csv.py 7900 2008-09-09 02:03:23Z tomkralidis $
+# $Id$
 #
 
 import sys
diff --git a/mapscript/python/mapscript.py b/mapscript/python/mapscript.py
index ccbb828..90573eb 100644
--- a/mapscript/python/mapscript.py
+++ b/mapscript/python/mapscript.py
@@ -1,12 +1,32 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.36
+# Version 1.3.40
 #
-# Don't modify this file, modify the SWIG interface instead.
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
 # This file is compatible with both classic and new-style classes.
 
-import _mapscript
-import new
-new_instancemethod = new.instancemethod
+from sys import version_info
+if version_info >= (2,6,0):
+    def swig_import_helper():
+        from os.path import dirname
+        import imp
+        fp = None
+        try:
+            fp, pathname, description = imp.find_module('_mapscript', [dirname(__file__)])
+        except ImportError:
+            import _mapscript
+            return _mapscript
+        if fp is not None:
+            try:
+                _mod = imp.load_module('_mapscript', fp, pathname, description)
+            finally:
+                fp.close()
+            return _mod
+    _mapscript = swig_import_helper()
+    del swig_import_helper
+else:
+    import _mapscript
+del version_info
 try:
     _swig_property = property
 except NameError:
@@ -14,7 +34,7 @@ except NameError:
 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
     if (name == "thisown"): return self.this.own(value)
     if (name == "this"):
-        if type(value).__name__ == 'PySwigObject':
+        if type(value).__name__ == 'SwigPyObject':
             self.__dict__[name] = value
             return
     method = class_type.__swig_setmethods__.get(name,None)
@@ -31,21 +51,19 @@ def _swig_getattr(self,class_type,name):
     if (name == "thisown"): return self.this.own()
     method = class_type.__swig_getmethods__.get(name,None)
     if method: return method(self)
-    raise AttributeError,name
+    raise AttributeError(name)
 
 def _swig_repr(self):
     try: strthis = "proxy of " + self.this.__repr__()
     except: strthis = ""
     return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
 
-import types
 try:
-    _object = types.ObjectType
+    _object = object
     _newclass = 1
 except AttributeError:
     class _object : pass
     _newclass = 0
-del types
 
 
 class intarray(_object):
@@ -60,13 +78,16 @@ class intarray(_object):
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_intarray
     __del__ = lambda self : None;
-    def __getitem__(*args): return _mapscript.intarray___getitem__(*args)
-    def __setitem__(*args): return _mapscript.intarray___setitem__(*args)
-    def cast(*args): return _mapscript.intarray_cast(*args)
+    def __getitem__(self, *args): return _mapscript.intarray___getitem__(self, *args)
+    def __setitem__(self, *args): return _mapscript.intarray___setitem__(self, *args)
+    def cast(self): return _mapscript.intarray_cast(self)
     __swig_getmethods__["frompointer"] = lambda x: _mapscript.intarray_frompointer
     if _newclass:frompointer = staticmethod(_mapscript.intarray_frompointer)
 intarray_swigregister = _mapscript.intarray_swigregister
 intarray_swigregister(intarray)
+
+def intarray_frompointer(*args):
+  return _mapscript.intarray_frompointer(*args)
 intarray_frompointer = _mapscript.intarray_frompointer
 
 MapServerError = _mapscript.MapServerError
@@ -257,8 +278,8 @@ class fontSetObj(_object):
     if _newclass:numfonts = _swig_property(_mapscript.fontSetObj_numfonts_get)
     __swig_getmethods__["fonts"] = _mapscript.fontSetObj_fonts_get
     if _newclass:fonts = _swig_property(_mapscript.fontSetObj_fonts_get)
-    def __init__(self, *args): 
-        this = _mapscript.new_fontSetObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_fontSetObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_fontSetObj
@@ -323,13 +344,13 @@ class clusterObj(_object):
     __swig_setmethods__["region"] = _mapscript.clusterObj_region_set
     __swig_getmethods__["region"] = _mapscript.clusterObj_region_get
     if _newclass:region = _swig_property(_mapscript.clusterObj_region_get, _mapscript.clusterObj_region_set)
-    def updateFromString(*args): return _mapscript.clusterObj_updateFromString(*args)
-    def setGroup(*args): return _mapscript.clusterObj_setGroup(*args)
-    def getGroupString(*args): return _mapscript.clusterObj_getGroupString(*args)
-    def setFilter(*args): return _mapscript.clusterObj_setFilter(*args)
-    def getFilterString(*args): return _mapscript.clusterObj_getFilterString(*args)
-    def __init__(self, *args): 
-        this = _mapscript.new_clusterObj(*args)
+    def updateFromString(self, *args): return _mapscript.clusterObj_updateFromString(self, *args)
+    def setGroup(self, *args): return _mapscript.clusterObj_setGroup(self, *args)
+    def getGroupString(self): return _mapscript.clusterObj_getGroupString(self)
+    def setFilter(self, *args): return _mapscript.clusterObj_setFilter(self, *args)
+    def getFilterString(self): return _mapscript.clusterObj_getFilterString(self)
+    def __init__(self): 
+        this = _mapscript.new_clusterObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_clusterObj
@@ -385,12 +406,12 @@ class outputFormatObj(_object):
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_outputFormatObj
     __del__ = lambda self : None;
-    def setExtension(*args): return _mapscript.outputFormatObj_setExtension(*args)
-    def setMimetype(*args): return _mapscript.outputFormatObj_setMimetype(*args)
-    def setOption(*args): return _mapscript.outputFormatObj_setOption(*args)
-    def validate(*args): return _mapscript.outputFormatObj_validate(*args)
-    def getOption(*args): return _mapscript.outputFormatObj_getOption(*args)
-    def attachDevice(*args): return _mapscript.outputFormatObj_attachDevice(*args)
+    def setExtension(self, *args): return _mapscript.outputFormatObj_setExtension(self, *args)
+    def setMimetype(self, *args): return _mapscript.outputFormatObj_setMimetype(self, *args)
+    def setOption(self, *args): return _mapscript.outputFormatObj_setOption(self, *args)
+    def validate(self): return _mapscript.outputFormatObj_validate(self)
+    def getOption(self, *args): return _mapscript.outputFormatObj_getOption(self, *args)
+    def attachDevice(self, *args): return _mapscript.outputFormatObj_attachDevice(self, *args)
 outputFormatObj_swigregister = _mapscript.outputFormatObj_swigregister
 outputFormatObj_swigregister(outputFormatObj)
 
@@ -416,9 +437,9 @@ class queryMapObj(_object):
     __swig_setmethods__["color"] = _mapscript.queryMapObj_color_set
     __swig_getmethods__["color"] = _mapscript.queryMapObj_color_get
     if _newclass:color = _swig_property(_mapscript.queryMapObj_color_get, _mapscript.queryMapObj_color_set)
-    def updateFromString(*args): return _mapscript.queryMapObj_updateFromString(*args)
-    def __init__(self, *args): 
-        this = _mapscript.new_queryMapObj(*args)
+    def updateFromString(self, *args): return _mapscript.queryMapObj_updateFromString(self, *args)
+    def __init__(self): 
+        this = _mapscript.new_queryMapObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_queryMapObj
@@ -489,13 +510,13 @@ class webObj(_object):
     if _newclass:metadata = _swig_property(_mapscript.webObj_metadata_get)
     __swig_getmethods__["validation"] = _mapscript.webObj_validation_get
     if _newclass:validation = _swig_property(_mapscript.webObj_validation_get)
-    def __init__(self, *args): 
-        this = _mapscript.new_webObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_webObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_webObj
     __del__ = lambda self : None;
-    def updateFromString(*args): return _mapscript.webObj_updateFromString(*args)
+    def updateFromString(self, *args): return _mapscript.webObj_updateFromString(self, *args)
 webObj_swigregister = _mapscript.webObj_swigregister
 webObj_swigregister(webObj)
 
@@ -606,20 +627,20 @@ class styleObj(_object):
     __swig_setmethods__["maxscaledenom"] = _mapscript.styleObj_maxscaledenom_set
     __swig_getmethods__["maxscaledenom"] = _mapscript.styleObj_maxscaledenom_get
     if _newclass:maxscaledenom = _swig_property(_mapscript.styleObj_maxscaledenom_get, _mapscript.styleObj_maxscaledenom_set)
-    def __init__(self, *args): 
-        this = _mapscript.new_styleObj(*args)
+    def __init__(self, parent_class = None): 
+        this = _mapscript.new_styleObj(parent_class)
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_styleObj
     __del__ = lambda self : None;
-    def updateFromString(*args): return _mapscript.styleObj_updateFromString(*args)
-    def clone(*args): return _mapscript.styleObj_clone(*args)
-    def setSymbolByName(*args): return _mapscript.styleObj_setSymbolByName(*args)
-    def removeBinding(*args): return _mapscript.styleObj_removeBinding(*args)
-    def setBinding(*args): return _mapscript.styleObj_setBinding(*args)
-    def getBinding(*args): return _mapscript.styleObj_getBinding(*args)
-    def getGeomTransform(*args): return _mapscript.styleObj_getGeomTransform(*args)
-    def setGeomTransform(*args): return _mapscript.styleObj_setGeomTransform(*args)
+    def updateFromString(self, *args): return _mapscript.styleObj_updateFromString(self, *args)
+    def clone(self): return _mapscript.styleObj_clone(self)
+    def setSymbolByName(self, *args): return _mapscript.styleObj_setSymbolByName(self, *args)
+    def removeBinding(self, *args): return _mapscript.styleObj_removeBinding(self, *args)
+    def setBinding(self, *args): return _mapscript.styleObj_setBinding(self, *args)
+    def getBinding(self, *args): return _mapscript.styleObj_getBinding(self, *args)
+    def getGeomTransform(self): return _mapscript.styleObj_getGeomTransform(self)
+    def setGeomTransform(self, *args): return _mapscript.styleObj_setGeomTransform(self, *args)
 styleObj_swigregister = _mapscript.styleObj_swigregister
 styleObj_swigregister(styleObj)
 
@@ -734,12 +755,17 @@ class labelObj(_object):
     __swig_setmethods__["numstyles"] = _mapscript.labelObj_numstyles_set
     __swig_getmethods__["numstyles"] = _mapscript.labelObj_numstyles_get
     if _newclass:numstyles = _swig_property(_mapscript.labelObj_numstyles_get, _mapscript.labelObj_numstyles_set)
-    def updateFromString(*args): return _mapscript.labelObj_updateFromString(*args)
-    def removeBinding(*args): return _mapscript.labelObj_removeBinding(*args)
-    def getBinding(*args): return _mapscript.labelObj_getBinding(*args)
-    def setBinding(*args): return _mapscript.labelObj_setBinding(*args)
-    def __init__(self, *args): 
-        this = _mapscript.new_labelObj(*args)
+    def updateFromString(self, *args): return _mapscript.labelObj_updateFromString(self, *args)
+    def removeBinding(self, *args): return _mapscript.labelObj_removeBinding(self, *args)
+    def getBinding(self, *args): return _mapscript.labelObj_getBinding(self, *args)
+    def setBinding(self, *args): return _mapscript.labelObj_setBinding(self, *args)
+    def getStyle(self, *args): return _mapscript.labelObj_getStyle(self, *args)
+    def insertStyle(self, *args): return _mapscript.labelObj_insertStyle(self, *args)
+    def removeStyle(self, *args): return _mapscript.labelObj_removeStyle(self, *args)
+    def moveStyleUp(self, *args): return _mapscript.labelObj_moveStyleUp(self, *args)
+    def moveStyleDown(self, *args): return _mapscript.labelObj_moveStyleDown(self, *args)
+    def __init__(self): 
+        this = _mapscript.new_labelObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_labelObj
@@ -799,35 +825,42 @@ class classObj(_object):
     __swig_setmethods__["group"] = _mapscript.classObj_group_set
     __swig_getmethods__["group"] = _mapscript.classObj_group_get
     if _newclass:group = _swig_property(_mapscript.classObj_group_get, _mapscript.classObj_group_set)
-    def __init__(self, *args): 
-        this = _mapscript.new_classObj(*args)
+    def __init__(self, layer = None): 
+        this = _mapscript.new_classObj(layer)
         try: self.this.append(this)
         except: self.this = this
         if 1:
-	   if args and len(args)!=0:
-		self.p_layer=args[0]
-	   else:
-		self.p_layer=None
+                    self.p_layer =None
+                    try:
+                        # python 2.5
+                        if args and len(args)!=0: 
+                            self.p_layer=args[0]
+                    except NameError:
+                        # python 2.6
+                        if layer: 
+                            self.p_layer=layer
+               
+
 
     __swig_destroy__ = _mapscript.delete_classObj
     __del__ = lambda self : None;
-    def updateFromString(*args): return _mapscript.classObj_updateFromString(*args)
-    def clone(*args): return _mapscript.classObj_clone(*args)
-    def setExpression(*args): return _mapscript.classObj_setExpression(*args)
-    def getExpressionString(*args): return _mapscript.classObj_getExpressionString(*args)
-    def setText(*args): return _mapscript.classObj_setText(*args)
-    def getTextString(*args): return _mapscript.classObj_getTextString(*args)
-    def getMetaData(*args): return _mapscript.classObj_getMetaData(*args)
-    def setMetaData(*args): return _mapscript.classObj_setMetaData(*args)
-    def getFirstMetaDataKey(*args): return _mapscript.classObj_getFirstMetaDataKey(*args)
-    def getNextMetaDataKey(*args): return _mapscript.classObj_getNextMetaDataKey(*args)
-    def drawLegendIcon(*args): return _mapscript.classObj_drawLegendIcon(*args)
-    def createLegendIcon(*args): return _mapscript.classObj_createLegendIcon(*args)
-    def getStyle(*args): return _mapscript.classObj_getStyle(*args)
-    def insertStyle(*args): return _mapscript.classObj_insertStyle(*args)
-    def removeStyle(*args): return _mapscript.classObj_removeStyle(*args)
-    def moveStyleUp(*args): return _mapscript.classObj_moveStyleUp(*args)
-    def moveStyleDown(*args): return _mapscript.classObj_moveStyleDown(*args)
+    def updateFromString(self, *args): return _mapscript.classObj_updateFromString(self, *args)
+    def clone(self): return _mapscript.classObj_clone(self)
+    def setExpression(self, *args): return _mapscript.classObj_setExpression(self, *args)
+    def getExpressionString(self): return _mapscript.classObj_getExpressionString(self)
+    def setText(self, *args): return _mapscript.classObj_setText(self, *args)
+    def getTextString(self): return _mapscript.classObj_getTextString(self)
+    def getMetaData(self, *args): return _mapscript.classObj_getMetaData(self, *args)
+    def setMetaData(self, *args): return _mapscript.classObj_setMetaData(self, *args)
+    def getFirstMetaDataKey(self): return _mapscript.classObj_getFirstMetaDataKey(self)
+    def getNextMetaDataKey(self, *args): return _mapscript.classObj_getNextMetaDataKey(self, *args)
+    def drawLegendIcon(self, *args): return _mapscript.classObj_drawLegendIcon(self, *args)
+    def createLegendIcon(self, *args): return _mapscript.classObj_createLegendIcon(self, *args)
+    def getStyle(self, *args): return _mapscript.classObj_getStyle(self, *args)
+    def insertStyle(self, *args): return _mapscript.classObj_insertStyle(self, *args)
+    def removeStyle(self, *args): return _mapscript.classObj_removeStyle(self, *args)
+    def moveStyleUp(self, *args): return _mapscript.classObj_moveStyleUp(self, *args)
+    def moveStyleDown(self, *args): return _mapscript.classObj_moveStyleDown(self, *args)
 classObj_swigregister = _mapscript.classObj_swigregister
 classObj_swigregister(classObj)
 
@@ -865,8 +898,8 @@ class labelCacheMemberObj(_object):
     if _newclass:status = _swig_property(_mapscript.labelCacheMemberObj_status_get)
     __swig_getmethods__["markerid"] = _mapscript.labelCacheMemberObj_markerid_get
     if _newclass:markerid = _swig_property(_mapscript.labelCacheMemberObj_markerid_get)
-    def __init__(self, *args): 
-        this = _mapscript.new_labelCacheMemberObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_labelCacheMemberObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_labelCacheMemberObj
@@ -884,8 +917,8 @@ class markerCacheMemberObj(_object):
     if _newclass:id = _swig_property(_mapscript.markerCacheMemberObj_id_get)
     __swig_getmethods__["poly"] = _mapscript.markerCacheMemberObj_poly_get
     if _newclass:poly = _swig_property(_mapscript.markerCacheMemberObj_poly_get)
-    def __init__(self, *args): 
-        this = _mapscript.new_markerCacheMemberObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_markerCacheMemberObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_markerCacheMemberObj
@@ -911,8 +944,8 @@ class labelCacheSlotObj(_object):
     if _newclass:nummarkers = _swig_property(_mapscript.labelCacheSlotObj_nummarkers_get)
     __swig_getmethods__["markercachesize"] = _mapscript.labelCacheSlotObj_markercachesize_get
     if _newclass:markercachesize = _swig_property(_mapscript.labelCacheSlotObj_markercachesize_get)
-    def __init__(self, *args): 
-        this = _mapscript.new_labelCacheSlotObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_labelCacheSlotObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_labelCacheSlotObj
@@ -930,9 +963,9 @@ class labelCacheObj(_object):
     if _newclass:slots = _swig_property(_mapscript.labelCacheObj_slots_get)
     __swig_getmethods__["numlabels"] = _mapscript.labelCacheObj_numlabels_get
     if _newclass:numlabels = _swig_property(_mapscript.labelCacheObj_numlabels_get)
-    def freeCache(*args): return _mapscript.labelCacheObj_freeCache(*args)
-    def __init__(self, *args): 
-        this = _mapscript.new_labelCacheObj(*args)
+    def freeCache(self): return _mapscript.labelCacheObj_freeCache(self)
+    def __init__(self): 
+        this = _mapscript.new_labelCacheObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_labelCacheObj
@@ -976,9 +1009,9 @@ class resultCacheObj(_object):
     __swig_setmethods__["usegetshape"] = _mapscript.resultCacheObj_usegetshape_set
     __swig_getmethods__["usegetshape"] = _mapscript.resultCacheObj_usegetshape_get
     if _newclass:usegetshape = _swig_property(_mapscript.resultCacheObj_usegetshape_get, _mapscript.resultCacheObj_usegetshape_set)
-    def getResult(*args): return _mapscript.resultCacheObj_getResult(*args)
-    def __init__(self, *args): 
-        this = _mapscript.new_resultCacheObj(*args)
+    def getResult(self, *args): return _mapscript.resultCacheObj_getResult(self, *args)
+    def __init__(self): 
+        this = _mapscript.new_resultCacheObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_resultCacheObj
@@ -1002,18 +1035,18 @@ class symbolSetObj(_object):
     if _newclass:numsymbols = _swig_property(_mapscript.symbolSetObj_numsymbols_get)
     __swig_getmethods__["maxsymbols"] = _mapscript.symbolSetObj_maxsymbols_get
     if _newclass:maxsymbols = _swig_property(_mapscript.symbolSetObj_maxsymbols_get)
-    def __init__(self, *args): 
-        this = _mapscript.new_symbolSetObj(*args)
+    def __init__(self, symbolfile = None): 
+        this = _mapscript.new_symbolSetObj(symbolfile)
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_symbolSetObj
     __del__ = lambda self : None;
-    def getSymbol(*args): return _mapscript.symbolSetObj_getSymbol(*args)
-    def getSymbolByName(*args): return _mapscript.symbolSetObj_getSymbolByName(*args)
-    def index(*args): return _mapscript.symbolSetObj_index(*args)
-    def appendSymbol(*args): return _mapscript.symbolSetObj_appendSymbol(*args)
-    def removeSymbol(*args): return _mapscript.symbolSetObj_removeSymbol(*args)
-    def save(*args): return _mapscript.symbolSetObj_save(*args)
+    def getSymbol(self, *args): return _mapscript.symbolSetObj_getSymbol(self, *args)
+    def getSymbolByName(self, *args): return _mapscript.symbolSetObj_getSymbolByName(self, *args)
+    def index(self, *args): return _mapscript.symbolSetObj_index(self, *args)
+    def appendSymbol(self, *args): return _mapscript.symbolSetObj_appendSymbol(self, *args)
+    def removeSymbol(self, *args): return _mapscript.symbolSetObj_removeSymbol(self, *args)
+    def save(self, *args): return _mapscript.symbolSetObj_save(self, *args)
 symbolSetObj_swigregister = _mapscript.symbolSetObj_swigregister
 symbolSetObj_swigregister(symbolSetObj)
 
@@ -1061,9 +1094,9 @@ class referenceMapObj(_object):
     if _newclass:maxboxsize = _swig_property(_mapscript.referenceMapObj_maxboxsize_get, _mapscript.referenceMapObj_maxboxsize_set)
     __swig_getmethods__["map"] = _mapscript.referenceMapObj_map_get
     if _newclass:map = _swig_property(_mapscript.referenceMapObj_map_get)
-    def updateFromString(*args): return _mapscript.referenceMapObj_updateFromString(*args)
-    def __init__(self, *args): 
-        this = _mapscript.new_referenceMapObj(*args)
+    def updateFromString(self, *args): return _mapscript.referenceMapObj_updateFromString(self, *args)
+    def __init__(self): 
+        this = _mapscript.new_referenceMapObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_referenceMapObj
@@ -1119,9 +1152,9 @@ class scalebarObj(_object):
     __swig_setmethods__["align"] = _mapscript.scalebarObj_align_set
     __swig_getmethods__["align"] = _mapscript.scalebarObj_align_get
     if _newclass:align = _swig_property(_mapscript.scalebarObj_align_get, _mapscript.scalebarObj_align_set)
-    def updateFromString(*args): return _mapscript.scalebarObj_updateFromString(*args)
-    def __init__(self, *args): 
-        this = _mapscript.new_scalebarObj(*args)
+    def updateFromString(self, *args): return _mapscript.scalebarObj_updateFromString(self, *args)
+    def __init__(self): 
+        this = _mapscript.new_scalebarObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_scalebarObj
@@ -1175,9 +1208,9 @@ class legendObj(_object):
     if _newclass:template = _swig_property(_mapscript.legendObj_template_get, _mapscript.legendObj_template_set)
     __swig_getmethods__["map"] = _mapscript.legendObj_map_get
     if _newclass:map = _swig_property(_mapscript.legendObj_map_get)
-    def updateFromString(*args): return _mapscript.legendObj_updateFromString(*args)
-    def __init__(self, *args): 
-        this = _mapscript.new_legendObj(*args)
+    def updateFromString(self, *args): return _mapscript.legendObj_updateFromString(self, *args)
+    def __init__(self): 
+        this = _mapscript.new_legendObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_legendObj
@@ -1346,34 +1379,41 @@ class layerObj(_object):
     __swig_setmethods__["classgroup"] = _mapscript.layerObj_classgroup_set
     __swig_getmethods__["classgroup"] = _mapscript.layerObj_classgroup_get
     if _newclass:classgroup = _swig_property(_mapscript.layerObj_classgroup_get, _mapscript.layerObj_classgroup_set)
-    def __init__(self, *args): 
-        this = _mapscript.new_layerObj(*args)
+    def __init__(self, map = None): 
+        this = _mapscript.new_layerObj(map)
         try: self.this.append(this)
         except: self.this = this
         if 1:
-	  if args and len(args)!=0:
-		self.p_map=args[0]
-	  else:
-		self.p_map=None
+                    self.p_map=None
+                    try:
+                        # python 2.5
+                        if args and len(args)!=0: 
+                            self.p_map=args[0]
+                    except NameError:
+                        # python 2.6
+                        if map: 
+                            self.p_map=map
+               
+
 
     __swig_destroy__ = _mapscript.delete_layerObj
     __del__ = lambda self : None;
-    def clone(*args): return _mapscript.layerObj_clone(*args)
-    def updateFromString(*args): return _mapscript.layerObj_updateFromString(*args)
+    def clone(self): return _mapscript.layerObj_clone(self)
+    def updateFromString(self, *args): return _mapscript.layerObj_updateFromString(self, *args)
     def insertClass(*args):
            actualIndex=_mapscript.layerObj_insertClass(*args)
            args[1].p_layer=args[0]
            return actualIndex
 
-    def removeClass(*args): return _mapscript.layerObj_removeClass(*args)
-    def open(*args): return _mapscript.layerObj_open(*args)
-    def whichShapes(*args): return _mapscript.layerObj_whichShapes(*args)
-    def nextShape(*args): return _mapscript.layerObj_nextShape(*args)
-    def close(*args): return _mapscript.layerObj_close(*args)
-    def getShape(*args): return _mapscript.layerObj_getShape(*args)
-    def getNumResults(*args): return _mapscript.layerObj_getNumResults(*args)
-    def getResultsBounds(*args): return _mapscript.layerObj_getResultsBounds(*args)
-    def getResult(*args): return _mapscript.layerObj_getResult(*args)
+    def removeClass(self, *args): return _mapscript.layerObj_removeClass(self, *args)
+    def open(self): return _mapscript.layerObj_open(self)
+    def whichShapes(self, *args): return _mapscript.layerObj_whichShapes(self, *args)
+    def nextShape(self): return _mapscript.layerObj_nextShape(self)
+    def close(self): return _mapscript.layerObj_close(self)
+    def getShape(self, *args): return _mapscript.layerObj_getShape(self, *args)
+    def getNumResults(self): return _mapscript.layerObj_getNumResults(self)
+    def getResultsBounds(self): return _mapscript.layerObj_getResultsBounds(self)
+    def getResult(self, *args): return _mapscript.layerObj_getResult(self, *args)
     def getClass(*args):
     	clazz = _mapscript.layerObj_getClass(*args)
     	if clazz:
@@ -1383,47 +1423,47 @@ class layerObj(_object):
     			clazz.p_layer=None
     	return clazz
 
-    def getItem(*args): return _mapscript.layerObj_getItem(*args)
-    def draw(*args): return _mapscript.layerObj_draw(*args)
-    def drawQuery(*args): return _mapscript.layerObj_drawQuery(*args)
-    def queryByFilter(*args): return _mapscript.layerObj_queryByFilter(*args)
-    def queryByAttributes(*args): return _mapscript.layerObj_queryByAttributes(*args)
-    def queryByPoint(*args): return _mapscript.layerObj_queryByPoint(*args)
-    def queryByRect(*args): return _mapscript.layerObj_queryByRect(*args)
-    def queryByFeatures(*args): return _mapscript.layerObj_queryByFeatures(*args)
-    def queryByShape(*args): return _mapscript.layerObj_queryByShape(*args)
-    def queryByIndex(*args): return _mapscript.layerObj_queryByIndex(*args)
-    def getResults(*args): return _mapscript.layerObj_getResults(*args)
-    def setFilter(*args): return _mapscript.layerObj_setFilter(*args)
-    def getFilterString(*args): return _mapscript.layerObj_getFilterString(*args)
-    def setWKTProjection(*args): return _mapscript.layerObj_setWKTProjection(*args)
-    def getProjection(*args): return _mapscript.layerObj_getProjection(*args)
-    def setProjection(*args): return _mapscript.layerObj_setProjection(*args)
-    def addFeature(*args): return _mapscript.layerObj_addFeature(*args)
-    def getNumFeatures(*args): return _mapscript.layerObj_getNumFeatures(*args)
-    def getExtent(*args): return _mapscript.layerObj_getExtent(*args)
-    def setExtent(*args): return _mapscript.layerObj_setExtent(*args)
-    def getMetaData(*args): return _mapscript.layerObj_getMetaData(*args)
-    def setMetaData(*args): return _mapscript.layerObj_setMetaData(*args)
-    def removeMetaData(*args): return _mapscript.layerObj_removeMetaData(*args)
-    def getFirstMetaDataKey(*args): return _mapscript.layerObj_getFirstMetaDataKey(*args)
-    def getNextMetaDataKey(*args): return _mapscript.layerObj_getNextMetaDataKey(*args)
-    def getWMSFeatureInfoURL(*args): return _mapscript.layerObj_getWMSFeatureInfoURL(*args)
-    def executeWFSGetFeature(*args): return _mapscript.layerObj_executeWFSGetFeature(*args)
-    def applySLD(*args): return _mapscript.layerObj_applySLD(*args)
-    def applySLDURL(*args): return _mapscript.layerObj_applySLDURL(*args)
-    def generateSLD(*args): return _mapscript.layerObj_generateSLD(*args)
-    def isVisible(*args): return _mapscript.layerObj_isVisible(*args)
-    def moveClassUp(*args): return _mapscript.layerObj_moveClassUp(*args)
-    def moveClassDown(*args): return _mapscript.layerObj_moveClassDown(*args)
-    def setProcessingKey(*args): return _mapscript.layerObj_setProcessingKey(*args)
-    def setProcessing(*args): return _mapscript.layerObj_setProcessing(*args)
-    def addProcessing(*args): return _mapscript.layerObj_addProcessing(*args)
-    def getProcessing(*args): return _mapscript.layerObj_getProcessing(*args)
-    def getProcessingKey(*args): return _mapscript.layerObj_getProcessingKey(*args)
-    def clearProcessing(*args): return _mapscript.layerObj_clearProcessing(*args)
-    def setConnectionType(*args): return _mapscript.layerObj_setConnectionType(*args)
-    def getClassIndex(*args): return _mapscript.layerObj_getClassIndex(*args)
+    def getItem(self, *args): return _mapscript.layerObj_getItem(self, *args)
+    def draw(self, *args): return _mapscript.layerObj_draw(self, *args)
+    def drawQuery(self, *args): return _mapscript.layerObj_drawQuery(self, *args)
+    def queryByFilter(self, *args): return _mapscript.layerObj_queryByFilter(self, *args)
+    def queryByAttributes(self, *args): return _mapscript.layerObj_queryByAttributes(self, *args)
+    def queryByPoint(self, *args): return _mapscript.layerObj_queryByPoint(self, *args)
+    def queryByRect(self, *args): return _mapscript.layerObj_queryByRect(self, *args)
+    def queryByFeatures(self, *args): return _mapscript.layerObj_queryByFeatures(self, *args)
+    def queryByShape(self, *args): return _mapscript.layerObj_queryByShape(self, *args)
+    def queryByIndex(self, *args): return _mapscript.layerObj_queryByIndex(self, *args)
+    def getResults(self, *args): return _mapscript.layerObj_getResults(self, *args)
+    def setFilter(self, *args): return _mapscript.layerObj_setFilter(self, *args)
+    def getFilterString(self): return _mapscript.layerObj_getFilterString(self)
+    def setWKTProjection(self, *args): return _mapscript.layerObj_setWKTProjection(self, *args)
+    def getProjection(self): return _mapscript.layerObj_getProjection(self)
+    def setProjection(self, *args): return _mapscript.layerObj_setProjection(self, *args)
+    def addFeature(self, *args): return _mapscript.layerObj_addFeature(self, *args)
+    def getNumFeatures(self): return _mapscript.layerObj_getNumFeatures(self)
+    def getExtent(self): return _mapscript.layerObj_getExtent(self)
+    def setExtent(self, *args): return _mapscript.layerObj_setExtent(self, *args)
+    def getMetaData(self, *args): return _mapscript.layerObj_getMetaData(self, *args)
+    def setMetaData(self, *args): return _mapscript.layerObj_setMetaData(self, *args)
+    def removeMetaData(self, *args): return _mapscript.layerObj_removeMetaData(self, *args)
+    def getFirstMetaDataKey(self): return _mapscript.layerObj_getFirstMetaDataKey(self)
+    def getNextMetaDataKey(self, *args): return _mapscript.layerObj_getNextMetaDataKey(self, *args)
+    def getWMSFeatureInfoURL(self, *args): return _mapscript.layerObj_getWMSFeatureInfoURL(self, *args)
+    def executeWFSGetFeature(self, *args): return _mapscript.layerObj_executeWFSGetFeature(self, *args)
+    def applySLD(self, *args): return _mapscript.layerObj_applySLD(self, *args)
+    def applySLDURL(self, *args): return _mapscript.layerObj_applySLDURL(self, *args)
+    def generateSLD(self): return _mapscript.layerObj_generateSLD(self)
+    def isVisible(self): return _mapscript.layerObj_isVisible(self)
+    def moveClassUp(self, *args): return _mapscript.layerObj_moveClassUp(self, *args)
+    def moveClassDown(self, *args): return _mapscript.layerObj_moveClassDown(self, *args)
+    def setProcessingKey(self, *args): return _mapscript.layerObj_setProcessingKey(self, *args)
+    def setProcessing(self, *args): return _mapscript.layerObj_setProcessing(self, *args)
+    def addProcessing(self, *args): return _mapscript.layerObj_addProcessing(self, *args)
+    def getProcessing(self, *args): return _mapscript.layerObj_getProcessing(self, *args)
+    def getProcessingKey(self, *args): return _mapscript.layerObj_getProcessingKey(self, *args)
+    def clearProcessing(self): return _mapscript.layerObj_clearProcessing(self)
+    def setConnectionType(self, *args): return _mapscript.layerObj_setConnectionType(self, *args)
+    def getClassIndex(self, *args): return _mapscript.layerObj_getClassIndex(self, *args)
 layerObj_swigregister = _mapscript.layerObj_swigregister
 layerObj_swigregister(layerObj)
 
@@ -1528,25 +1568,25 @@ class mapObj(_object):
     if _newclass:templatepattern = _swig_property(_mapscript.mapObj_templatepattern_get, _mapscript.mapObj_templatepattern_set)
     __swig_getmethods__["configoptions"] = _mapscript.mapObj_configoptions_get
     if _newclass:configoptions = _swig_property(_mapscript.mapObj_configoptions_get)
-    def __init__(self, *args): 
-        this = _mapscript.new_mapObj(*args)
+    def __init__(self, filename = ""): 
+        this = _mapscript.new_mapObj(filename)
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_mapObj
     __del__ = lambda self : None;
-    def clone(*args): return _mapscript.mapObj_clone(*args)
+    def clone(self): return _mapscript.mapObj_clone(self)
     def insertLayer(*args):
            actualIndex=_mapscript.mapObj_insertLayer(*args)
            args[1].p_map=args[0]
            return actualIndex
 
-    def removeLayer(*args): return _mapscript.mapObj_removeLayer(*args)
-    def setExtent(*args): return _mapscript.mapObj_setExtent(*args)
-    def offsetExtent(*args): return _mapscript.mapObj_offsetExtent(*args)
-    def scaleExtent(*args): return _mapscript.mapObj_scaleExtent(*args)
-    def setCenter(*args): return _mapscript.mapObj_setCenter(*args)
-    def setSize(*args): return _mapscript.mapObj_setSize(*args)
-    def setRotation(*args): return _mapscript.mapObj_setRotation(*args)
+    def removeLayer(self, *args): return _mapscript.mapObj_removeLayer(self, *args)
+    def setExtent(self, *args): return _mapscript.mapObj_setExtent(self, *args)
+    def offsetExtent(self, *args): return _mapscript.mapObj_offsetExtent(self, *args)
+    def scaleExtent(self, *args): return _mapscript.mapObj_scaleExtent(self, *args)
+    def setCenter(self, *args): return _mapscript.mapObj_setCenter(self, *args)
+    def setSize(self, *args): return _mapscript.mapObj_setSize(self, *args)
+    def setRotation(self, *args): return _mapscript.mapObj_setRotation(self, *args)
     def getLayer(*args):
     	layer = _mapscript.mapObj_getLayer(*args)
     	if layer:
@@ -1565,69 +1605,69 @@ class mapObj(_object):
     			layer.p_map=None
     	return layer
 
-    def getSymbolByName(*args): return _mapscript.mapObj_getSymbolByName(*args)
-    def prepareQuery(*args): return _mapscript.mapObj_prepareQuery(*args)
-    def prepareImage(*args): return _mapscript.mapObj_prepareImage(*args)
-    def setImageType(*args): return _mapscript.mapObj_setImageType(*args)
-    def selectOutputFormat(*args): return _mapscript.mapObj_selectOutputFormat(*args)
-    def setOutputFormat(*args): return _mapscript.mapObj_setOutputFormat(*args)
-    def draw(*args): return _mapscript.mapObj_draw(*args)
-    def drawQuery(*args): return _mapscript.mapObj_drawQuery(*args)
-    def drawLegend(*args): return _mapscript.mapObj_drawLegend(*args)
-    def drawScalebar(*args): return _mapscript.mapObj_drawScalebar(*args)
-    def drawReferenceMap(*args): return _mapscript.mapObj_drawReferenceMap(*args)
-    def embedScalebar(*args): return _mapscript.mapObj_embedScalebar(*args)
-    def embedLegend(*args): return _mapscript.mapObj_embedLegend(*args)
-    def drawLabelCache(*args): return _mapscript.mapObj_drawLabelCache(*args)
-    def getLabel(*args): return _mapscript.mapObj_getLabel(*args)
-    def nextLabel(*args): return _mapscript.mapObj_nextLabel(*args)
-    def queryByFilter(*args): return _mapscript.mapObj_queryByFilter(*args)
-    def queryByPoint(*args): return _mapscript.mapObj_queryByPoint(*args)
-    def queryByRect(*args): return _mapscript.mapObj_queryByRect(*args)
-    def queryByFeatures(*args): return _mapscript.mapObj_queryByFeatures(*args)
-    def queryByShape(*args): return _mapscript.mapObj_queryByShape(*args)
-    def setWKTProjection(*args): return _mapscript.mapObj_setWKTProjection(*args)
-    def getProjection(*args): return _mapscript.mapObj_getProjection(*args)
-    def setProjection(*args): return _mapscript.mapObj_setProjection(*args)
-    def save(*args): return _mapscript.mapObj_save(*args)
-    def saveQuery(*args): return _mapscript.mapObj_saveQuery(*args)
-    def loadQuery(*args): return _mapscript.mapObj_loadQuery(*args)
-    def freeQuery(*args): return _mapscript.mapObj_freeQuery(*args)
-    def saveQueryAsGML(*args): return _mapscript.mapObj_saveQueryAsGML(*args)
-    def getMetaData(*args): return _mapscript.mapObj_getMetaData(*args)
-    def setMetaData(*args): return _mapscript.mapObj_setMetaData(*args)
-    def removeMetaData(*args): return _mapscript.mapObj_removeMetaData(*args)
-    def getFirstMetaDataKey(*args): return _mapscript.mapObj_getFirstMetaDataKey(*args)
-    def getNextMetaDataKey(*args): return _mapscript.mapObj_getNextMetaDataKey(*args)
-    def setSymbolSet(*args): return _mapscript.mapObj_setSymbolSet(*args)
-    def getNumSymbols(*args): return _mapscript.mapObj_getNumSymbols(*args)
-    def setFontSet(*args): return _mapscript.mapObj_setFontSet(*args)
-    def saveMapContext(*args): return _mapscript.mapObj_saveMapContext(*args)
-    def loadMapContext(*args): return _mapscript.mapObj_loadMapContext(*args)
-    def moveLayerUp(*args): return _mapscript.mapObj_moveLayerUp(*args)
-    def moveLayerDown(*args): return _mapscript.mapObj_moveLayerDown(*args)
-    def getLayersDrawingOrder(*args): return _mapscript.mapObj_getLayersDrawingOrder(*args)
-    def setLayersDrawingOrder(*args): return _mapscript.mapObj_setLayersDrawingOrder(*args)
-    def setConfigOption(*args): return _mapscript.mapObj_setConfigOption(*args)
-    def getConfigOption(*args): return _mapscript.mapObj_getConfigOption(*args)
-    def applyConfigOptions(*args): return _mapscript.mapObj_applyConfigOptions(*args)
-    def applySLD(*args): return _mapscript.mapObj_applySLD(*args)
-    def applySLDURL(*args): return _mapscript.mapObj_applySLDURL(*args)
-    def generateSLD(*args): return _mapscript.mapObj_generateSLD(*args)
-    def processTemplate(*args): return _mapscript.mapObj_processTemplate(*args)
-    def processLegendTemplate(*args): return _mapscript.mapObj_processLegendTemplate(*args)
-    def processQueryTemplate(*args): return _mapscript.mapObj_processQueryTemplate(*args)
-    def getOutputFormatByName(*args): return _mapscript.mapObj_getOutputFormatByName(*args)
-    def appendOutputFormat(*args): return _mapscript.mapObj_appendOutputFormat(*args)
-    def removeOutputFormat(*args): return _mapscript.mapObj_removeOutputFormat(*args)
-    def loadOWSParameters(*args): return _mapscript.mapObj_loadOWSParameters(*args)
-    def OWSDispatch(*args): return _mapscript.mapObj_OWSDispatch(*args)
-    def zoomPoint(*args): return _mapscript.mapObj_zoomPoint(*args)
-    def zoomRectangle(*args): return _mapscript.mapObj_zoomRectangle(*args)
-    def zoomScale(*args): return _mapscript.mapObj_zoomScale(*args)
-    def getLayerOrder(*args): return _mapscript.mapObj_getLayerOrder(*args)
-    def setLayerOrder(*args): return _mapscript.mapObj_setLayerOrder(*args)
-    def getSize(*args): return _mapscript.mapObj_getSize(*args)
+    def getSymbolByName(self, *args): return _mapscript.mapObj_getSymbolByName(self, *args)
+    def prepareQuery(self): return _mapscript.mapObj_prepareQuery(self)
+    def prepareImage(self): return _mapscript.mapObj_prepareImage(self)
+    def setImageType(self, *args): return _mapscript.mapObj_setImageType(self, *args)
+    def selectOutputFormat(self, *args): return _mapscript.mapObj_selectOutputFormat(self, *args)
+    def setOutputFormat(self, *args): return _mapscript.mapObj_setOutputFormat(self, *args)
+    def draw(self): return _mapscript.mapObj_draw(self)
+    def drawQuery(self): return _mapscript.mapObj_drawQuery(self)
+    def drawLegend(self): return _mapscript.mapObj_drawLegend(self)
+    def drawScalebar(self): return _mapscript.mapObj_drawScalebar(self)
+    def drawReferenceMap(self): return _mapscript.mapObj_drawReferenceMap(self)
+    def embedScalebar(self, *args): return _mapscript.mapObj_embedScalebar(self, *args)
+    def embedLegend(self, *args): return _mapscript.mapObj_embedLegend(self, *args)
+    def drawLabelCache(self, *args): return _mapscript.mapObj_drawLabelCache(self, *args)
+    def getLabel(self, *args): return _mapscript.mapObj_getLabel(self, *args)
+    def nextLabel(self): return _mapscript.mapObj_nextLabel(self)
+    def queryByFilter(self, *args): return _mapscript.mapObj_queryByFilter(self, *args)
+    def queryByPoint(self, *args): return _mapscript.mapObj_queryByPoint(self, *args)
+    def queryByRect(self, *args): return _mapscript.mapObj_queryByRect(self, *args)
+    def queryByFeatures(self, *args): return _mapscript.mapObj_queryByFeatures(self, *args)
+    def queryByShape(self, *args): return _mapscript.mapObj_queryByShape(self, *args)
+    def setWKTProjection(self, *args): return _mapscript.mapObj_setWKTProjection(self, *args)
+    def getProjection(self): return _mapscript.mapObj_getProjection(self)
+    def setProjection(self, *args): return _mapscript.mapObj_setProjection(self, *args)
+    def save(self, *args): return _mapscript.mapObj_save(self, *args)
+    def saveQuery(self, *args): return _mapscript.mapObj_saveQuery(self, *args)
+    def loadQuery(self, *args): return _mapscript.mapObj_loadQuery(self, *args)
+    def freeQuery(self, *args): return _mapscript.mapObj_freeQuery(self, *args)
+    def saveQueryAsGML(self, *args): return _mapscript.mapObj_saveQueryAsGML(self, *args)
+    def getMetaData(self, *args): return _mapscript.mapObj_getMetaData(self, *args)
+    def setMetaData(self, *args): return _mapscript.mapObj_setMetaData(self, *args)
+    def removeMetaData(self, *args): return _mapscript.mapObj_removeMetaData(self, *args)
+    def getFirstMetaDataKey(self): return _mapscript.mapObj_getFirstMetaDataKey(self)
+    def getNextMetaDataKey(self, *args): return _mapscript.mapObj_getNextMetaDataKey(self, *args)
+    def setSymbolSet(self, *args): return _mapscript.mapObj_setSymbolSet(self, *args)
+    def getNumSymbols(self): return _mapscript.mapObj_getNumSymbols(self)
+    def setFontSet(self, *args): return _mapscript.mapObj_setFontSet(self, *args)
+    def saveMapContext(self, *args): return _mapscript.mapObj_saveMapContext(self, *args)
+    def loadMapContext(self, *args): return _mapscript.mapObj_loadMapContext(self, *args)
+    def moveLayerUp(self, *args): return _mapscript.mapObj_moveLayerUp(self, *args)
+    def moveLayerDown(self, *args): return _mapscript.mapObj_moveLayerDown(self, *args)
+    def getLayersDrawingOrder(self): return _mapscript.mapObj_getLayersDrawingOrder(self)
+    def setLayersDrawingOrder(self, *args): return _mapscript.mapObj_setLayersDrawingOrder(self, *args)
+    def setConfigOption(self, *args): return _mapscript.mapObj_setConfigOption(self, *args)
+    def getConfigOption(self, *args): return _mapscript.mapObj_getConfigOption(self, *args)
+    def applyConfigOptions(self): return _mapscript.mapObj_applyConfigOptions(self)
+    def applySLD(self, *args): return _mapscript.mapObj_applySLD(self, *args)
+    def applySLDURL(self, *args): return _mapscript.mapObj_applySLDURL(self, *args)
+    def generateSLD(self): return _mapscript.mapObj_generateSLD(self)
+    def processTemplate(self, *args): return _mapscript.mapObj_processTemplate(self, *args)
+    def processLegendTemplate(self, *args): return _mapscript.mapObj_processLegendTemplate(self, *args)
+    def processQueryTemplate(self, *args): return _mapscript.mapObj_processQueryTemplate(self, *args)
+    def getOutputFormatByName(self, *args): return _mapscript.mapObj_getOutputFormatByName(self, *args)
+    def appendOutputFormat(self, *args): return _mapscript.mapObj_appendOutputFormat(self, *args)
+    def removeOutputFormat(self, *args): return _mapscript.mapObj_removeOutputFormat(self, *args)
+    def loadOWSParameters(self, *args): return _mapscript.mapObj_loadOWSParameters(self, *args)
+    def OWSDispatch(self, *args): return _mapscript.mapObj_OWSDispatch(self, *args)
+    def zoomPoint(self, *args): return _mapscript.mapObj_zoomPoint(self, *args)
+    def zoomRectangle(self, *args): return _mapscript.mapObj_zoomRectangle(self, *args)
+    def zoomScale(self, *args): return _mapscript.mapObj_zoomScale(self, *args)
+    def getLayerOrder(self): return _mapscript.mapObj_getLayerOrder(self)
+    def setLayerOrder(self, *args): return _mapscript.mapObj_setLayerOrder(self, *args)
+    def getSize(self): return _mapscript.mapObj_getSize(self)
     def get_height(self):
         return self.getSize()[1] # <-- second member is the height
     def get_width(self):
@@ -1665,22 +1705,37 @@ class imageObj(_object):
     if _newclass:format = _swig_property(_mapscript.imageObj_format_get)
     __swig_destroy__ = _mapscript.delete_imageObj
     __del__ = lambda self : None;
-    def save(*args): return _mapscript.imageObj_save(*args)
-    def getBytes(*args): return _mapscript.imageObj_getBytes(*args)
-    def getSize(*args): return _mapscript.imageObj_getSize(*args)
+    def save(self, *args): return _mapscript.imageObj_save(self, *args)
+    def getBytes(self): return _mapscript.imageObj_getBytes(self)
+    def getSize(self): return _mapscript.imageObj_getSize(self)
     def __init__(self, *args): 
         this = _mapscript.new_imageObj(*args)
         try: self.this.append(this)
         except: self.this = this
-    def write(*args): return _mapscript.imageObj_write(*args)
-    def saveToString(*args): return _mapscript.imageObj_saveToString(*args)
+    def write(self, *args): return _mapscript.imageObj_write(self, *args)
+    def saveToString(self): return _mapscript.imageObj_saveToString(self)
 imageObj_swigregister = _mapscript.imageObj_swigregister
 imageObj_swigregister(imageObj)
 
+
+def msSaveImage(*args):
+  return _mapscript.msSaveImage(*args)
 msSaveImage = _mapscript.msSaveImage
+
+def msFreeImage(*args):
+  return _mapscript.msFreeImage(*args)
 msFreeImage = _mapscript.msFreeImage
+
+def msSetup():
+  return _mapscript.msSetup()
 msSetup = _mapscript.msSetup
+
+def msCleanup():
+  return _mapscript.msCleanup()
 msCleanup = _mapscript.msCleanup
+
+def msLoadMapFromString(*args):
+  return _mapscript.msLoadMapFromString(*args)
 msLoadMapFromString = _mapscript.msLoadMapFromString
 class strokeStyleObj(_object):
     __swig_setmethods__ = {}
@@ -1709,8 +1764,8 @@ class strokeStyleObj(_object):
     __swig_setmethods__["linejoinmaxsize"] = _mapscript.strokeStyleObj_linejoinmaxsize_set
     __swig_getmethods__["linejoinmaxsize"] = _mapscript.strokeStyleObj_linejoinmaxsize_get
     if _newclass:linejoinmaxsize = _swig_property(_mapscript.strokeStyleObj_linejoinmaxsize_get, _mapscript.strokeStyleObj_linejoinmaxsize_set)
-    def __init__(self, *args): 
-        this = _mapscript.new_strokeStyleObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_strokeStyleObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_strokeStyleObj
@@ -1748,8 +1803,8 @@ class symbolStyleObj(_object):
     __swig_setmethods__["style"] = _mapscript.symbolStyleObj_style_set
     __swig_getmethods__["style"] = _mapscript.symbolStyleObj_style_get
     if _newclass:style = _swig_property(_mapscript.symbolStyleObj_style_get, _mapscript.symbolStyleObj_style_set)
-    def __init__(self, *args): 
-        this = _mapscript.new_symbolStyleObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_symbolStyleObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_symbolStyleObj
@@ -1796,8 +1851,8 @@ class tileCacheObj(_object):
     __swig_setmethods__["next"] = _mapscript.tileCacheObj_next_set
     __swig_getmethods__["next"] = _mapscript.tileCacheObj_next_get
     if _newclass:next = _swig_property(_mapscript.tileCacheObj_next_get, _mapscript.tileCacheObj_next_set)
-    def __init__(self, *args): 
-        this = _mapscript.new_tileCacheObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_tileCacheObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_tileCacheObj
@@ -1829,8 +1884,8 @@ class labelStyleObj(_object):
     __swig_setmethods__["outlinecolor"] = _mapscript.labelStyleObj_outlinecolor_set
     __swig_getmethods__["outlinecolor"] = _mapscript.labelStyleObj_outlinecolor_get
     if _newclass:outlinecolor = _swig_property(_mapscript.labelStyleObj_outlinecolor_get, _mapscript.labelStyleObj_outlinecolor_set)
-    def __init__(self, *args): 
-        this = _mapscript.new_labelStyleObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_labelStyleObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_labelStyleObj
@@ -1862,12 +1917,12 @@ class rectObj(_object):
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_rectObj
     __del__ = lambda self : None;
-    def project(*args): return _mapscript.rectObj_project(*args)
-    def fit(*args): return _mapscript.rectObj_fit(*args)
-    def draw(*args): return _mapscript.rectObj_draw(*args)
-    def getCenter(*args): return _mapscript.rectObj_getCenter(*args)
-    def toPolygon(*args): return _mapscript.rectObj_toPolygon(*args)
-    def toString(*args): return _mapscript.rectObj_toString(*args)
+    def project(self, *args): return _mapscript.rectObj_project(self, *args)
+    def fit(self, *args): return _mapscript.rectObj_fit(self, *args)
+    def draw(self, *args): return _mapscript.rectObj_draw(self, *args)
+    def getCenter(self): return _mapscript.rectObj_getCenter(self)
+    def toPolygon(self): return _mapscript.rectObj_toPolygon(self)
+    def toString(self): return _mapscript.rectObj_toString(self)
     def __str__(self):
         return self.toString()
         
@@ -1905,16 +1960,16 @@ class pointObj(_object):
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_pointObj
     __del__ = lambda self : None;
-    def project(*args): return _mapscript.pointObj_project(*args)
-    def draw(*args): return _mapscript.pointObj_draw(*args)
-    def distanceToPoint(*args): return _mapscript.pointObj_distanceToPoint(*args)
-    def distanceToSegment(*args): return _mapscript.pointObj_distanceToSegment(*args)
-    def distanceToShape(*args): return _mapscript.pointObj_distanceToShape(*args)
-    def setXY(*args): return _mapscript.pointObj_setXY(*args)
-    def setXYZ(*args): return _mapscript.pointObj_setXYZ(*args)
-    def setXYZM(*args): return _mapscript.pointObj_setXYZM(*args)
-    def toString(*args): return _mapscript.pointObj_toString(*args)
-    def toShape(*args): return _mapscript.pointObj_toShape(*args)
+    def project(self, *args): return _mapscript.pointObj_project(self, *args)
+    def draw(self, *args): return _mapscript.pointObj_draw(self, *args)
+    def distanceToPoint(self, *args): return _mapscript.pointObj_distanceToPoint(self, *args)
+    def distanceToSegment(self, *args): return _mapscript.pointObj_distanceToSegment(self, *args)
+    def distanceToShape(self, *args): return _mapscript.pointObj_distanceToShape(self, *args)
+    def setXY(self, *args): return _mapscript.pointObj_setXY(self, *args)
+    def setXYZ(self, *args): return _mapscript.pointObj_setXYZ(self, *args)
+    def setXYZM(self, *args): return _mapscript.pointObj_setXYZM(self, *args)
+    def toString(self): return _mapscript.pointObj_toString(self)
+    def toShape(self): return _mapscript.pointObj_toShape(self)
     def __str__(self):
         return self.toString()
 
@@ -1930,16 +1985,16 @@ class lineObj(_object):
     __repr__ = _swig_repr
     __swig_getmethods__["numpoints"] = _mapscript.lineObj_numpoints_get
     if _newclass:numpoints = _swig_property(_mapscript.lineObj_numpoints_get)
-    def __init__(self, *args): 
-        this = _mapscript.new_lineObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_lineObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_lineObj
     __del__ = lambda self : None;
-    def project(*args): return _mapscript.lineObj_project(*args)
-    def get(*args): return _mapscript.lineObj_get(*args)
-    def add(*args): return _mapscript.lineObj_add(*args)
-    def set(*args): return _mapscript.lineObj_set(*args)
+    def project(self, *args): return _mapscript.lineObj_project(self, *args)
+    def get(self, *args): return _mapscript.lineObj_get(self, *args)
+    def add(self, *args): return _mapscript.lineObj_add(self, *args)
+    def set(self, *args): return _mapscript.lineObj_set(self, *args)
 lineObj_swigregister = _mapscript.lineObj_swigregister
 lineObj_swigregister(lineObj)
 
@@ -1985,42 +2040,45 @@ class shapeObj(_object):
     __del__ = lambda self : None;
     __swig_getmethods__["fromWKT"] = lambda x: _mapscript.shapeObj_fromWKT
     if _newclass:fromWKT = staticmethod(_mapscript.shapeObj_fromWKT)
-    def project(*args): return _mapscript.shapeObj_project(*args)
-    def get(*args): return _mapscript.shapeObj_get(*args)
-    def add(*args): return _mapscript.shapeObj_add(*args)
-    def draw(*args): return _mapscript.shapeObj_draw(*args)
-    def setBounds(*args): return _mapscript.shapeObj_setBounds(*args)
-    def clone(*args): return _mapscript.shapeObj_clone(*args)
-    def copy(*args): return _mapscript.shapeObj_copy(*args)
-    def toWKT(*args): return _mapscript.shapeObj_toWKT(*args)
-    def buffer(*args): return _mapscript.shapeObj_buffer(*args)
-    def simplify(*args): return _mapscript.shapeObj_simplify(*args)
-    def topologyPreservingSimplify(*args): return _mapscript.shapeObj_topologyPreservingSimplify(*args)
-    def convexHull(*args): return _mapscript.shapeObj_convexHull(*args)
-    def boundary(*args): return _mapscript.shapeObj_boundary(*args)
-    def getCentroid(*args): return _mapscript.shapeObj_getCentroid(*args)
-    def Union(*args): return _mapscript.shapeObj_Union(*args)
-    def intersection(*args): return _mapscript.shapeObj_intersection(*args)
-    def difference(*args): return _mapscript.shapeObj_difference(*args)
-    def symDifference(*args): return _mapscript.shapeObj_symDifference(*args)
-    def overlaps(*args): return _mapscript.shapeObj_overlaps(*args)
-    def within(*args): return _mapscript.shapeObj_within(*args)
-    def crosses(*args): return _mapscript.shapeObj_crosses(*args)
-    def intersects(*args): return _mapscript.shapeObj_intersects(*args)
-    def touches(*args): return _mapscript.shapeObj_touches(*args)
-    def equals(*args): return _mapscript.shapeObj_equals(*args)
-    def disjoint(*args): return _mapscript.shapeObj_disjoint(*args)
-    def getArea(*args): return _mapscript.shapeObj_getArea(*args)
-    def getLength(*args): return _mapscript.shapeObj_getLength(*args)
-    def getValue(*args): return _mapscript.shapeObj_getValue(*args)
-    def contains(*args): return _mapscript.shapeObj_contains(*args)
-    def distanceToPoint(*args): return _mapscript.shapeObj_distanceToPoint(*args)
-    def distanceToShape(*args): return _mapscript.shapeObj_distanceToShape(*args)
-    def getLabelPoint(*args): return _mapscript.shapeObj_getLabelPoint(*args)
-    def setValue(*args): return _mapscript.shapeObj_setValue(*args)
-    def initValues(*args): return _mapscript.shapeObj_initValues(*args)
+    def project(self, *args): return _mapscript.shapeObj_project(self, *args)
+    def get(self, *args): return _mapscript.shapeObj_get(self, *args)
+    def add(self, *args): return _mapscript.shapeObj_add(self, *args)
+    def draw(self, *args): return _mapscript.shapeObj_draw(self, *args)
+    def setBounds(self): return _mapscript.shapeObj_setBounds(self)
+    def clone(self): return _mapscript.shapeObj_clone(self)
+    def copy(self, *args): return _mapscript.shapeObj_copy(self, *args)
+    def toWKT(self): return _mapscript.shapeObj_toWKT(self)
+    def buffer(self, *args): return _mapscript.shapeObj_buffer(self, *args)
+    def simplify(self, *args): return _mapscript.shapeObj_simplify(self, *args)
+    def topologyPreservingSimplify(self, *args): return _mapscript.shapeObj_topologyPreservingSimplify(self, *args)
+    def convexHull(self): return _mapscript.shapeObj_convexHull(self)
+    def boundary(self): return _mapscript.shapeObj_boundary(self)
+    def getCentroid(self): return _mapscript.shapeObj_getCentroid(self)
+    def Union(self, *args): return _mapscript.shapeObj_Union(self, *args)
+    def intersection(self, *args): return _mapscript.shapeObj_intersection(self, *args)
+    def difference(self, *args): return _mapscript.shapeObj_difference(self, *args)
+    def symDifference(self, *args): return _mapscript.shapeObj_symDifference(self, *args)
+    def overlaps(self, *args): return _mapscript.shapeObj_overlaps(self, *args)
+    def within(self, *args): return _mapscript.shapeObj_within(self, *args)
+    def crosses(self, *args): return _mapscript.shapeObj_crosses(self, *args)
+    def intersects(self, *args): return _mapscript.shapeObj_intersects(self, *args)
+    def touches(self, *args): return _mapscript.shapeObj_touches(self, *args)
+    def equals(self, *args): return _mapscript.shapeObj_equals(self, *args)
+    def disjoint(self, *args): return _mapscript.shapeObj_disjoint(self, *args)
+    def getArea(self): return _mapscript.shapeObj_getArea(self)
+    def getLength(self): return _mapscript.shapeObj_getLength(self)
+    def getValue(self, *args): return _mapscript.shapeObj_getValue(self, *args)
+    def contains(self, *args): return _mapscript.shapeObj_contains(self, *args)
+    def distanceToPoint(self, *args): return _mapscript.shapeObj_distanceToPoint(self, *args)
+    def distanceToShape(self, *args): return _mapscript.shapeObj_distanceToShape(self, *args)
+    def getLabelPoint(self): return _mapscript.shapeObj_getLabelPoint(self)
+    def setValue(self, *args): return _mapscript.shapeObj_setValue(self, *args)
+    def initValues(self, *args): return _mapscript.shapeObj_initValues(self, *args)
 shapeObj_swigregister = _mapscript.shapeObj_swigregister
 shapeObj_swigregister(shapeObj)
+
+def shapeObj_fromWKT(*args):
+  return _mapscript.shapeObj_fromWKT(*args)
 shapeObj_fromWKT = _mapscript.shapeObj_fromWKT
 
 SHX_BUFFER_PAGE = _mapscript.SHX_BUFFER_PAGE
@@ -2076,12 +2134,12 @@ class DBFInfo(_object):
     if _newclass:pszStringField = _swig_property(_mapscript.DBFInfo_pszStringField_get)
     __swig_getmethods__["nStringFieldLen"] = _mapscript.DBFInfo_nStringFieldLen_get
     if _newclass:nStringFieldLen = _swig_property(_mapscript.DBFInfo_nStringFieldLen_get)
-    def getFieldName(*args): return _mapscript.DBFInfo_getFieldName(*args)
-    def getFieldWidth(*args): return _mapscript.DBFInfo_getFieldWidth(*args)
-    def getFieldDecimals(*args): return _mapscript.DBFInfo_getFieldDecimals(*args)
-    def getFieldType(*args): return _mapscript.DBFInfo_getFieldType(*args)
-    def __init__(self, *args): 
-        this = _mapscript.new_DBFInfo(*args)
+    def getFieldName(self, *args): return _mapscript.DBFInfo_getFieldName(self, *args)
+    def getFieldWidth(self, *args): return _mapscript.DBFInfo_getFieldWidth(self, *args)
+    def getFieldDecimals(self, *args): return _mapscript.DBFInfo_getFieldDecimals(self, *args)
+    def getFieldType(self, *args): return _mapscript.DBFInfo_getFieldType(self, *args)
+    def __init__(self): 
+        this = _mapscript.new_DBFInfo()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_DBFInfo
@@ -2121,14 +2179,14 @@ class shapefileObj(_object):
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_shapefileObj
     __del__ = lambda self : None;
-    def get(*args): return _mapscript.shapefileObj_get(*args)
-    def getShape(*args): return _mapscript.shapefileObj_getShape(*args)
-    def getPoint(*args): return _mapscript.shapefileObj_getPoint(*args)
-    def getTransformed(*args): return _mapscript.shapefileObj_getTransformed(*args)
-    def getExtent(*args): return _mapscript.shapefileObj_getExtent(*args)
-    def add(*args): return _mapscript.shapefileObj_add(*args)
-    def addPoint(*args): return _mapscript.shapefileObj_addPoint(*args)
-    def getDBF(*args): return _mapscript.shapefileObj_getDBF(*args)
+    def get(self, *args): return _mapscript.shapefileObj_get(self, *args)
+    def getShape(self, *args): return _mapscript.shapefileObj_getShape(self, *args)
+    def getPoint(self, *args): return _mapscript.shapefileObj_getPoint(self, *args)
+    def getTransformed(self, *args): return _mapscript.shapefileObj_getTransformed(self, *args)
+    def getExtent(self, *args): return _mapscript.shapefileObj_getExtent(self, *args)
+    def add(self, *args): return _mapscript.shapefileObj_add(self, *args)
+    def addPoint(self, *args): return _mapscript.shapefileObj_addPoint(self, *args)
+    def getDBF(self): return _mapscript.shapefileObj_getDBF(self)
 shapefileObj_swigregister = _mapscript.shapefileObj_swigregister
 shapefileObj_swigregister(shapefileObj)
 
@@ -2148,8 +2206,8 @@ class projectionObj(_object):
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_projectionObj
     __del__ = lambda self : None;
-    def setWKTProjection(*args): return _mapscript.projectionObj_setWKTProjection(*args)
-    def getUnits(*args): return _mapscript.projectionObj_getUnits(*args)
+    def setWKTProjection(self, *args): return _mapscript.projectionObj_setWKTProjection(self, *args)
+    def getUnits(self): return _mapscript.projectionObj_getUnits(self)
 projectionObj_swigregister = _mapscript.projectionObj_swigregister
 projectionObj_swigregister(projectionObj)
 
@@ -2191,9 +2249,9 @@ class colorObj(_object):
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_colorObj
     __del__ = lambda self : None;
-    def setRGB(*args): return _mapscript.colorObj_setRGB(*args)
-    def setHex(*args): return _mapscript.colorObj_setHex(*args)
-    def toHex(*args): return _mapscript.colorObj_toHex(*args)
+    def setRGB(self, *args): return _mapscript.colorObj_setRGB(self, *args)
+    def setHex(self, *args): return _mapscript.colorObj_setHex(self, *args)
+    def toHex(self): return _mapscript.colorObj_toHex(self)
 colorObj_swigregister = _mapscript.colorObj_swigregister
 colorObj_swigregister(colorObj)
 
@@ -2263,11 +2321,11 @@ class symbolObj(_object):
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_symbolObj
     __del__ = lambda self : None;
-    def setImagepath(*args): return _mapscript.symbolObj_setImagepath(*args)
-    def setPoints(*args): return _mapscript.symbolObj_setPoints(*args)
-    def getPoints(*args): return _mapscript.symbolObj_getPoints(*args)
-    def getImage(*args): return _mapscript.symbolObj_getImage(*args)
-    def setImage(*args): return _mapscript.symbolObj_setImage(*args)
+    def setImagepath(self, *args): return _mapscript.symbolObj_setImagepath(self, *args)
+    def setPoints(self, *args): return _mapscript.symbolObj_setPoints(self, *args)
+    def getPoints(self): return _mapscript.symbolObj_getPoints(self)
+    def getImage(self, *args): return _mapscript.symbolObj_getImage(self, *args)
+    def setImage(self, *args): return _mapscript.symbolObj_setImage(self, *args)
 symbolObj_swigregister = _mapscript.symbolObj_swigregister
 symbolObj_swigregister(symbolObj)
 
@@ -2336,20 +2394,35 @@ class errorObj(_object):
     __swig_setmethods__["isreported"] = _mapscript.errorObj_isreported_set
     __swig_getmethods__["isreported"] = _mapscript.errorObj_isreported_get
     if _newclass:isreported = _swig_property(_mapscript.errorObj_isreported_get, _mapscript.errorObj_isreported_set)
-    def __init__(self, *args): 
-        this = _mapscript.new_errorObj(*args)
+    def __init__(self): 
+        this = _mapscript.new_errorObj()
         try: self.this.append(this)
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_errorObj
     __del__ = lambda self : None;
-    def next(*args): return _mapscript.errorObj_next(*args)
+    def next(self): return _mapscript.errorObj_next(self)
 errorObj_swigregister = _mapscript.errorObj_swigregister
 errorObj_swigregister(errorObj)
 
+
+def msGetErrorObj():
+  return _mapscript.msGetErrorObj()
 msGetErrorObj = _mapscript.msGetErrorObj
+
+def msResetErrorList():
+  return _mapscript.msResetErrorList()
 msResetErrorList = _mapscript.msResetErrorList
+
+def msGetVersion():
+  return _mapscript.msGetVersion()
 msGetVersion = _mapscript.msGetVersion
+
+def msGetVersionInt():
+  return _mapscript.msGetVersionInt()
 msGetVersionInt = _mapscript.msGetVersionInt
+
+def msGetErrorString(*args):
+  return _mapscript.msGetErrorString(*args)
 msGetErrorString = _mapscript.msGetErrorString
 MS_DEBUGLEVEL_ERRORSONLY = _mapscript.MS_DEBUGLEVEL_ERRORSONLY
 MS_DEBUGLEVEL_DEBUG = _mapscript.MS_DEBUGLEVEL_DEBUG
@@ -2372,11 +2445,11 @@ class hashTableObj(_object):
         except: self.this = this
     __swig_destroy__ = _mapscript.delete_hashTableObj
     __del__ = lambda self : None;
-    def set(*args): return _mapscript.hashTableObj_set(*args)
-    def get(*args): return _mapscript.hashTableObj_get(*args)
-    def remove(*args): return _mapscript.hashTableObj_remove(*args)
-    def clear(*args): return _mapscript.hashTableObj_clear(*args)
-    def nextKey(*args): return _mapscript.hashTableObj_nextKey(*args)
+    def set(self, *args): return _mapscript.hashTableObj_set(self, *args)
+    def get(self, *args): return _mapscript.hashTableObj_get(self, *args)
+    def remove(self, *args): return _mapscript.hashTableObj_remove(self, *args)
+    def clear(self, *args): return _mapscript.hashTableObj_clear(self, *args)
+    def nextKey(self, prevkey = None): return _mapscript.hashTableObj_nextKey(self, prevkey)
 hashTableObj_swigregister = _mapscript.hashTableObj_swigregister
 hashTableObj_swigregister(hashTableObj)
 
@@ -2403,28 +2476,52 @@ class OWSRequest(_object):
     __swig_setmethods__["httpcookiedata"] = _mapscript.OWSRequest_httpcookiedata_set
     __swig_getmethods__["httpcookiedata"] = _mapscript.OWSRequest_httpcookiedata_get
     if _newclass:httpcookiedata = _swig_property(_mapscript.OWSRequest_httpcookiedata_get, _mapscript.OWSRequest_httpcookiedata_set)
-    def __init__(self, *args): 
-        this = _mapscript.new_OWSRequest(*args)
+    def __init__(self): 
+        this = _mapscript.new_OWSRequest()
         try: self.this.append(this)
         except: self.this = this
-    def loadParams(*args): return _mapscript.OWSRequest_loadParams(*args)
-    def loadParamsFromURL(*args): return _mapscript.OWSRequest_loadParamsFromURL(*args)
-    def setParameter(*args): return _mapscript.OWSRequest_setParameter(*args)
-    def getName(*args): return _mapscript.OWSRequest_getName(*args)
-    def getValue(*args): return _mapscript.OWSRequest_getValue(*args)
-    def getValueByName(*args): return _mapscript.OWSRequest_getValueByName(*args)
     __swig_destroy__ = _mapscript.delete_OWSRequest
     __del__ = lambda self : None;
+    def loadParams(self): return _mapscript.OWSRequest_loadParams(self)
+    def loadParamsFromURL(self, *args): return _mapscript.OWSRequest_loadParamsFromURL(self, *args)
+    def setParameter(self, *args): return _mapscript.OWSRequest_setParameter(self, *args)
+    def getName(self, *args): return _mapscript.OWSRequest_getName(self, *args)
+    def getValue(self, *args): return _mapscript.OWSRequest_getValue(self, *args)
+    def getValueByName(self, *args): return _mapscript.OWSRequest_getValueByName(self, *args)
 OWSRequest_swigregister = _mapscript.OWSRequest_swigregister
 OWSRequest_swigregister(OWSRequest)
 
+
+def msConnPoolCloseUnreferenced():
+  return _mapscript.msConnPoolCloseUnreferenced()
 msConnPoolCloseUnreferenced = _mapscript.msConnPoolCloseUnreferenced
+
+def msIO_resetHandlers():
+  return _mapscript.msIO_resetHandlers()
 msIO_resetHandlers = _mapscript.msIO_resetHandlers
+
+def msIO_installStdoutToBuffer():
+  return _mapscript.msIO_installStdoutToBuffer()
 msIO_installStdoutToBuffer = _mapscript.msIO_installStdoutToBuffer
+
+def msIO_installStdinFromBuffer():
+  return _mapscript.msIO_installStdinFromBuffer()
 msIO_installStdinFromBuffer = _mapscript.msIO_installStdinFromBuffer
+
+def msIO_stripStdoutBufferContentType():
+  return _mapscript.msIO_stripStdoutBufferContentType()
 msIO_stripStdoutBufferContentType = _mapscript.msIO_stripStdoutBufferContentType
+
+def msIO_stripStdoutBufferContentHeaders():
+  return _mapscript.msIO_stripStdoutBufferContentHeaders()
 msIO_stripStdoutBufferContentHeaders = _mapscript.msIO_stripStdoutBufferContentHeaders
+
+def msIO_getStdoutBufferString():
+  return _mapscript.msIO_getStdoutBufferString()
 msIO_getStdoutBufferString = _mapscript.msIO_getStdoutBufferString
+
+def msIO_getStdoutBufferBytes():
+  return _mapscript.msIO_getStdoutBufferBytes()
 msIO_getStdoutBufferBytes = _mapscript.msIO_getStdoutBufferBytes
 def fromstring(data, mappath=None):
     """Creates map objects from mapfile strings.
diff --git a/mapscript/python/mapscript_wrap.c b/mapscript/python/mapscript_wrap.c
index d4ce8d5..28fe3a2 100644
--- a/mapscript/python/mapscript_wrap.c
+++ b/mapscript/python/mapscript_wrap.c
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.36
+ * Version 1.3.40
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -10,6 +10,7 @@
 
 #define SWIGPYTHON
 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
+
 /* -----------------------------------------------------------------------------
  *  This section contains generic SWIG labels for method/variable
  *  declarations/attributes, and other compiler dependent labels.
@@ -126,7 +127,7 @@
 /* -----------------------------------------------------------------------------
  * swigrun.swg
  *
- * This file contains generic CAPI SWIG runtime support for pointer
+ * This file contains generic C API SWIG runtime support for pointer
  * type checking.
  * ----------------------------------------------------------------------------- */
 
@@ -145,11 +146,11 @@
 
 /*
   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
   
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
 */
 
 #ifndef SWIGRUNTIME
@@ -176,14 +177,14 @@
 /* 
    Flags/methods for returning states.
    
-   The swig conversion methods, as ConvertPtr, return and integer 
+   The SWIG conversion methods, as ConvertPtr, return and integer 
    that tells if the conversion was successful or not. And if not,
    an error code can be returned (see swigerrors.swg for the codes).
    
    Use the following macros/flags to set or process the returning
    states.
    
-   In old swig versions, you usually write code as:
+   In old versions of SWIG, code such as the following was usually written:
 
      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
        // success code
@@ -191,7 +192,7 @@
        //fail code
      }
 
-   Now you can be more explicit as:
+   Now you can be more explicit:
 
     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
     if (SWIG_IsOK(res)) {
@@ -200,7 +201,7 @@
       // fail code
     }
 
-   that seems to be the same, but now you can also do
+   which is the same really, but now you can also do
 
     Type *ptr;
     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
@@ -218,7 +219,7 @@
     
    I.e., now SWIG_ConvertPtr can return new objects and you can
    identify the case and take care of the deallocation. Of course that
-   requires also to SWIG_ConvertPtr to return new result values, as
+   also requires SWIG_ConvertPtr to return new result values, such as
 
       int SWIG_ConvertPtr(obj, ptr,...) {         
         if (<obj is ok>) {			       
@@ -236,7 +237,7 @@
 
    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   swig errors code.
+   SWIG errors code.
 
    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
    allows to return the 'cast rank', for example, if you have this
@@ -250,9 +251,8 @@
       fooi(1)   // cast rank '0'
 
    just use the SWIG_AddCast()/SWIG_CheckState()
+*/
 
-
- */
 #define SWIG_OK                    (0) 
 #define SWIG_ERROR                 (-1)
 #define SWIG_IsOK(r)               (r >= 0)
@@ -277,7 +277,6 @@
 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
-
 /* Cast-Rank Mode */
 #if defined(SWIG_CASTRANK_MODE)
 #  ifndef SWIG_TypeRank
@@ -300,8 +299,6 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
 #endif
 
 
-
-
 #include <string.h>
 
 #ifdef __cplusplus
@@ -398,40 +395,58 @@ SWIG_TypeCompare(const char *nb, const char *tb) {
 }
 
 
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
 /*
   Check the typename
 */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
+/* 
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
 SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
 /*
@@ -710,6 +725,67 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
 
 
 
+/* Compatibility macros for Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+
+#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
+#define PyInt_Check(x) PyLong_Check(x)
+#define PyInt_AsLong(x) PyLong_AsLong(x)
+#define PyInt_FromLong(x) PyLong_FromLong(x)
+#define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
+
+#endif
+
+#ifndef Py_TYPE
+#  define Py_TYPE(op) ((op)->ob_type)
+#endif
+
+/* SWIG APIs for compatibility of both Python 2 & 3 */
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
+#else
+#  define SWIG_Python_str_FromFormat PyString_FromFormat
+#endif
+
+
+/* Warning: This function will allocate a new string in Python 3,
+ * so please call SWIG_Python_str_DelForPy3(x) to free the space.
+ */
+SWIGINTERN char*
+SWIG_Python_str_AsChar(PyObject *str)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  char *cstr;
+  char *newstr;
+  Py_ssize_t len;
+  str = PyUnicode_AsUTF8String(str);
+  PyBytes_AsStringAndSize(str, &cstr, &len);
+  newstr = (char *) malloc(len+1);
+  memcpy(newstr, cstr, len+1);
+  Py_XDECREF(str);
+  return newstr;
+#else
+  return PyString_AsString(str);
+#endif
+}
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
+#else
+#  define SWIG_Python_str_DelForPy3(x) 
+#endif
+
+
+SWIGINTERN PyObject*
+SWIG_Python_str_FromChar(const char *c)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  return PyUnicode_FromString(c); 
+#else
+  return PyString_FromString(c);
+#endif
+}
 
 /* Add PyOS_snprintf for old Pythons */
 #if PY_VERSION_HEX < 0x02020000
@@ -756,6 +832,7 @@ PyString_FromFormat(const char *fmt, ...) {
 #  define PyObject_GenericGetAttr 0
 # endif
 #endif
+
 /* Py_NotImplemented is defined in 2.1 and up. */
 #if PY_VERSION_HEX < 0x02010000
 # ifndef Py_NotImplemented
@@ -763,7 +840,6 @@ PyString_FromFormat(const char *fmt, ...) {
 # endif
 #endif
 
-
 /* A crude PyString_AsStringAndSize implementation for old Pythons */
 #if PY_VERSION_HEX < 0x02010000
 # ifndef PyString_AsStringAndSize
@@ -778,7 +854,6 @@ PyString_FromFormat(const char *fmt, ...) {
 # endif
 #endif
 
-
 /* PyBool_FromLong for old Pythons */
 #if PY_VERSION_HEX < 0x02030000
 static
@@ -856,10 +931,13 @@ SWIG_Python_AddErrorMsg(const char* mesg)
 
   if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
   if (value) {
+    char *tmp;
     PyObject *old_str = PyObject_Str(value);
     PyErr_Clear();
     Py_XINCREF(type);
-    PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+
+    PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
+    SWIG_Python_str_DelForPy3(tmp);
     Py_DECREF(old_str);
     Py_DECREF(value);
   } else {
@@ -867,8 +945,6 @@ SWIG_Python_AddErrorMsg(const char* mesg)
   }
 }
 
-
-
 #if defined(SWIG_PYTHON_NO_THREADS)
 #  if defined(SWIG_PYTHON_THREADS)
 #    undef SWIG_PYTHON_THREADS
@@ -965,6 +1041,20 @@ typedef struct swig_const_info {
   swig_type_info **ptype;
 } swig_const_info;
 
+
+/* -----------------------------------------------------------------------------
+ * Wrapper of PyInstanceMethod_New() used in Python 3
+ * It is exported to the generated module, used for -fastproxy
+ * ----------------------------------------------------------------------------- */
+SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  return PyInstanceMethod_New(func);
+#else
+  return NULL;
+#endif
+}
+
 #ifdef __cplusplus
 #if 0
 { /* cc-mode */
@@ -1017,7 +1107,7 @@ typedef struct swig_const_info {
 
 #define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
 #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
-#define SWIG_NewClientData(obj)                         PySwigClientData_New(obj)
+#define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
 
 #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
 #define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
@@ -1213,7 +1303,7 @@ SWIG_Py_Void(void)
   return none;
 }
 
-/* PySwigClientData */
+/* SwigPyClientData */
 
 typedef struct {
   PyObject *klass;
@@ -1222,30 +1312,30 @@ typedef struct {
   PyObject *destroy;
   int delargs;
   int implicitconv;
-} PySwigClientData;
+} SwigPyClientData;
 
 SWIGRUNTIMEINLINE int 
 SWIG_Python_CheckImplicit(swig_type_info *ty)
 {
-  PySwigClientData *data = (PySwigClientData *)ty->clientdata;
+  SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
   return data ? data->implicitconv : 0;
 }
 
 SWIGRUNTIMEINLINE PyObject *
 SWIG_Python_ExceptionType(swig_type_info *desc) {
-  PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
+  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
   PyObject *klass = data ? data->klass : 0;
   return (klass ? klass : PyExc_RuntimeError);
 }
 
 
-SWIGRUNTIME PySwigClientData * 
-PySwigClientData_New(PyObject* obj)
+SWIGRUNTIME SwigPyClientData * 
+SwigPyClientData_New(PyObject* obj)
 {
   if (!obj) {
     return 0;
   } else {
-    PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
+    SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
     /* the klass element */
     data->klass = obj;
     Py_INCREF(data->klass);
@@ -1293,14 +1383,14 @@ PySwigClientData_New(PyObject* obj)
 }
 
 SWIGRUNTIME void 
-PySwigClientData_Del(PySwigClientData* data)
+SwigPyClientData_Del(SwigPyClientData* data)
 {
   Py_XDECREF(data->newraw);
   Py_XDECREF(data->newargs);
   Py_XDECREF(data->destroy);
 }
 
-/* =============== PySwigObject =====================*/
+/* =============== SwigPyObject =====================*/
 
 typedef struct {
   PyObject_HEAD
@@ -1308,24 +1398,28 @@ typedef struct {
   swig_type_info *ty;
   int own;
   PyObject *next;
-} PySwigObject;
+} SwigPyObject;
 
 SWIGRUNTIME PyObject *
-PySwigObject_long(PySwigObject *v)
+SwigPyObject_long(SwigPyObject *v)
 {
   return PyLong_FromVoidPtr(v->ptr);
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_format(const char* fmt, PySwigObject *v)
+SwigPyObject_format(const char* fmt, SwigPyObject *v)
 {
   PyObject *res = NULL;
   PyObject *args = PyTuple_New(1);
   if (args) {
-    if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
-      PyObject *ofmt = PyString_FromString(fmt);
+    if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
+      PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
       if (ofmt) {
+#if PY_VERSION_HEX >= 0x03000000
+	res = PyUnicode_Format(ofmt,args);
+#else
 	res = PyString_Format(ofmt,args);
+#endif
 	Py_DECREF(ofmt);
       }
       Py_DECREF(args);
@@ -1335,49 +1429,57 @@ PySwigObject_format(const char* fmt, PySwigObject *v)
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_oct(PySwigObject *v)
+SwigPyObject_oct(SwigPyObject *v)
 {
-  return PySwigObject_format("%o",v);
+  return SwigPyObject_format("%o",v);
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_hex(PySwigObject *v)
+SwigPyObject_hex(SwigPyObject *v)
 {
-  return PySwigObject_format("%x",v);
+  return SwigPyObject_format("%x",v);
 }
 
 SWIGRUNTIME PyObject *
 #ifdef METH_NOARGS
-PySwigObject_repr(PySwigObject *v)
+SwigPyObject_repr(SwigPyObject *v)
 #else
-PySwigObject_repr(PySwigObject *v, PyObject *args)
+SwigPyObject_repr(SwigPyObject *v, PyObject *args)
 #endif
 {
   const char *name = SWIG_TypePrettyName(v->ty);
-  PyObject *hex = PySwigObject_hex(v);    
-  PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
-  Py_DECREF(hex);
+  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
   if (v->next) {
 #ifdef METH_NOARGS
-    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
 #else
-    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args);
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
 #endif
+#if PY_VERSION_HEX >= 0x03000000
+    PyObject *joined = PyUnicode_Concat(repr, nrep);
+    Py_DecRef(repr);
+    Py_DecRef(nrep);
+    repr = joined;
+#else
     PyString_ConcatAndDel(&repr,nrep);
+#endif
   }
   return repr;  
 }
 
 SWIGRUNTIME int
-PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 {
+  char *str;
 #ifdef METH_NOARGS
-  PyObject *repr = PySwigObject_repr(v);
+  PyObject *repr = SwigPyObject_repr(v);
 #else
-  PyObject *repr = PySwigObject_repr(v, NULL);
+  PyObject *repr = SwigPyObject_repr(v, NULL);
 #endif
   if (repr) {
-    fputs(PyString_AsString(repr), fp);
+    str = SWIG_Python_str_AsChar(repr); 
+    fputs(str, fp);
+    SWIG_Python_str_DelForPy3(str);
     Py_DECREF(repr);
     return 0; 
   } else {
@@ -1386,53 +1488,71 @@ PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_str(PySwigObject *v)
+SwigPyObject_str(SwigPyObject *v)
 {
   char result[SWIG_BUFFER_SIZE];
   return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
-    PyString_FromString(result) : 0;
+    SWIG_Python_str_FromChar(result) : 0;
 }
 
 SWIGRUNTIME int
-PySwigObject_compare(PySwigObject *v, PySwigObject *w)
+SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
 {
   void *i = v->ptr;
   void *j = w->ptr;
   return (i < j) ? -1 : ((i > j) ? 1 : 0);
 }
 
+/* Added for Python 3.x, would it also be useful for Python 2.x? */
+SWIGRUNTIME PyObject*
+SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
+{
+  PyObject* res;
+  if( op != Py_EQ && op != Py_NE ) {
+    Py_INCREF(Py_NotImplemented);
+    return Py_NotImplemented;
+  }
+  if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) )
+    res = Py_True;
+  else
+    res = Py_False;
+  Py_INCREF(res);
+  return res;  
+}
+
+
 SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
 
 SWIGRUNTIME PyTypeObject*
-PySwigObject_type(void) {
+SwigPyObject_type(void) {
   static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
   return type;
 }
 
 SWIGRUNTIMEINLINE int
-PySwigObject_Check(PyObject *op) {
-  return ((op)->ob_type == PySwigObject_type())
-    || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
+SwigPyObject_Check(PyObject *op) {
+  return (Py_TYPE(op) == SwigPyObject_type())
+    || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_New(void *ptr, swig_type_info *ty, int own);
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
 
 SWIGRUNTIME void
-PySwigObject_dealloc(PyObject *v)
+SwigPyObject_dealloc(PyObject *v)
 {
-  PySwigObject *sobj = (PySwigObject *) v;
+  SwigPyObject *sobj = (SwigPyObject *) v;
   PyObject *next = sobj->next;
   if (sobj->own == SWIG_POINTER_OWN) {
     swig_type_info *ty = sobj->ty;
-    PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+    SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
     PyObject *destroy = data ? data->destroy : 0;
     if (destroy) {
       /* destroy is always a VARARGS method */
       PyObject *res;
       if (data->delargs) {
-	/* we need to create a temporal object to carry the destroy operation */
-	PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
+	/* we need to create a temporary object to carry the destroy operation */
+	PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
 	res = SWIG_Python_CallFunctor(destroy, tmp);
 	Py_DECREF(tmp);
       } else {
@@ -1454,15 +1574,15 @@ PySwigObject_dealloc(PyObject *v)
 }
 
 SWIGRUNTIME PyObject* 
-PySwigObject_append(PyObject* v, PyObject* next)
+SwigPyObject_append(PyObject* v, PyObject* next)
 {
-  PySwigObject *sobj = (PySwigObject *) v;
+  SwigPyObject *sobj = (SwigPyObject *) v;
 #ifndef METH_O
   PyObject *tmp = 0;
   if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
   next = tmp;
 #endif
-  if (!PySwigObject_Check(next)) {
+  if (!SwigPyObject_Check(next)) {
     return NULL;
   }
   sobj->next = next;
@@ -1472,12 +1592,12 @@ PySwigObject_append(PyObject* v, PyObject* next)
 
 SWIGRUNTIME PyObject* 
 #ifdef METH_NOARGS
-PySwigObject_next(PyObject* v)
+SwigPyObject_next(PyObject* v)
 #else
-PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 #endif
 {
-  PySwigObject *sobj = (PySwigObject *) v;
+  SwigPyObject *sobj = (SwigPyObject *) v;
   if (sobj->next) {    
     Py_INCREF(sobj->next);
     return sobj->next;
@@ -1488,30 +1608,30 @@ PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 
 SWIGINTERN PyObject*
 #ifdef METH_NOARGS
-PySwigObject_disown(PyObject *v)
+SwigPyObject_disown(PyObject *v)
 #else
-PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 #endif
 {
-  PySwigObject *sobj = (PySwigObject *)v;
+  SwigPyObject *sobj = (SwigPyObject *)v;
   sobj->own = 0;
   return SWIG_Py_Void();
 }
 
 SWIGINTERN PyObject*
 #ifdef METH_NOARGS
-PySwigObject_acquire(PyObject *v)
+SwigPyObject_acquire(PyObject *v)
 #else
-PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
 #endif
 {
-  PySwigObject *sobj = (PySwigObject *)v;
+  SwigPyObject *sobj = (SwigPyObject *)v;
   sobj->own = SWIG_POINTER_OWN;
   return SWIG_Py_Void();
 }
 
 SWIGINTERN PyObject*
-PySwigObject_own(PyObject *v, PyObject *args)
+SwigPyObject_own(PyObject *v, PyObject *args)
 {
   PyObject *val = 0;
 #if (PY_VERSION_HEX < 0x02020000)
@@ -1524,20 +1644,20 @@ PySwigObject_own(PyObject *v, PyObject *args)
     } 
   else
     {
-      PySwigObject *sobj = (PySwigObject *)v;
+      SwigPyObject *sobj = (SwigPyObject *)v;
       PyObject *obj = PyBool_FromLong(sobj->own);
       if (val) {
 #ifdef METH_NOARGS
 	if (PyObject_IsTrue(val)) {
-	  PySwigObject_acquire(v);
+	  SwigPyObject_acquire(v);
 	} else {
-	  PySwigObject_disown(v);
+	  SwigPyObject_disown(v);
 	}
 #else
 	if (PyObject_IsTrue(val)) {
-	  PySwigObject_acquire(v,args);
+	  SwigPyObject_acquire(v,args);
 	} else {
-	  PySwigObject_disown(v,args);
+	  SwigPyObject_disown(v,args);
 	}
 #endif
       } 
@@ -1548,30 +1668,30 @@ PySwigObject_own(PyObject *v, PyObject *args)
 #ifdef METH_O
 static PyMethodDef
 swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_O,       (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
   {0, 0, 0, 0}  
 };
 #else
 static PyMethodDef
 swigobject_methods[] = {
-  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
-  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
-  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
-  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
-  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
   {0, 0, 0, 0}  
 };
 #endif
 
 #if PY_VERSION_HEX < 0x02020000
 SWIGINTERN PyObject *
-PySwigObject_getattr(PySwigObject *sobj,char *name)
+SwigPyObject_getattr(SwigPyObject *sobj,char *name)
 {
   return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
 }
@@ -1581,11 +1701,14 @@ SWIGRUNTIME PyTypeObject*
 _PySwigObject_type(void) {
   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
   
-  static PyNumberMethods PySwigObject_as_number = {
+  static PyNumberMethods SwigPyObject_as_number = {
     (binaryfunc)0, /*nb_add*/
     (binaryfunc)0, /*nb_subtract*/
     (binaryfunc)0, /*nb_multiply*/
+    /* nb_divide removed in Python 3 */
+#if PY_VERSION_HEX < 0x03000000
     (binaryfunc)0, /*nb_divide*/
+#endif
     (binaryfunc)0, /*nb_remainder*/
     (binaryfunc)0, /*nb_divmod*/
     (ternaryfunc)0,/*nb_power*/
@@ -1599,13 +1722,23 @@ _PySwigObject_type(void) {
     0,		   /*nb_and*/
     0,		   /*nb_xor*/
     0,		   /*nb_or*/
-    (coercion)0,   /*nb_coerce*/
-    (unaryfunc)PySwigObject_long, /*nb_int*/
-    (unaryfunc)PySwigObject_long, /*nb_long*/
+#if PY_VERSION_HEX < 0x03000000
+    0,   /*nb_coerce*/
+#endif
+    (unaryfunc)SwigPyObject_long, /*nb_int*/
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_long, /*nb_long*/
+#else
+    0, /*nb_reserved*/
+#endif
     (unaryfunc)0,                 /*nb_float*/
-    (unaryfunc)PySwigObject_oct,  /*nb_oct*/
-    (unaryfunc)PySwigObject_hex,  /*nb_hex*/
-#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
+    (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
+#endif
+#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
+#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
@@ -1614,32 +1747,41 @@ _PySwigObject_type(void) {
 #endif
   };
 
-  static PyTypeObject pyswigobject_type;  
+  static PyTypeObject swigpyobject_type;  
   static int type_init = 0;
   if (!type_init) {
     const PyTypeObject tmp
       = {
+	/* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+	PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else    
 	PyObject_HEAD_INIT(NULL)
 	0,				    /* ob_size */
-	(char *)"PySwigObject",		    /* tp_name */
-	sizeof(PySwigObject),		    /* tp_basicsize */
+#endif
+	(char *)"SwigPyObject",		    /* tp_name */
+	sizeof(SwigPyObject),		    /* tp_basicsize */
 	0,			            /* tp_itemsize */
-	(destructor)PySwigObject_dealloc,   /* tp_dealloc */
-	(printfunc)PySwigObject_print,	    /* tp_print */
+	(destructor)SwigPyObject_dealloc,   /* tp_dealloc */
+	(printfunc)SwigPyObject_print,	    /* tp_print */
 #if PY_VERSION_HEX < 0x02020000
-	(getattrfunc)PySwigObject_getattr,  /* tp_getattr */ 
+	(getattrfunc)SwigPyObject_getattr,  /* tp_getattr */ 
 #else
 	(getattrfunc)0,			    /* tp_getattr */ 
 #endif
 	(setattrfunc)0,			    /* tp_setattr */ 
-	(cmpfunc)PySwigObject_compare,	    /* tp_compare */ 
-	(reprfunc)PySwigObject_repr,	    /* tp_repr */    
-	&PySwigObject_as_number,	    /* tp_as_number */
+#if PY_VERSION_HEX >= 0x03000000
+    0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
+#else
+	(cmpfunc)SwigPyObject_compare,	    /* tp_compare */
+#endif
+	(reprfunc)SwigPyObject_repr,	    /* tp_repr */    
+	&SwigPyObject_as_number,	    /* tp_as_number */
 	0,				    /* tp_as_sequence */
 	0,				    /* tp_as_mapping */
 	(hashfunc)0,			    /* tp_hash */
 	(ternaryfunc)0,			    /* tp_call */
-	(reprfunc)PySwigObject_str,	    /* tp_str */
+	(reprfunc)SwigPyObject_str,	    /* tp_str */
 	PyObject_GenericGetAttr,            /* tp_getattro */
 	0,				    /* tp_setattro */
 	0,		                    /* tp_as_buffer */
@@ -1647,7 +1789,7 @@ _PySwigObject_type(void) {
 	swigobject_doc, 	            /* tp_doc */        
 	0,                                  /* tp_traverse */
 	0,                                  /* tp_clear */
-	0,                                  /* tp_richcompare */
+	(richcmpfunc)SwigPyObject_richcompare,           /* tp_richcompare */
 	0,                                  /* tp_weaklistoffset */
 #if PY_VERSION_HEX >= 0x02020000
 	0,                                  /* tp_iter */
@@ -1664,11 +1806,11 @@ _PySwigObject_type(void) {
 	0,				    /* tp_alloc */	    	
 	0,			            /* tp_new */	    	
 	0,	                            /* tp_free */	   
-        0,                                  /* tp_is_gc */  
+	0,                                  /* tp_is_gc */  
 	0,				    /* tp_bases */   
 	0,				    /* tp_mro */
 	0,				    /* tp_cache */   
- 	0,				    /* tp_subclasses */
+	0,				    /* tp_subclasses */
 	0,				    /* tp_weaklist */
 #endif
 #if PY_VERSION_HEX >= 0x02030000
@@ -1678,17 +1820,20 @@ _PySwigObject_type(void) {
 	0,0,0,0                             /* tp_alloc -> tp_next */
 #endif
       };
-    pyswigobject_type = tmp;
-    pyswigobject_type.ob_type = &PyType_Type;
+    swigpyobject_type = tmp;
+    /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
+#if PY_VERSION_HEX < 0x03000000
+    swigpyobject_type.ob_type = &PyType_Type;
+#endif
     type_init = 1;
   }
-  return &pyswigobject_type;
+  return &swigpyobject_type;
 }
 
 SWIGRUNTIME PyObject *
-PySwigObject_New(void *ptr, swig_type_info *ty, int own)
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
 {
-  PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
+  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
   if (sobj) {
     sobj->ptr  = ptr;
     sobj->ty   = ty;
@@ -1707,10 +1852,10 @@ typedef struct {
   void *pack;
   swig_type_info *ty;
   size_t size;
-} PySwigPacked;
+} SwigPyPacked;
 
 SWIGRUNTIME int
-PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 {
   char result[SWIG_BUFFER_SIZE];
   fputs("<Swig Packed ", fp); 
@@ -1724,29 +1869,29 @@ PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
 }
   
 SWIGRUNTIME PyObject *
-PySwigPacked_repr(PySwigPacked *v)
+SwigPyPacked_repr(SwigPyPacked *v)
 {
   char result[SWIG_BUFFER_SIZE];
   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
-    return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
+    return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
   } else {
-    return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
+    return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
   }  
 }
 
 SWIGRUNTIME PyObject *
-PySwigPacked_str(PySwigPacked *v)
+SwigPyPacked_str(SwigPyPacked *v)
 {
   char result[SWIG_BUFFER_SIZE];
   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
-    return PyString_FromFormat("%s%s", result, v->ty->name);
+    return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
   } else {
-    return PyString_FromString(v->ty->name);
+    return SWIG_Python_str_FromChar(v->ty->name);
   }  
 }
 
 SWIGRUNTIME int
-PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
+SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
 {
   size_t i = v->size;
   size_t j = w->size;
@@ -1757,22 +1902,22 @@ PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
 SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
 
 SWIGRUNTIME PyTypeObject*
-PySwigPacked_type(void) {
+SwigPyPacked_type(void) {
   static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
   return type;
 }
 
 SWIGRUNTIMEINLINE int
-PySwigPacked_Check(PyObject *op) {
+SwigPyPacked_Check(PyObject *op) {
   return ((op)->ob_type == _PySwigPacked_type()) 
-    || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
+    || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
 }
 
 SWIGRUNTIME void
-PySwigPacked_dealloc(PyObject *v)
+SwigPyPacked_dealloc(PyObject *v)
 {
-  if (PySwigPacked_Check(v)) {
-    PySwigPacked *sobj = (PySwigPacked *) v;
+  if (SwigPyPacked_Check(v)) {
+    SwigPyPacked *sobj = (SwigPyPacked *) v;
     free(sobj->pack);
   }
   PyObject_DEL(v);
@@ -1781,28 +1926,37 @@ PySwigPacked_dealloc(PyObject *v)
 SWIGRUNTIME PyTypeObject*
 _PySwigPacked_type(void) {
   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
-  static PyTypeObject pyswigpacked_type;
+  static PyTypeObject swigpypacked_type;
   static int type_init = 0;  
   if (!type_init) {
     const PyTypeObject tmp
       = {
+    /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX>=0x03000000
+    PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else
 	PyObject_HEAD_INIT(NULL)
-	0,				    /* ob_size */	
-	(char *)"PySwigPacked",		    /* tp_name */	
-	sizeof(PySwigPacked),		    /* tp_basicsize */	
+    0,				    /* ob_size */	
+#endif
+	(char *)"SwigPyPacked",		    /* tp_name */	
+	sizeof(SwigPyPacked),		    /* tp_basicsize */	
 	0,				    /* tp_itemsize */	
-	(destructor)PySwigPacked_dealloc,   /* tp_dealloc */	
-	(printfunc)PySwigPacked_print,	    /* tp_print */   	
+	(destructor)SwigPyPacked_dealloc,   /* tp_dealloc */	
+	(printfunc)SwigPyPacked_print,	    /* tp_print */   	
 	(getattrfunc)0,			    /* tp_getattr */ 	
 	(setattrfunc)0,			    /* tp_setattr */ 	
-	(cmpfunc)PySwigPacked_compare,	    /* tp_compare */ 	
-	(reprfunc)PySwigPacked_repr,	    /* tp_repr */    	
-	0,	                            /* tp_as_number */	
+#if PY_VERSION_HEX>=0x03000000
+    0, /* tp_reserved in 3.0.1 */
+#else
+    (cmpfunc)SwigPyPacked_compare,	    /* tp_compare */
+#endif
+	(reprfunc)SwigPyPacked_repr,	    /* tp_repr */
+	0,	                            /* tp_as_number */
 	0,				    /* tp_as_sequence */
-	0,				    /* tp_as_mapping */	
-	(hashfunc)0,			    /* tp_hash */	
-	(ternaryfunc)0,			    /* tp_call */	
-	(reprfunc)PySwigPacked_str,	    /* tp_str */	
+	0,				    /* tp_as_mapping */
+	(hashfunc)0,			    /* tp_hash */
+	(ternaryfunc)0,			    /* tp_call */
+	(reprfunc)SwigPyPacked_str,	    /* tp_str */
 	PyObject_GenericGetAttr,            /* tp_getattro */
 	0,				    /* tp_setattro */
 	0,		                    /* tp_as_buffer */
@@ -1841,17 +1995,20 @@ _PySwigPacked_type(void) {
 	0,0,0,0                             /* tp_alloc -> tp_next */
 #endif
       };
-    pyswigpacked_type = tmp;
-    pyswigpacked_type.ob_type = &PyType_Type;
+    swigpypacked_type = tmp;
+    /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */
+#if PY_VERSION_HEX < 0x03000000
+    swigpypacked_type.ob_type = &PyType_Type;
+#endif
     type_init = 1;
   }
-  return &pyswigpacked_type;
+  return &swigpypacked_type;
 }
 
 SWIGRUNTIME PyObject *
-PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
+SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
 {
-  PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
+  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
   if (sobj) {
     void *pack = malloc(size);
     if (pack) {
@@ -1868,10 +2025,10 @@ PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
 }
 
 SWIGRUNTIME swig_type_info *
-PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
+SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
 {
-  if (PySwigPacked_Check(obj)) {
-    PySwigPacked *sobj = (PySwigPacked *)obj;
+  if (SwigPyPacked_Check(obj)) {
+    SwigPyPacked *sobj = (SwigPyPacked *)obj;
     if (sobj->size != size) return 0;
     memcpy(ptr, sobj->pack, size);
     return sobj->ty;
@@ -1887,7 +2044,7 @@ PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
 SWIGRUNTIMEINLINE PyObject *
 _SWIG_This(void)
 {
-  return PyString_FromString("this");
+    return SWIG_Python_str_FromChar("this");
 }
 
 SWIGRUNTIME PyObject *
@@ -1899,11 +2056,16 @@ SWIG_This(void)
 
 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
 
-SWIGRUNTIME PySwigObject *
+/* TODO: I don't know how to implement the fast getset in Python 3 right now */
+#if PY_VERSION_HEX>=0x03000000
+#define SWIG_PYTHON_SLOW_GETSET_THIS 
+#endif
+
+SWIGRUNTIME SwigPyObject *
 SWIG_Python_GetSwigThis(PyObject *pyobj) 
 {
-  if (PySwigObject_Check(pyobj)) {
-    return (PySwigObject *) pyobj;
+  if (SwigPyObject_Check(pyobj)) {
+    return (SwigPyObject *) pyobj;
   } else {
     PyObject *obj = 0;
 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
@@ -1939,12 +2101,12 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
       return 0;
     }
 #endif
-    if (obj && !PySwigObject_Check(obj)) {
+    if (obj && !SwigPyObject_Check(obj)) {
       /* a PyObject is called 'this', try to get the 'real this'
-	 PySwigObject from it */ 
+	 SwigPyObject from it */ 
       return SWIG_Python_GetSwigThis(obj);
     }
-    return (PySwigObject *)obj;
+    return (SwigPyObject *)obj;
   }
 }
 
@@ -1953,7 +2115,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
 SWIGRUNTIME int
 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
   if (own == SWIG_POINTER_OWN) {
-    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
     if (sobj) {
       int oldown = sobj->own;
       sobj->own = own;
@@ -1972,7 +2134,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
     if (ptr) *ptr = 0;
     return SWIG_OK;
   } else {
-    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
     if (own)
       *own = 0;
     while (sobj) {
@@ -1986,7 +2148,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
 	} else {
 	  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
 	  if (!tc) {
-	    sobj = (PySwigObject *)sobj->next;
+	    sobj = (SwigPyObject *)sobj->next;
 	  } else {
 	    if (ptr) {
               int newmemory = 0;
@@ -2015,7 +2177,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
     } else {
       int res = SWIG_ERROR;
       if (flags & SWIG_POINTER_IMPLICIT_CONV) {
-	PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+	SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
 	if (data && !data->implicitconv) {
 	  PyObject *klass = data->klass;
 	  if (klass) {
@@ -2028,7 +2190,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
 	      impconv = 0;
 	    }
 	    if (impconv) {
-	      PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
+	      SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
 	      if (iobj) {
 		void *vptr;
 		res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
@@ -2066,10 +2228,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
     /* here we get the method pointer for callbacks */
     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
-    if (desc) {
+    if (desc)
       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
-      if (!desc) return SWIG_ERROR;
-    }
+    if (!desc) 
+      return SWIG_ERROR;
     if (ty) {
       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
       if (tc) {
@@ -2090,7 +2252,7 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
 
 SWIGRUNTIME int
 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
-  swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);
+  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
   if (!to) return SWIG_ERROR;
   if (ty) {
     if (to != ty) {
@@ -2107,12 +2269,12 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t
  * ----------------------------------------------------------------------------- */
 
 /*
-  Create a new instance object, whitout calling __init__, and set the
+  Create a new instance object, without calling __init__, and set the
   'this' attribute.
 */
 
 SWIGRUNTIME PyObject* 
-SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
+SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
 {
 #if (PY_VERSION_HEX >= 0x02020000)
   PyObject *inst = 0;
@@ -2136,10 +2298,16 @@ SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
 #endif
     }
   } else {
+#if PY_VERSION_HEX >= 0x03000000
+    inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
+    PyObject_SetAttr(inst, SWIG_This(), swig_this);
+    Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
+#else
     PyObject *dict = PyDict_New();
     PyDict_SetItem(dict, SWIG_This(), swig_this);
     inst = PyInstance_NewRaw(data->newargs, dict);
     Py_DECREF(dict);
+#endif
   }
   return inst;
 #else
@@ -2202,9 +2370,9 @@ SWIG_Python_InitShadowInstance(PyObject *args) {
   if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
     return NULL;
   } else {
-    PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
+    SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
     if (sthis) {
-      PySwigObject_append((PyObject*) sthis, obj[1]);
+      SwigPyObject_append((PyObject*) sthis, obj[1]);
     } else {
       SWIG_Python_SetSwigThis(obj[0], obj[1]);
     }
@@ -2220,8 +2388,8 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
     return SWIG_Py_Void();
   } else {
     int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
-    PyObject *robj = PySwigObject_New(ptr, type, own);
-    PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;
+    PyObject *robj = SwigPyObject_New(ptr, type, own);
+    SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
     if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
       PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
       if (inst) {
@@ -2237,7 +2405,7 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
 
 SWIGRUNTIMEINLINE PyObject *
 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
-  return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
+  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
 }
 
 /* -----------------------------------------------------------------------------*
@@ -2308,8 +2476,8 @@ SWIG_Python_DestroyModule(void *vptr)
   for (i =0; i < swig_module->size; ++i) {
     swig_type_info *ty = types[i];
     if (ty->owndata) {
-      PySwigClientData *data = (PySwigClientData *) ty->clientdata;
-      if (data) PySwigClientData_Del(data);
+      SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
+      if (data) SwigPyClientData_Del(data);
     }
   }
   Py_DECREF(SWIG_This());
@@ -2319,8 +2487,13 @@ SWIGRUNTIME void
 SWIG_Python_SetModule(swig_module_info *swig_module) {
   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
 
+#if PY_VERSION_HEX >= 0x03000000
+ /* Add a dummy module object into sys.modules */
+  PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
+#else
   PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
 				   swig_empty_runtime_method_table);
+#endif
   PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
   if (pointer && module) {
     PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
@@ -2340,7 +2513,7 @@ SWIGRUNTIME swig_type_info *
 SWIG_Python_TypeQuery(const char *type)
 {
   PyObject *cache = SWIG_Python_TypeCache();
-  PyObject *key = PyString_FromString(type); 
+  PyObject *key = SWIG_Python_str_FromChar(type); 
   PyObject *obj = PyDict_GetItem(cache, key);
   swig_type_info *descriptor;
   if (obj) {
@@ -2367,21 +2540,23 @@ SWIG_Python_TypeQuery(const char *type)
 
 SWIGRUNTIME int
 SWIG_Python_AddErrMesg(const char* mesg, int infront)
-{
+{  
   if (PyErr_Occurred()) {
     PyObject *type = 0;
     PyObject *value = 0;
     PyObject *traceback = 0;
     PyErr_Fetch(&type, &value, &traceback);
     if (value) {
+      char *tmp;
       PyObject *old_str = PyObject_Str(value);
       Py_XINCREF(type);
       PyErr_Clear();
       if (infront) {
-	PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
+	PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
       } else {
-	PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+	PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
       }
+      SWIG_Python_str_DelForPy3(tmp);
       Py_DECREF(old_str);
     }
     return 1;
@@ -2404,9 +2579,9 @@ SWIG_Python_ArgFail(int argnum)
 }
 
 SWIGRUNTIMEINLINE const char *
-PySwigObject_GetDesc(PyObject *self)
+SwigPyObject_GetDesc(PyObject *self)
 {
-  PySwigObject *v = (PySwigObject *)self;
+  SwigPyObject *v = (SwigPyObject *)self;
   swig_type_info *ty = v ? v->ty : 0;
   return ty ? ty->str : (char*)"";
 }
@@ -2416,10 +2591,10 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
 {
   if (type) {
 #if defined(SWIG_COBJECT_TYPES)
-    if (obj && PySwigObject_Check(obj)) {
-      const char *otype = (const char *) PySwigObject_GetDesc(obj);
+    if (obj && SwigPyObject_Check(obj)) {
+      const char *otype = (const char *) SwigPyObject_GetDesc(obj);
       if (otype) {
-	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
+	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
 		     type, otype);
 	return;
       }
@@ -2429,10 +2604,11 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
       const char *otype = (obj ? obj->ob_type->tp_name : 0); 
       if (otype) {
 	PyObject *str = PyObject_Str(obj);
-	const char *cstr = str ? PyString_AsString(str) : 0;
+	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
 	if (cstr) {
 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
 		       type, otype, cstr);
+          SWIG_Python_str_DelForPy3(cstr);
 	} else {
 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
 		       type, otype);
@@ -2454,10 +2630,12 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
   void *result;
   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
     PyErr_Clear();
-    if (flags & SWIG_POINTER_EXCEPTION) {
+#if SWIG_POINTER_EXCEPTION
+    if (flags) {
       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
       SWIG_Python_ArgFail(argnum);
     }
+#endif
   }
   return result;
 }
@@ -2531,9 +2709,10 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
 #define SWIGTYPE_p_symbolStyleObj swig_types[45]
 #define SWIGTYPE_p_tileCacheObj swig_types[46]
 #define SWIGTYPE_p_uint32_t swig_types[47]
-#define SWIGTYPE_p_webObj swig_types[48]
-static swig_type_info *swig_types[50];
-static swig_module_info swig_module = {swig_types, 49, 0, 0, 0, 0};
+#define SWIGTYPE_p_void swig_types[48]
+#define SWIGTYPE_p_webObj swig_types[49]
+static swig_type_info *swig_types[51];
+static swig_module_info swig_module = {swig_types, 50, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
@@ -2548,11 +2727,16 @@ static swig_module_info swig_module = {swig_types, 49, 0, 0, 0, 0};
 /*-----------------------------------------------
               @(target):= _mapscript.so
   ------------------------------------------------*/
-#define SWIG_init    init_mapscript
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_init    PyInit__mapscript
 
+#else
+#  define SWIG_init    init_mapscript
+
+#endif
 #define SWIG_name    "_mapscript"
 
-#define SWIGVERSION 0x010336 
+#define SWIGVERSION 0x010340 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -2884,7 +3068,11 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
       return pchar_descriptor ? 
 	SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void();
     } else {
+#if PY_VERSION_HEX >= 0x03000000
+      return PyUnicode_FromStringAndSize(carray, (int)(size));
+#else
       return PyString_FromStringAndSize(carray, (int)(size));
+#endif
     }
   } else {
     return SWIG_Py_Void();
@@ -2905,10 +3093,28 @@ SWIG_FromCharPtr(const char *cptr)
 SWIGINTERN int
 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 {
-  if (PyString_Check(obj)) {
+#if PY_VERSION_HEX>=0x03000000
+  if (PyUnicode_Check(obj))
+#else  
+  if (PyString_Check(obj))
+#endif
+  {
     char *cstr; Py_ssize_t len;
+#if PY_VERSION_HEX>=0x03000000
+    if (!alloc && cptr) {
+        /* We can't allow converting without allocation, since the internal
+           representation of string in Python 3 is UCS-2/UCS-4 but we require
+           a UTF-8 representation.
+           TODO(bhy) More detailed explanation */
+        return SWIG_RuntimeError;
+    }
+    obj = PyUnicode_AsUTF8String(obj);
+    PyBytes_AsStringAndSize(obj, &cstr, &len);
+    if(alloc) *alloc = SWIG_NEWOBJ;
+#else
     PyString_AsStringAndSize(obj, &cstr, &len);
-    if (cptr)  {
+#endif
+    if (cptr) {
       if (alloc) {
 	/* 
 	   In python the user should not be able to modify the inner
@@ -2933,10 +3139,16 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 	  *alloc = SWIG_OLDOBJ;
 	}
       } else {
-	*cptr = PyString_AsString(obj);
+        #if PY_VERSION_HEX>=0x03000000
+        assert(0); /* Should never reach here in Python 3 */
+        #endif
+	*cptr = SWIG_Python_str_AsChar(obj);
       }
     }
     if (psize) *psize = len + 1;
+#if PY_VERSION_HEX>=0x03000000
+    Py_XDECREF(obj);
+#endif
     return SWIG_OK;
   } else {
     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
@@ -3244,6 +3456,30 @@ SWIGINTERN int labelObj_setBinding(labelObj *self,int binding,char *item){
 
     return MS_SUCCESS;
   }
+SWIGINTERN styleObj *labelObj_getStyle(labelObj *self,int i){
+      if (i >= 0 && i < self->numstyles) {
+          MS_REFCNT_INCR(self->styles[i]);
+          return self->styles[i];
+      } else {
+          msSetError(31, "Invalid index: %d", "getStyle()", i);
+          return NULL;
+      }
+  }
+SWIGINTERN int labelObj_insertStyle(labelObj *self,styleObj *style,int index){
+        return msInsertLabelStyle(self, style, index);
+    }
+SWIGINTERN styleObj *labelObj_removeStyle(labelObj *self,int index){
+	styleObj* style = (styleObj *) msRemoveLabelStyle(self, index);
+	if (style)
+		MS_REFCNT_INCR(style);
+        return style;
+    }
+SWIGINTERN int labelObj_moveStyleUp(labelObj *self,int index){
+        return msMoveLabelStyleUp(self, index);
+    }
+SWIGINTERN int labelObj_moveStyleDown(labelObj *self,int index){
+       return msMoveLabelStyleDown(self, index);
+    }
 SWIGINTERN classObj *new_classObj(layerObj *layer){
         classObj *new_class=NULL;
         
@@ -5716,8 +5952,12 @@ SWIGINTERN int symbolObj_setImagepath(symbolObj *self,char const *imagefile){
     }
 SWIGINTERN int symbolObj_setPoints(symbolObj *self,lineObj *line){
         int i;
+	self->sizex = 0;
+	self->sizey = 0;
         for (i=0; i<line->numpoints; i++) {
             MS_COPYPOINT(&(self->points[i]), &(line->point[i]));
+	    self->sizex = MS_MAX(self->sizex, self->points[i].x);
+	    self->sizey = MS_MAX(self->sizey, self->points[i].y);
         }
         self->numpoints = line->numpoints;
         return self->numpoints;
@@ -5874,7 +6114,7 @@ static char *msGetEnvURL( const char *key, void *thread_context )
 
 SWIGINTERN cgiRequestObj *new_cgiRequestObj(){
         cgiRequestObj *request;
-        
+
         request = msAllocCgiObj();
         if (!request) {
             msSetError(13, "Failed to initialize object","OWSRequest()");
@@ -5883,6 +6123,9 @@ SWIGINTERN cgiRequestObj *new_cgiRequestObj(){
         
         return request;
     }
+SWIGINTERN void delete_cgiRequestObj(cgiRequestObj *self){
+        msFreeCgiObj(self);
+    }
 SWIGINTERN int cgiRequestObj_loadParams(cgiRequestObj *self){
 	self->NumParams = loadParams( self, NULL, NULL, 0, NULL);
 	return self->NumParams;
@@ -5979,7 +6222,7 @@ gdBuffer msIO_getStdoutBufferBytes() {
 
     gdBuf.data = buf->data;
     gdBuf.size = buf->data_offset;
-    gdBuf.owns_data = MS_FALSE;
+    gdBuf.owns_data = MS_TRUE;
 
     /* we are seizing ownership of the buffer contents */
     buf->data_offset = 0;
@@ -13676,6 +13919,297 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_labelObj_getStyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  labelObj *arg1 = (labelObj *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  styleObj *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:labelObj_getStyle",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_getStyle" "', argument " "1"" of type '" "labelObj *""'"); 
+  }
+  arg1 = (labelObj *)(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "labelObj_getStyle" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  {
+    result = (styleObj *)labelObj_getStyle(arg1,arg2); {
+      errorObj *ms_error = msGetErrorObj();
+      
+      switch(ms_error->code) {
+      case MS_NOERR:
+        break;
+      case MS_NOTFOUND:
+        msResetErrorList();
+        break;
+      case -1:
+        break;
+      case MS_IOERR:
+        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
+          _raise_ms_exception();
+          msResetErrorList();
+          return NULL;
+        }
+      default:
+        _raise_ms_exception();
+        msResetErrorList();
+        return NULL;
+      }
+      
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_styleObj, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_labelObj_insertStyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  labelObj *arg1 = (labelObj *) 0 ;
+  styleObj *arg2 = (styleObj *) 0 ;
+  int arg3 = (int) -1 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO|O:labelObj_insertStyle",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_insertStyle" "', argument " "1"" of type '" "labelObj *""'"); 
+  }
+  arg1 = (labelObj *)(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_styleObj, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "labelObj_insertStyle" "', argument " "2"" of type '" "styleObj *""'"); 
+  }
+  arg2 = (styleObj *)(argp2);
+  if (obj2) {
+    ecode3 = SWIG_AsVal_int(obj2, &val3);
+    if (!SWIG_IsOK(ecode3)) {
+      SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "labelObj_insertStyle" "', argument " "3"" of type '" "int""'");
+    } 
+    arg3 = (int)(val3);
+  }
+  {
+    result = (int)labelObj_insertStyle(arg1,arg2,arg3); {
+      errorObj *ms_error = msGetErrorObj();
+      
+      switch(ms_error->code) {
+      case MS_NOERR:
+        break;
+      case MS_NOTFOUND:
+        msResetErrorList();
+        break;
+      case -1:
+        break;
+      case MS_IOERR:
+        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
+          _raise_ms_exception();
+          msResetErrorList();
+          return NULL;
+        }
+      default:
+        _raise_ms_exception();
+        msResetErrorList();
+        return NULL;
+      }
+      
+    }
+  }
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_labelObj_removeStyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  labelObj *arg1 = (labelObj *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  styleObj *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:labelObj_removeStyle",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_removeStyle" "', argument " "1"" of type '" "labelObj *""'"); 
+  }
+  arg1 = (labelObj *)(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "labelObj_removeStyle" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  {
+    result = (styleObj *)labelObj_removeStyle(arg1,arg2); {
+      errorObj *ms_error = msGetErrorObj();
+      
+      switch(ms_error->code) {
+      case MS_NOERR:
+        break;
+      case MS_NOTFOUND:
+        msResetErrorList();
+        break;
+      case -1:
+        break;
+      case MS_IOERR:
+        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
+          _raise_ms_exception();
+          msResetErrorList();
+          return NULL;
+        }
+      default:
+        _raise_ms_exception();
+        msResetErrorList();
+        return NULL;
+      }
+      
+    }
+  }
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_styleObj, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_labelObj_moveStyleUp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  labelObj *arg1 = (labelObj *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:labelObj_moveStyleUp",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_moveStyleUp" "', argument " "1"" of type '" "labelObj *""'"); 
+  }
+  arg1 = (labelObj *)(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "labelObj_moveStyleUp" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  {
+    result = (int)labelObj_moveStyleUp(arg1,arg2); {
+      errorObj *ms_error = msGetErrorObj();
+      
+      switch(ms_error->code) {
+      case MS_NOERR:
+        break;
+      case MS_NOTFOUND:
+        msResetErrorList();
+        break;
+      case -1:
+        break;
+      case MS_IOERR:
+        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
+          _raise_ms_exception();
+          msResetErrorList();
+          return NULL;
+        }
+      default:
+        _raise_ms_exception();
+        msResetErrorList();
+        return NULL;
+      }
+      
+    }
+  }
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_labelObj_moveStyleDown(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  labelObj *arg1 = (labelObj *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:labelObj_moveStyleDown",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_labelObj, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "labelObj_moveStyleDown" "', argument " "1"" of type '" "labelObj *""'"); 
+  }
+  arg1 = (labelObj *)(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "labelObj_moveStyleDown" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  {
+    result = (int)labelObj_moveStyleDown(arg1,arg2); {
+      errorObj *ms_error = msGetErrorObj();
+      
+      switch(ms_error->code) {
+      case MS_NOERR:
+        break;
+      case MS_NOTFOUND:
+        msResetErrorList();
+        break;
+      case -1:
+        break;
+      case MS_IOERR:
+        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
+          _raise_ms_exception();
+          msResetErrorList();
+          return NULL;
+        }
+      default:
+        _raise_ms_exception();
+        msResetErrorList();
+        return NULL;
+      }
+      
+    }
+  }
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_new_labelObj(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   labelObj *result = 0 ;
@@ -43317,192 +43851,28 @@ SWIGINTERN PyObject *_wrap_new_OWSRequest(PyObject *SWIGUNUSEDPARM(self), PyObje
       
     }
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_cgiRequestObj, SWIG_POINTER_NEW |  0 );
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_OWSRequest_loadParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  int result;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:OWSRequest_loadParams",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_loadParams" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
-  }
-  arg1 = (cgiRequestObj *)(argp1);
-  {
-    result = (int)cgiRequestObj_loadParams(arg1); {
-      errorObj *ms_error = msGetErrorObj();
-      
-      switch(ms_error->code) {
-      case MS_NOERR:
-        break;
-      case MS_NOTFOUND:
-        msResetErrorList();
-        break;
-      case -1:
-        break;
-      case MS_IOERR:
-        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
-          _raise_ms_exception();
-          msResetErrorList();
-          return NULL;
-        }
-      default:
-        _raise_ms_exception();
-        msResetErrorList();
-        return NULL;
-      }
-      
-    }
-  }
-  resultobj = SWIG_From_int((int)(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_OWSRequest_loadParamsFromURL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
-  char *arg2 = (char *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  int res2 ;
-  char *buf2 = 0 ;
-  int alloc2 = 0 ;
-  PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  int result;
-  
-  if (!PyArg_ParseTuple(args,(char *)"OO:OWSRequest_loadParamsFromURL",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_loadParamsFromURL" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
-  }
-  arg1 = (cgiRequestObj *)(argp1);
-  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
-  if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OWSRequest_loadParamsFromURL" "', argument " "2"" of type '" "char const *""'");
-  }
-  arg2 = (char *)(buf2);
-  {
-    result = (int)cgiRequestObj_loadParamsFromURL(arg1,(char const *)arg2); {
-      errorObj *ms_error = msGetErrorObj();
-      
-      switch(ms_error->code) {
-      case MS_NOERR:
-        break;
-      case MS_NOTFOUND:
-        msResetErrorList();
-        break;
-      case -1:
-        break;
-      case MS_IOERR:
-        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
-          _raise_ms_exception();
-          msResetErrorList();
-          return NULL;
-        }
-      default:
-        _raise_ms_exception();
-        msResetErrorList();
-        return NULL;
-      }
-      
-    }
-  }
-  resultobj = SWIG_From_int((int)(result));
-  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
-  return resultobj;
-fail:
-  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
-  return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_OWSRequest_setParameter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
-  char *arg2 = (char *) 0 ;
-  char *arg3 = (char *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"Ozz:OWSRequest_setParameter",&obj0,&arg2,&arg3)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_setParameter" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
-  }
-  arg1 = (cgiRequestObj *)(argp1);
-  {
-    cgiRequestObj_setParameter(arg1,arg2,arg3); {
-      errorObj *ms_error = msGetErrorObj();
-      
-      switch(ms_error->code) {
-      case MS_NOERR:
-        break;
-      case MS_NOTFOUND:
-        msResetErrorList();
-        break;
-      case -1:
-        break;
-      case MS_IOERR:
-        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
-          _raise_ms_exception();
-          msResetErrorList();
-          return NULL;
-        }
-      default:
-        _raise_ms_exception();
-        msResetErrorList();
-        return NULL;
-      }
-      
-    }
-  }
-  resultobj = SWIG_Py_Void();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_cgiRequestObj, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_OWSRequest_getName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_OWSRequest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
-  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  char *result = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:OWSRequest_getName",&obj0,&obj1)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_OWSRequest",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_getName" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OWSRequest" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
   }
   arg1 = (cgiRequestObj *)(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OWSRequest_getName" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = (int)(val2);
   {
-    result = (char *)cgiRequestObj_getName(arg1,arg2); {
+    delete_cgiRequestObj(arg1); {
       errorObj *ms_error = msGetErrorObj();
       
       switch(ms_error->code) {
@@ -43527,38 +43897,29 @@ SWIGINTERN PyObject *_wrap_OWSRequest_getName(PyObject *SWIGUNUSEDPARM(self), Py
       
     }
   }
-  resultobj = SWIG_FromCharPtr((const char *)result);
+  resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_OWSRequest_getValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_OWSRequest_loadParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
-  int arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
-  int val2 ;
-  int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
-  PyObject * obj1 = 0 ;
-  char *result = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:OWSRequest_getValue",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"O:OWSRequest_loadParams",&obj0)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_getValue" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_loadParams" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
   }
   arg1 = (cgiRequestObj *)(argp1);
-  ecode2 = SWIG_AsVal_int(obj1, &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OWSRequest_getValue" "', argument " "2"" of type '" "int""'");
-  } 
-  arg2 = (int)(val2);
   {
-    result = (char *)cgiRequestObj_getValue(arg1,arg2); {
+    result = (int)cgiRequestObj_loadParams(arg1); {
       errorObj *ms_error = msGetErrorObj();
       
       switch(ms_error->code) {
@@ -43583,14 +43944,14 @@ SWIGINTERN PyObject *_wrap_OWSRequest_getValue(PyObject *SWIGUNUSEDPARM(self), P
       
     }
   }
-  resultobj = SWIG_FromCharPtr((const char *)result);
+  resultobj = SWIG_From_int((int)(result));
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_OWSRequest_getValueByName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_OWSRequest_loadParamsFromURL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
   char *arg2 = (char *) 0 ;
@@ -43601,21 +43962,21 @@ SWIGINTERN PyObject *_wrap_OWSRequest_getValueByName(PyObject *SWIGUNUSEDPARM(se
   int alloc2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
-  char *result = 0 ;
+  int result;
   
-  if (!PyArg_ParseTuple(args,(char *)"OO:OWSRequest_getValueByName",&obj0,&obj1)) SWIG_fail;
+  if (!PyArg_ParseTuple(args,(char *)"OO:OWSRequest_loadParamsFromURL",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_getValueByName" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_loadParamsFromURL" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
   }
   arg1 = (cgiRequestObj *)(argp1);
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OWSRequest_getValueByName" "', argument " "2"" of type '" "char const *""'");
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OWSRequest_loadParamsFromURL" "', argument " "2"" of type '" "char const *""'");
   }
   arg2 = (char *)(buf2);
   {
-    result = (char *)cgiRequestObj_getValueByName(arg1,(char const *)arg2); {
+    result = (int)cgiRequestObj_loadParamsFromURL(arg1,(char const *)arg2); {
       errorObj *ms_error = msGetErrorObj();
       
       switch(ms_error->code) {
@@ -43640,7 +44001,7 @@ SWIGINTERN PyObject *_wrap_OWSRequest_getValueByName(PyObject *SWIGUNUSEDPARM(se
       
     }
   }
-  resultobj = SWIG_FromCharPtr((const char *)result);
+  resultobj = SWIG_From_int((int)(result));
   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
   return resultobj;
 fail:
@@ -43649,21 +44010,23 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_OWSRequest__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_OWSRequest_setParameter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject * obj0 = 0 ;
   
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_OWSRequest",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, SWIG_POINTER_DISOWN |  0 );
+  if (!PyArg_ParseTuple(args,(char *)"Ozz:OWSRequest_setParameter",&obj0,&arg2,&arg3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OWSRequest" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_setParameter" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
   }
   arg1 = (cgiRequestObj *)(argp1);
   {
-    free((char *) arg1); {
+    cgiRequestObj_setParameter(arg1,arg2,arg3); {
       errorObj *ms_error = msGetErrorObj();
       
       switch(ms_error->code) {
@@ -43695,31 +44058,173 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_OWSRequest(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[2];
-  int ii;
+SWIGINTERN PyObject *_wrap_OWSRequest_getName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  char *result = 0 ;
   
-  if (!PyTuple_Check(args)) SWIG_fail;
-  argc = (int)PyObject_Length(args);
-  for (ii = 0; (ii < argc) && (ii < 1); ii++) {
-    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  if (!PyArg_ParseTuple(args,(char *)"OO:OWSRequest_getName",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_getName" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
   }
-  if (argc == 1) {
-    int _v;
-    void *vptr = 0;
-    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_cgiRequestObj, 0);
-    _v = SWIG_CheckState(res);
-    if (_v) {
-      return _wrap_delete_OWSRequest__SWIG_1(self, args);
+  arg1 = (cgiRequestObj *)(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OWSRequest_getName" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  {
+    result = (char *)cgiRequestObj_getName(arg1,arg2); {
+      errorObj *ms_error = msGetErrorObj();
+      
+      switch(ms_error->code) {
+      case MS_NOERR:
+        break;
+      case MS_NOTFOUND:
+        msResetErrorList();
+        break;
+      case -1:
+        break;
+      case MS_IOERR:
+        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
+          _raise_ms_exception();
+          msResetErrorList();
+          return NULL;
+        }
+      default:
+        _raise_ms_exception();
+        msResetErrorList();
+        return NULL;
+      }
+      
     }
   }
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_OWSRequest_getValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  char *result = 0 ;
   
+  if (!PyArg_ParseTuple(args,(char *)"OO:OWSRequest_getValue",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_getValue" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
+  }
+  arg1 = (cgiRequestObj *)(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OWSRequest_getValue" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  {
+    result = (char *)cgiRequestObj_getValue(arg1,arg2); {
+      errorObj *ms_error = msGetErrorObj();
+      
+      switch(ms_error->code) {
+      case MS_NOERR:
+        break;
+      case MS_NOTFOUND:
+        msResetErrorList();
+        break;
+      case -1:
+        break;
+      case MS_IOERR:
+        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
+          _raise_ms_exception();
+          msResetErrorList();
+          return NULL;
+        }
+      default:
+        _raise_ms_exception();
+        msResetErrorList();
+        return NULL;
+      }
+      
+    }
+  }
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'delete_OWSRequest'.\n"
-    "  Possible C/C++ prototypes are:\n"
-    "    ~cgiRequestObj()\n"
-    "    cgiRequestObj::~cgiRequestObj(cgiRequestObj *)\n");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_OWSRequest_getValueByName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  cgiRequestObj *arg1 = (cgiRequestObj *) 0 ;
+  char *arg2 = (char *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:OWSRequest_getValueByName",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_cgiRequestObj, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OWSRequest_getValueByName" "', argument " "1"" of type '" "cgiRequestObj *""'"); 
+  }
+  arg1 = (cgiRequestObj *)(argp1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OWSRequest_getValueByName" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  {
+    result = (char *)cgiRequestObj_getValueByName(arg1,(char const *)arg2); {
+      errorObj *ms_error = msGetErrorObj();
+      
+      switch(ms_error->code) {
+      case MS_NOERR:
+        break;
+      case MS_NOTFOUND:
+        msResetErrorList();
+        break;
+      case -1:
+        break;
+      case MS_IOERR:
+        if (strcmp(ms_error->routine, "msSearchDiskTree()") != 0) {
+          _raise_ms_exception();
+          msResetErrorList();
+          return NULL;
+        }
+      default:
+        _raise_ms_exception();
+        msResetErrorList();
+        return NULL;
+      }
+      
+    }
+  }
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
   return NULL;
 }
 
@@ -43911,6 +44416,7 @@ SWIGINTERN PyObject *_wrap_msIO_stripStdoutBufferContentType(PyObject *SWIGUNUSE
     }
   }
   resultobj = SWIG_FromCharPtr((const char *)result);
+  free((char*)result);
   return resultobj;
 fail:
   return NULL;
@@ -44035,6 +44541,7 @@ fail:
 
 
 static PyMethodDef SwigMethods[] = {
+	 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
 	 { (char *)"new_intarray", _wrap_new_intarray, METH_VARARGS, NULL},
 	 { (char *)"delete_intarray", _wrap_delete_intarray, METH_VARARGS, NULL},
 	 { (char *)"intarray___getitem__", _wrap_intarray___getitem__, METH_VARARGS, NULL},
@@ -44302,6 +44809,11 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"labelObj_removeBinding", _wrap_labelObj_removeBinding, METH_VARARGS, NULL},
 	 { (char *)"labelObj_getBinding", _wrap_labelObj_getBinding, METH_VARARGS, NULL},
 	 { (char *)"labelObj_setBinding", _wrap_labelObj_setBinding, METH_VARARGS, NULL},
+	 { (char *)"labelObj_getStyle", _wrap_labelObj_getStyle, METH_VARARGS, NULL},
+	 { (char *)"labelObj_insertStyle", _wrap_labelObj_insertStyle, METH_VARARGS, NULL},
+	 { (char *)"labelObj_removeStyle", _wrap_labelObj_removeStyle, METH_VARARGS, NULL},
+	 { (char *)"labelObj_moveStyleUp", _wrap_labelObj_moveStyleUp, METH_VARARGS, NULL},
+	 { (char *)"labelObj_moveStyleDown", _wrap_labelObj_moveStyleDown, METH_VARARGS, NULL},
 	 { (char *)"new_labelObj", _wrap_new_labelObj, METH_VARARGS, NULL},
 	 { (char *)"delete_labelObj", _wrap_delete_labelObj, METH_VARARGS, NULL},
 	 { (char *)"labelObj_swigregister", labelObj_swigregister, METH_VARARGS, NULL},
@@ -45142,13 +45654,13 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"OWSRequest_httpcookiedata_set", _wrap_OWSRequest_httpcookiedata_set, METH_VARARGS, NULL},
 	 { (char *)"OWSRequest_httpcookiedata_get", _wrap_OWSRequest_httpcookiedata_get, METH_VARARGS, NULL},
 	 { (char *)"new_OWSRequest", _wrap_new_OWSRequest, METH_VARARGS, NULL},
+	 { (char *)"delete_OWSRequest", _wrap_delete_OWSRequest, METH_VARARGS, NULL},
 	 { (char *)"OWSRequest_loadParams", _wrap_OWSRequest_loadParams, METH_VARARGS, NULL},
 	 { (char *)"OWSRequest_loadParamsFromURL", _wrap_OWSRequest_loadParamsFromURL, METH_VARARGS, NULL},
 	 { (char *)"OWSRequest_setParameter", _wrap_OWSRequest_setParameter, METH_VARARGS, NULL},
 	 { (char *)"OWSRequest_getName", _wrap_OWSRequest_getName, METH_VARARGS, NULL},
 	 { (char *)"OWSRequest_getValue", _wrap_OWSRequest_getValue, METH_VARARGS, NULL},
 	 { (char *)"OWSRequest_getValueByName", _wrap_OWSRequest_getValueByName, METH_VARARGS, NULL},
-	 { (char *)"delete_OWSRequest", _wrap_delete_OWSRequest, METH_VARARGS, NULL},
 	 { (char *)"OWSRequest_swigregister", OWSRequest_swigregister, METH_VARARGS, NULL},
 	 { (char *)"msConnPoolCloseUnreferenced", _wrap_msConnPoolCloseUnreferenced, METH_VARARGS, NULL},
 	 { (char *)"msIO_resetHandlers", _wrap_msIO_resetHandlers, METH_VARARGS, NULL},
@@ -45215,6 +45727,7 @@ static swig_type_info _swigt__p_symbolSetObj = {"_p_symbolSetObj", "symbolSetObj
 static swig_type_info _swigt__p_symbolStyleObj = {"_p_symbolStyleObj", "symbolStyleObj *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_tileCacheObj = {"_p_tileCacheObj", "struct tileCacheObj *|tileCacheObj *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *|ms_uint32 *|ms_bitarray", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_webObj = {"_p_webObj", "webObj *", 0, 0, (void*)0, 0};
 
 static swig_type_info *swig_type_initial[] = {
@@ -45266,6 +45779,7 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_symbolStyleObj,
   &_swigt__p_tileCacheObj,
   &_swigt__p_uint32_t,
+  &_swigt__p_void,
   &_swigt__p_webObj,
 };
 
@@ -45317,6 +45831,7 @@ static swig_cast_info _swigc__p_symbolSetObj[] = {  {&_swigt__p_symbolSetObj, 0,
 static swig_cast_info _swigc__p_symbolStyleObj[] = {  {&_swigt__p_symbolStyleObj, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_tileCacheObj[] = {  {&_swigt__p_tileCacheObj, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_uint32_t[] = {  {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_webObj[] = {  {&_swigt__p_webObj, 0, 0, 0},{0, 0, 0, 0}};
 
 static swig_cast_info *swig_cast_initial[] = {
@@ -45368,6 +45883,7 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_symbolStyleObj,
   _swigc__p_tileCacheObj,
   _swigc__p_uint32_t,
+  _swigc__p_void,
   _swigc__p_webObj,
 };
 
@@ -45646,26 +46162,58 @@ extern "C" {
   
   SWIGINTERN PyObject *
   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
+#if PY_VERSION_HEX >= 0x03000000
+    return PyUnicode_InternFromString("<Swig global variables>");
+#else
     return PyString_FromString("<Swig global variables>");
+#endif
   }
   
   SWIGINTERN PyObject *
   swig_varlink_str(swig_varlinkobject *v) {
+#if PY_VERSION_HEX >= 0x03000000
+    PyObject *str = PyUnicode_InternFromString("(");
+    PyObject *tail;
+    PyObject *joined;
+    swig_globalvar *var;
+    for (var = v->vars; var; var=var->next) {
+      tail = PyUnicode_FromString(var->name);
+      joined = PyUnicode_Concat(str, tail);
+      Py_DecRef(str);
+      Py_DecRef(tail);
+      str = joined;
+      if (var->next) {
+        tail = PyUnicode_InternFromString(", ");
+        joined = PyUnicode_Concat(str, tail);
+        Py_DecRef(str);
+        Py_DecRef(tail);
+        str = joined;
+      }
+    }
+    tail = PyUnicode_InternFromString(")");
+    joined = PyUnicode_Concat(str, tail);
+    Py_DecRef(str);
+    Py_DecRef(tail);
+    str = joined;
+#else
     PyObject *str = PyString_FromString("(");
-    swig_globalvar  *var;
+    swig_globalvar *var;
     for (var = v->vars; var; var=var->next) {
       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
     }
     PyString_ConcatAndDel(&str,PyString_FromString(")"));
+#endif
     return str;
   }
   
   SWIGINTERN int
   swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
+    char *tmp;
     PyObject *str = swig_varlink_str(v);
     fprintf(fp,"Swig global variables ");
-    fprintf(fp,"%s\n", PyString_AsString(str));
+    fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
+    SWIG_Python_str_DelForPy3(tmp);
     Py_DECREF(str);
     return 0;
   }
@@ -45723,12 +46271,17 @@ extern "C" {
     if (!type_init) {
       const PyTypeObject tmp
       = {
+        /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+        PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else
         PyObject_HEAD_INIT(NULL)
         0,                                  /* Number of items in variable part (ob_size) */
+#endif
         (char *)"swigvarlink",              /* Type name (tp_name) */
         sizeof(swig_varlinkobject),         /* Basic size (tp_basicsize) */
         0,                                  /* Itemsize (tp_itemsize) */
-        (destructor) swig_varlink_dealloc,   /* Deallocator (tp_dealloc) */ 
+        (destructor) swig_varlink_dealloc,  /* Deallocator (tp_dealloc) */ 
         (printfunc) swig_varlink_print,     /* Print (tp_print) */
         (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
         (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
@@ -45739,7 +46292,7 @@ extern "C" {
         0,                                  /* tp_as_mapping */
         0,                                  /* tp_hash */
         0,                                  /* tp_call */
-        (reprfunc)swig_varlink_str,        /* tp_str */
+        (reprfunc) swig_varlink_str,        /* tp_str */
         0,                                  /* tp_getattro */
         0,                                  /* tp_setattro */
         0,                                  /* tp_as_buffer */
@@ -45760,7 +46313,10 @@ extern "C" {
 #endif
       };
       varlink_type = tmp;
+      /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
+#if PY_VERSION_HEX < 0x03000000
       varlink_type.ob_type = &PyType_Type;
+#endif
       type_init = 1;
     }
     return &varlink_type;
@@ -45885,13 +46441,37 @@ extern "C" {
 #ifdef __cplusplus
 extern "C"
 #endif
-SWIGEXPORT void SWIG_init(void) {
-  PyObject *m, *d;
+
+SWIGEXPORT 
+#if PY_VERSION_HEX >= 0x03000000
+PyObject*
+#else
+void
+#endif
+SWIG_init(void) {
+  PyObject *m, *d;  
+#if PY_VERSION_HEX >= 0x03000000
+  static struct PyModuleDef SWIG_module = {
+    PyModuleDef_HEAD_INIT,
+    (char *) SWIG_name,
+    NULL,
+    -1,
+    SwigMethods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+  };
+#endif
   
   /* Fix SwigMethods to carry the callback ptrs when needed */
   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
   
+#if PY_VERSION_HEX >= 0x03000000
+  m = PyModule_Create(&SWIG_module);
+#else
   m = Py_InitModule((char *) SWIG_name, SwigMethods);
+#endif
   d = PyModule_GetDict(m);
   
   SWIG_InitializeModule(0);
@@ -45920,11 +46500,11 @@ SWIGEXPORT void SWIG_init(void) {
   PyDict_SetItemString(d, "MapServerChildError", MSExc_MapServerChildError);
   
   
-  SWIG_Python_SetConstant(d, "MS_VERSION",SWIG_FromCharPtr("6.0.1"));
+  SWIG_Python_SetConstant(d, "MS_VERSION",SWIG_FromCharPtr("6.0.3"));
   SWIG_Python_SetConstant(d, "MS_VERSION_MAJOR",SWIG_From_int((int)(6)));
   SWIG_Python_SetConstant(d, "MS_VERSION_MINOR",SWIG_From_int((int)(0)));
-  SWIG_Python_SetConstant(d, "MS_VERSION_REV",SWIG_From_int((int)(1)));
-  SWIG_Python_SetConstant(d, "MS_VERSION_NUM",SWIG_From_int((int)((6*10000+0*100+1))));
+  SWIG_Python_SetConstant(d, "MS_VERSION_REV",SWIG_From_int((int)(3)));
+  SWIG_Python_SetConstant(d, "MS_VERSION_NUM",SWIG_From_int((int)((6*10000+0*100+3))));
   SWIG_Python_SetConstant(d, "__FUNCTION__",SWIG_FromCharPtr("MapServer"));
   SWIG_Python_SetConstant(d, "MS_TRUE",SWIG_From_int((int)(1)));
   SWIG_Python_SetConstant(d, "MS_FALSE",SWIG_From_int((int)(0)));
@@ -46221,5 +46801,10 @@ SWIGEXPORT void SWIG_init(void) {
   SWIG_Python_SetConstant(d, "MS_DEFAULT_CGI_PARAMS",SWIG_From_int((int)(100)));
   SWIG_Python_SetConstant(d, "MS_GET_REQUEST",SWIG_From_int((int)(MS_GET_REQUEST)));
   SWIG_Python_SetConstant(d, "MS_POST_REQUEST",SWIG_From_int((int)(MS_POST_REQUEST)));
+#if PY_VERSION_HEX >= 0x03000000
+  return m;
+#else
+  return;
+#endif
 }
 
diff --git a/mapscript/python/pyextend.i b/mapscript/python/pyextend.i
index 32e2fc3..aa31568 100644
--- a/mapscript/python/pyextend.i
+++ b/mapscript/python/pyextend.i
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: pyextend.i 11232 2011-03-18 15:47:40Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Python-specific extensions to MapScript objects
diff --git a/mapscript/python/pygdioctx/pygdioctx.c b/mapscript/python/pygdioctx/pygdioctx.c
index 968ff21..6b6e9ed 100644
--- a/mapscript/python/pygdioctx/pygdioctx.c
+++ b/mapscript/python/pygdioctx/pygdioctx.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: pygdioctx.c 10743 2010-11-19 17:05:38Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Interface Python file-like objects with GD through IOCtx
diff --git a/mapscript/python/pygdioctx/pygdioctx.h b/mapscript/python/pygdioctx/pygdioctx.h
index 9bc6400..13da345 100644
--- a/mapscript/python/pygdioctx/pygdioctx.h
+++ b/mapscript/python/pygdioctx/pygdioctx.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: pygdioctx.h 6389 2007-07-25 16:36:55Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Interface Python file-like objects with GD through IOCtx
diff --git a/mapscript/python/pymodule.i b/mapscript/python/pymodule.i
index 6267c68..9ba4e68 100644
--- a/mapscript/python/pymodule.i
+++ b/mapscript/python/pymodule.i
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: pymodule.i 9497 2009-10-20 03:27:18Z warmerdam $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Python-specific enhancements to MapScript
@@ -159,18 +159,30 @@ MapServerChildError = _mapscript.MapServerChildError
 /* The bogus "if 1:" is to introduce a new scope to work around indentation
    handling with pythonappend in different versions.  (#3180) */
 %feature("pythonappend") layerObj %{if 1:
-	  if args and len(args)!=0:
-		self.p_map=args[0]
-	  else:
-		self.p_map=None%}
+            self.p_map=None
+            try:
+                # python 2.5
+                if args and len(args)!=0: 
+                    self.p_map=args[0]
+            except NameError:
+                # python 2.6
+                if map: 
+                    self.p_map=map
+       %}
 
 /* The bogus "if 1:" is to introduce a new scope to work around indentation
    handling with pythonappend in different versions. (#3180) */
 %feature("pythonappend") classObj %{if 1:
-	   if args and len(args)!=0:
-		self.p_layer=args[0]
-	   else:
-		self.p_layer=None%}
+            self.p_layer =None
+            try:
+                # python 2.5
+                if args and len(args)!=0: 
+                    self.p_layer=args[0]
+            except NameError:
+                # python 2.6
+                if layer: 
+                    self.p_layer=layer
+       %}
 
 %feature("shadow") insertClass %{
 	def insertClass(*args):
diff --git a/mapscript/python/setup.py b/mapscript/python/setup.py
index 7ea5f98..4ac33b5 100644
--- a/mapscript/python/setup.py
+++ b/mapscript/python/setup.py
@@ -1,4 +1,4 @@
-# $Id: setup.py 10457 2010-08-14 16:41:44Z hobu $
+# $Id$
 #
 # setup.py file for MapScript
 #
diff --git a/mapscript/python/tests/TESTING.txt b/mapscript/python/tests/TESTING.txt
index def588c..d212bfa 100644
--- a/mapscript/python/tests/TESTING.txt
+++ b/mapscript/python/tests/TESTING.txt
@@ -1,4 +1,4 @@
-.. $Id: TESTING.txt 4196 2004-11-29 21:08:49Z sean $
+.. $Id$
 
 Python MapScript Unit Tests
 ========================================
diff --git a/mapscript/python/tests/cases/classtest.py b/mapscript/python/tests/cases/classtest.py
index f47797d..86a6a42 100644
--- a/mapscript/python/tests/cases/classtest.py
+++ b/mapscript/python/tests/cases/classtest.py
@@ -1,4 +1,4 @@
-# $Id: classtest.py 6517 2007-08-08 20:34:10Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of classObj
diff --git a/mapscript/python/tests/cases/clonetest.py b/mapscript/python/tests/cases/clonetest.py
index 303dff6..3b69177 100644
--- a/mapscript/python/tests/cases/clonetest.py
+++ b/mapscript/python/tests/cases/clonetest.py
@@ -1,4 +1,4 @@
-# $Id: clonetest.py 6518 2007-08-08 20:35:20Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of map cloning
diff --git a/mapscript/python/tests/cases/colortest.py b/mapscript/python/tests/cases/colortest.py
index 9d86186..df0a548 100644
--- a/mapscript/python/tests/cases/colortest.py
+++ b/mapscript/python/tests/cases/colortest.py
@@ -1,4 +1,4 @@
-# $Id: colortest.py 3880 2004-10-26 15:43:54Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of colorObj
diff --git a/mapscript/python/tests/cases/fonttest.py b/mapscript/python/tests/cases/fonttest.py
index 3ac1abb..622e007 100644
--- a/mapscript/python/tests/cases/fonttest.py
+++ b/mapscript/python/tests/cases/fonttest.py
@@ -1,4 +1,4 @@
-# $Id: fonttest.py 4597 2005-05-10 15:00:20Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of hashTableObj
diff --git a/mapscript/python/tests/cases/hashtest.py b/mapscript/python/tests/cases/hashtest.py
index 9f6ebaf..cb405de 100644
--- a/mapscript/python/tests/cases/hashtest.py
+++ b/mapscript/python/tests/cases/hashtest.py
@@ -1,4 +1,4 @@
-# $Id: hashtest.py 3702 2004-10-02 23:34:15Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of hashTableObj
diff --git a/mapscript/python/tests/cases/imagetest.py b/mapscript/python/tests/cases/imagetest.py
index 2e1175f..12154b4 100644
--- a/mapscript/python/tests/cases/imagetest.py
+++ b/mapscript/python/tests/cases/imagetest.py
@@ -1,4 +1,4 @@
-# $Id: imagetest.py 6192 2007-06-11 01:40:25Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of map cloning
diff --git a/mapscript/python/tests/cases/labeltest.py b/mapscript/python/tests/cases/labeltest.py
index db4e1fe..1fbe9d0 100644
--- a/mapscript/python/tests/cases/labeltest.py
+++ b/mapscript/python/tests/cases/labeltest.py
@@ -1,4 +1,4 @@
-# $Id: labeltest.py 8000 2008-10-24 15:42:15Z aboudreault $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Map
diff --git a/mapscript/python/tests/cases/layertest.py b/mapscript/python/tests/cases/layertest.py
index 0522ff8..92e2c48 100644
--- a/mapscript/python/tests/cases/layertest.py
+++ b/mapscript/python/tests/cases/layertest.py
@@ -1,4 +1,4 @@
-# $Id: layertest.py 6519 2007-08-08 20:37:34Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Layer
diff --git a/mapscript/python/tests/cases/linetest.py b/mapscript/python/tests/cases/linetest.py
index 62cea72..caaa23e 100644
--- a/mapscript/python/tests/cases/linetest.py
+++ b/mapscript/python/tests/cases/linetest.py
@@ -1,4 +1,4 @@
-# $Id: linetest.py 3632 2004-09-28 15:14:08Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Map "zooming"
diff --git a/mapscript/python/tests/cases/maptest.py b/mapscript/python/tests/cases/maptest.py
index 7f4ea3c..36c2ec3 100644
--- a/mapscript/python/tests/cases/maptest.py
+++ b/mapscript/python/tests/cases/maptest.py
@@ -1,4 +1,4 @@
-# $Id: maptest.py 8389 2009-01-06 15:27:12Z aboudreault $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Map
diff --git a/mapscript/python/tests/cases/outputformattest.py b/mapscript/python/tests/cases/outputformattest.py
index c7a69e3..90c9ca8 100644
--- a/mapscript/python/tests/cases/outputformattest.py
+++ b/mapscript/python/tests/cases/outputformattest.py
@@ -1,4 +1,4 @@
-# $Id: outputformattest.py 4482 2005-03-10 22:57:25Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of outputFormatObj
diff --git a/mapscript/python/tests/cases/owstest.py b/mapscript/python/tests/cases/owstest.py
index 6cd8ebe..6f4e906 100644
--- a/mapscript/python/tests/cases/owstest.py
+++ b/mapscript/python/tests/cases/owstest.py
@@ -1,4 +1,4 @@
-# $Id: owstest.py 6559 2007-08-12 02:14:18Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of OWS Requests
diff --git a/mapscript/python/tests/cases/pgtest.py b/mapscript/python/tests/cases/pgtest.py
index afc3539..bfe9c0d 100644
--- a/mapscript/python/tests/cases/pgtest.py
+++ b/mapscript/python/tests/cases/pgtest.py
@@ -1,4 +1,4 @@
-# $Id: pgtest.py 5546 2006-07-04 01:05:58Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of PostGIS Layer
diff --git a/mapscript/python/tests/cases/pointtest.py b/mapscript/python/tests/cases/pointtest.py
index 49880f5..e106184 100644
--- a/mapscript/python/tests/cases/pointtest.py
+++ b/mapscript/python/tests/cases/pointtest.py
@@ -1,4 +1,4 @@
-# $Id: pointtest.py 4533 2005-04-14 18:33:56Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Point
diff --git a/mapscript/python/tests/cases/recttest.py b/mapscript/python/tests/cases/recttest.py
index af1c9fb..1393080 100644
--- a/mapscript/python/tests/cases/recttest.py
+++ b/mapscript/python/tests/cases/recttest.py
@@ -1,4 +1,4 @@
-# $Id: recttest.py 4083 2004-11-12 20:52:14Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of rectObj
diff --git a/mapscript/python/tests/cases/refcount.py b/mapscript/python/tests/cases/refcount.py
index 53bc95e..3087b22 100644
--- a/mapscript/python/tests/cases/refcount.py
+++ b/mapscript/python/tests/cases/refcount.py
@@ -1,4 +1,4 @@
-# $Id: refcount.py 7205 2007-12-22 09:13:59Z unicoletti $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Map
diff --git a/mapscript/python/tests/cases/resultcachetest.py b/mapscript/python/tests/cases/resultcachetest.py
index fc169e3..11627b2 100644
--- a/mapscript/python/tests/cases/resultcachetest.py
+++ b/mapscript/python/tests/cases/resultcachetest.py
@@ -1,4 +1,4 @@
-# $Id: resultcachetest.py 3886 2004-10-26 17:18:34Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of ResultCache
diff --git a/mapscript/python/tests/cases/runalltests.py b/mapscript/python/tests/cases/runalltests.py
index f959151..f1dd04b 100644
--- a/mapscript/python/tests/cases/runalltests.py
+++ b/mapscript/python/tests/cases/runalltests.py
@@ -1,4 +1,4 @@
-# $Id: runalltests.py 4154 2004-11-23 16:00:45Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  Comprehensive xUnit style Python mapscript test runner
diff --git a/mapscript/python/tests/cases/shapefiletest.py b/mapscript/python/tests/cases/shapefiletest.py
index a014a01..75f126f 100644
--- a/mapscript/python/tests/cases/shapefiletest.py
+++ b/mapscript/python/tests/cases/shapefiletest.py
@@ -1,4 +1,4 @@
-# $Id: shapefiletest.py 6190 2007-06-10 15:33:30Z unicoletti $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of shapefileObj
diff --git a/mapscript/python/tests/cases/shapetest.py b/mapscript/python/tests/cases/shapetest.py
index c723bfa..375c928 100644
--- a/mapscript/python/tests/cases/shapetest.py
+++ b/mapscript/python/tests/cases/shapetest.py
@@ -1,4 +1,4 @@
-# $Id: shapetest.py 6523 2007-08-08 20:50:12Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Shape
diff --git a/mapscript/python/tests/cases/styletest.py b/mapscript/python/tests/cases/styletest.py
index 8088653..dd0af68 100644
--- a/mapscript/python/tests/cases/styletest.py
+++ b/mapscript/python/tests/cases/styletest.py
@@ -1,4 +1,4 @@
-# $Id: styletest.py 8000 2008-10-24 15:42:15Z aboudreault $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Map Styles
diff --git a/mapscript/python/tests/cases/symbolsettest.py b/mapscript/python/tests/cases/symbolsettest.py
index d58596d..8a16580 100644
--- a/mapscript/python/tests/cases/symbolsettest.py
+++ b/mapscript/python/tests/cases/symbolsettest.py
@@ -1,4 +1,4 @@
-# $Id: symbolsettest.py 6566 2007-08-12 16:07:51Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of SymbolSet
diff --git a/mapscript/python/tests/cases/symboltest.py b/mapscript/python/tests/cases/symboltest.py
index b4128f8..30937ae 100644
--- a/mapscript/python/tests/cases/symboltest.py
+++ b/mapscript/python/tests/cases/symboltest.py
@@ -1,4 +1,4 @@
-# $Id: symboltest.py 6522 2007-08-08 20:43:38Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Symbol
diff --git a/mapscript/python/tests/cases/testing.py b/mapscript/python/tests/cases/testing.py
index fbc7fb5..04f98d7 100644
--- a/mapscript/python/tests/cases/testing.py
+++ b/mapscript/python/tests/cases/testing.py
@@ -1,4 +1,4 @@
-# $Id: testing.py 5539 2006-07-03 21:35:10Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript testing utilities
diff --git a/mapscript/python/tests/cases/threadtest.py b/mapscript/python/tests/cases/threadtest.py
index 82ddb6e..1a0538e 100644
--- a/mapscript/python/tests/cases/threadtest.py
+++ b/mapscript/python/tests/cases/threadtest.py
@@ -1,4 +1,4 @@
-# $Id: threadtest.py 6191 2007-06-11 01:23:09Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript test of multi-threading
diff --git a/mapscript/python/tests/cases/zoomtest.py b/mapscript/python/tests/cases/zoomtest.py
index d2887ab..111274b 100644
--- a/mapscript/python/tests/cases/zoomtest.py
+++ b/mapscript/python/tests/cases/zoomtest.py
@@ -1,4 +1,4 @@
-# $Id: zoomtest.py 5542 2006-07-03 22:43:20Z hobu $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript tests of Map "zooming"
diff --git a/mapscript/python/tests/runtests.py b/mapscript/python/tests/runtests.py
index a2118bc..e6b434c 100644
--- a/mapscript/python/tests/runtests.py
+++ b/mapscript/python/tests/runtests.py
@@ -1,4 +1,4 @@
-# $Id: runtests.py 3738 2004-10-06 21:32:33Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  Comprehensive xUnit style Python mapscript test suite
diff --git a/mapscript/python/tests/timing/clonemaps.py b/mapscript/python/tests/timing/clonemaps.py
index 7e65d84..d3274b1 100644
--- a/mapscript/python/tests/timing/clonemaps.py
+++ b/mapscript/python/tests/timing/clonemaps.py
@@ -1,4 +1,4 @@
-# $Id: clonemaps.py 3454 2004-08-10 14:22:07Z sean $
+# $Id$
 #
 # Timing tests of mapfile parsing vs map cloning
 
diff --git a/mapscript/python/tests/timing/drawshapes.py b/mapscript/python/tests/timing/drawshapes.py
index 07520a7..e985afb 100644
--- a/mapscript/python/tests/timing/drawshapes.py
+++ b/mapscript/python/tests/timing/drawshapes.py
@@ -1,4 +1,4 @@
-# $Id: drawshapes.py 4218 2004-12-07 21:33:28Z sean $
+# $Id$
 #
 # Timing tests of feature drawing -- map.draw vs drawing features
 # shape by shape.
diff --git a/mapscript/python/tests/timing/testing.py b/mapscript/python/tests/timing/testing.py
index 0c9c265..ff97282 100644
--- a/mapscript/python/tests/timing/testing.py
+++ b/mapscript/python/tests/timing/testing.py
@@ -1,4 +1,4 @@
-# $Id: testing.py 3454 2004-08-10 14:22:07Z sean $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  xUnit style Python mapscript testing utilities
diff --git a/mapscript/ruby/rbextend.i b/mapscript/ruby/rbextend.i
index b2cbf90..a5bb308 100644
--- a/mapscript/ruby/rbextend.i
+++ b/mapscript/ruby/rbextend.i
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: rbextend.i 2696 2004-02-02 23:37:24Z sean $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Ruby-specific extensions to MapScript objects
diff --git a/mapscript/ruby/rbmodule.i b/mapscript/ruby/rbmodule.i
index b5a06da..88b8ca7 100644
--- a/mapscript/ruby/rbmodule.i
+++ b/mapscript/ruby/rbmodule.i
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: rbmodule.i 11185 2011-03-17 13:27:56Z jimk $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Ruby-specific enhancements to MapScript
diff --git a/mapscript/swiginc/class.i b/mapscript/swiginc/class.i
index 1ed1c90..4eea095 100644
--- a/mapscript/swiginc/class.i
+++ b/mapscript/swiginc/class.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: class.i 7210 2007-12-23 20:41:38Z tamas $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript classObj extensions
diff --git a/mapscript/swiginc/cluster.i b/mapscript/swiginc/cluster.i
index 20cbfc1..220f401 100644
--- a/mapscript/swiginc/cluster.i
+++ b/mapscript/swiginc/cluster.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: cluster.i 11056 2011-03-03 22:21:25Z tamas $
+   $Id$
 
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript clusterObj extensions
diff --git a/mapscript/swiginc/color.i b/mapscript/swiginc/color.i
index 900e296..01a2ce8 100644
--- a/mapscript/swiginc/color.i
+++ b/mapscript/swiginc/color.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: color.i 11208 2011-03-17 19:44:08Z tbonfort $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript colorObj extensions
diff --git a/mapscript/swiginc/connpool.i b/mapscript/swiginc/connpool.i
index 159be35..89834df 100644
--- a/mapscript/swiginc/connpool.i
+++ b/mapscript/swiginc/connpool.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: connpool.i 5196 2006-02-15 16:33:20Z umberto $
+   $Id$
    
    Project:  MapServer
    Purpose:  SWIG interface file for connection pool management
diff --git a/mapscript/swiginc/dbfinfo.i b/mapscript/swiginc/dbfinfo.i
index 73a6df1..e8c3c3b 100644
--- a/mapscript/swiginc/dbfinfo.i
+++ b/mapscript/swiginc/dbfinfo.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: dbfinfo.i 6190 2007-06-10 15:33:30Z unicoletti $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript DBFInfo extensions
diff --git a/mapscript/swiginc/error.i b/mapscript/swiginc/error.i
index b62649e..86e672e 100644
--- a/mapscript/swiginc/error.i
+++ b/mapscript/swiginc/error.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: error.i 4424 2005-02-18 20:10:01Z sean $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript errorObj extensions
diff --git a/mapscript/swiginc/hashtable.i b/mapscript/swiginc/hashtable.i
index 08e9491..55c605c 100644
--- a/mapscript/swiginc/hashtable.i
+++ b/mapscript/swiginc/hashtable.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: hashtable.i 7800 2008-07-09 04:35:48Z sdlime $
+   $Id$
 
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript hashTableObj extensions
diff --git a/mapscript/swiginc/image.i b/mapscript/swiginc/image.i
index f2446d3..d94120a 100644
--- a/mapscript/swiginc/image.i
+++ b/mapscript/swiginc/image.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: image.i 11232 2011-03-18 15:47:40Z tbonfort $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript imageObj extensions
diff --git a/mapscript/swiginc/label.i b/mapscript/swiginc/label.i
index b1d2195..7d2ea75 100644
--- a/mapscript/swiginc/label.i
+++ b/mapscript/swiginc/label.i
@@ -73,4 +73,41 @@
 
     return MS_SUCCESS;
   }
+
+  %newobject getStyle;
+  styleObj *getStyle(int i) {
+      if (i >= 0 && i < self->numstyles) {
+          MS_REFCNT_INCR(self->styles[i]);
+          return self->styles[i];
+      } else {
+          msSetError(MS_CHILDERR, "Invalid index: %d", "getStyle()", i);
+          return NULL;
+      }
+  }
+
+#ifdef SWIGCSHARP
+%apply SWIGTYPE *SETREFERENCE {styleObj *style};
+#endif
+    int insertStyle(styleObj *style, int index=-1) {
+        return msInsertLabelStyle(self, style, index);
+    }
+#ifdef SWIGCSHARP 
+%clear styleObj *style;
+#endif
+
+    %newobject removeStyle;
+    styleObj *removeStyle(int index) {
+	styleObj* style = (styleObj *) msRemoveLabelStyle(self, index);
+	if (style)
+		MS_REFCNT_INCR(style);
+        return style;
+    }
+
+    int moveStyleUp(int index) {
+        return msMoveLabelStyleUp(self, index);
+    }
+
+    int moveStyleDown(int index) {
+       return msMoveLabelStyleDown(self, index);
+    }
 }
diff --git a/mapscript/swiginc/labelcache.i b/mapscript/swiginc/labelcache.i
index 112aaf9..0c7e06d 100644
--- a/mapscript/swiginc/labelcache.i
+++ b/mapscript/swiginc/labelcache.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: labelcache.i 3473 2004-08-23 17:36:48Z sean $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript labelCacheObj extensions
diff --git a/mapscript/swiginc/layer.i b/mapscript/swiginc/layer.i
index 575069f..6f987dc 100644
--- a/mapscript/swiginc/layer.i
+++ b/mapscript/swiginc/layer.i
@@ -1,6 +1,6 @@
 
 /* ===========================================================================
-   $Id: layer.i 11881 2011-07-07 19:55:43Z sdlime $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript layerObj extensions
diff --git a/mapscript/swiginc/line.i b/mapscript/swiginc/line.i
index 7a43572..05c83b7 100644
--- a/mapscript/swiginc/line.i
+++ b/mapscript/swiginc/line.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: line.i 4424 2005-02-18 20:10:01Z sean $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript lineObj extensions
diff --git a/mapscript/swiginc/map.i b/mapscript/swiginc/map.i
index 15fccf5..8eb021a 100644
--- a/mapscript/swiginc/map.i
+++ b/mapscript/swiginc/map.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: map.i 10924 2011-02-02 04:28:39Z sdlime $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript mapObj extensions
diff --git a/mapscript/swiginc/mapzoom.i b/mapscript/swiginc/mapzoom.i
index a48639b..1f06db9 100644
--- a/mapscript/swiginc/mapzoom.i
+++ b/mapscript/swiginc/mapzoom.i
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapzoom.i 9918 2010-03-05 14:59:59Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Map zooming convenience methods for MapScript
diff --git a/mapscript/swiginc/msio.i b/mapscript/swiginc/msio.i
index efb831a..45fe745 100644
--- a/mapscript/swiginc/msio.i
+++ b/mapscript/swiginc/msio.i
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: msio.i 11163 2011-03-15 20:54:31Z schpidi $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Definitions for MapServer IO redirection capability.
@@ -31,12 +31,13 @@
  ****************************************************************************/
 
 
-/* $Id: msio.i 11163 2011-03-15 20:54:31Z schpidi $ */
+/* $Id$ */
 
 void msIO_resetHandlers(void);
 void msIO_installStdoutToBuffer(void);
 void msIO_installStdinFromBuffer(void);
-const char *msIO_stripStdoutBufferContentType(void);
+%newobject msIO_stripStdoutBufferContentType;
+const char *msIO_stripStdoutBufferContentType();
 void msIO_stripStdoutBufferContentHeaders(void);
 
 /* mapscript only extensions */
@@ -89,7 +90,7 @@ gdBuffer msIO_getStdoutBufferBytes() {
 
     gdBuf.data = buf->data;
     gdBuf.size = buf->data_offset;
-    gdBuf.owns_data = MS_FALSE;
+    gdBuf.owns_data = MS_TRUE;
 
     /* we are seizing ownership of the buffer contents */
     buf->data_offset = 0;
diff --git a/mapscript/swiginc/outputformat.i b/mapscript/swiginc/outputformat.i
index 4f7904b..bcbd73e 100644
--- a/mapscript/swiginc/outputformat.i
+++ b/mapscript/swiginc/outputformat.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: outputformat.i 11232 2011-03-18 15:47:40Z tbonfort $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript outputFormatObj extensions
diff --git a/mapscript/swiginc/owsrequest.i b/mapscript/swiginc/owsrequest.i
index 11e63a5..5f44a2f 100644
--- a/mapscript/swiginc/owsrequest.i
+++ b/mapscript/swiginc/owsrequest.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: owsrequest.i 11452 2011-04-04 13:25:43Z aboudreault $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for manipulating OGC request stuff via
@@ -53,14 +53,10 @@ static char *msGetEnvURL( const char *key, void *thread_context )
 
 %extend cgiRequestObj {
 
-#if defined(SWIGJAVA) || defined(SWIGCSHARP)
     cgiRequestObj()
-#else
-    cgiRequestObj(void)
-#endif
     {
         cgiRequestObj *request;
-        
+
         request = msAllocCgiObj();
         if (!request) {
             msSetError(MS_CGIERR, "Failed to initialize object","OWSRequest()");
@@ -70,13 +66,9 @@ static char *msGetEnvURL( const char *key, void *thread_context )
         return request;
     }
 
-#if defined(SWIGJAVA) || defined(SWIGCSHARP)
     ~cgiRequestObj()
-#else
-    ~cgiRequestObj(void)
-#endif
     {
-        free(self);
+        msFreeCgiObj(self);
     }
 
     int loadParams()
diff --git a/mapscript/swiginc/point.i b/mapscript/swiginc/point.i
index f422e12..6c24cd8 100644
--- a/mapscript/swiginc/point.i
+++ b/mapscript/swiginc/point.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: point.i 5521 2006-06-27 06:52:05Z sdlime $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript pointObj extensions
diff --git a/mapscript/swiginc/projection.i b/mapscript/swiginc/projection.i
index 0c48edc..7e74550 100644
--- a/mapscript/swiginc/projection.i
+++ b/mapscript/swiginc/projection.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: projection.i 8389 2009-01-06 15:27:12Z aboudreault $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript projectionObj extensions
diff --git a/mapscript/swiginc/rect.i b/mapscript/swiginc/rect.i
index a0ec409..dd8bfac 100644
--- a/mapscript/swiginc/rect.i
+++ b/mapscript/swiginc/rect.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: rect.i 7922 2008-09-23 15:51:45Z aboudreault $
+   $Id$
 
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript rectObj extensions
diff --git a/mapscript/swiginc/resultcache.i b/mapscript/swiginc/resultcache.i
index c1c6be0..5f11672 100644
--- a/mapscript/swiginc/resultcache.i
+++ b/mapscript/swiginc/resultcache.i
@@ -1,5 +1,5 @@
 /* ===========================================================================   
-   $Id: resultcache.i 10933 2011-02-03 14:31:33Z sdlime $
+   $Id$
 
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript resultCacheObj extensions
diff --git a/mapscript/swiginc/shape.i b/mapscript/swiginc/shape.i
index 871e176..c9f9926 100644
--- a/mapscript/swiginc/shape.i
+++ b/mapscript/swiginc/shape.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: shape.i 9558 2009-11-20 18:11:50Z sdlime $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript shapeObj extensions
diff --git a/mapscript/swiginc/shapefile.i b/mapscript/swiginc/shapefile.i
index 42d5bec..8558aed 100644
--- a/mapscript/swiginc/shapefile.i
+++ b/mapscript/swiginc/shapefile.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: shapefile.i 10791 2010-12-09 16:38:24Z tamas $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript shapefileObj extensions
diff --git a/mapscript/swiginc/style.i b/mapscript/swiginc/style.i
index 1a10048..2a76d94 100644
--- a/mapscript/swiginc/style.i
+++ b/mapscript/swiginc/style.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: style.i 10795 2010-12-11 15:03:52Z tamas $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript styleObj extensions
diff --git a/mapscript/swiginc/symbol.i b/mapscript/swiginc/symbol.i
index 30875bc..5d8b413 100644
--- a/mapscript/swiginc/symbol.i
+++ b/mapscript/swiginc/symbol.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: symbol.i 11472 2011-04-06 02:48:18Z dmorissette $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript symbolObj extensions
@@ -67,8 +67,12 @@
 
     int setPoints(lineObj *line) {
         int i;
+	self->sizex = 0;
+	self->sizey = 0;
         for (i=0; i<line->numpoints; i++) {
             MS_COPYPOINT(&(self->points[i]), &(line->point[i]));
+	    self->sizex = MS_MAX(self->sizex, self->points[i].x);
+	    self->sizey = MS_MAX(self->sizey, self->points[i].y);
         }
         self->numpoints = line->numpoints;
         return self->numpoints;
diff --git a/mapscript/swiginc/symbolset.i b/mapscript/swiginc/symbolset.i
index bdd5b29..758ba56 100644
--- a/mapscript/swiginc/symbolset.i
+++ b/mapscript/swiginc/symbolset.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: symbolset.i 6308 2007-07-16 10:55:28Z unicoletti $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript symbolSetObj extensions
diff --git a/mapscript/swiginc/web.i b/mapscript/swiginc/web.i
index e8a3a1c..269810f 100644
--- a/mapscript/swiginc/web.i
+++ b/mapscript/swiginc/web.i
@@ -1,5 +1,5 @@
 /* ===========================================================================
-   $Id: web.i 6373 2007-07-24 02:37:18Z dmorissette $
+   $Id$
  
    Project:  MapServer
    Purpose:  SWIG interface file for mapscript webObj extensions
diff --git a/mapsde.c b/mapsde.c
index da50063..1ec2a52 100644
--- a/mapsde.c
+++ b/mapsde.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapsde.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *    
  * Project:  MapServer
  * Purpose:  Implements SDE CONNECTIONTYPE.
@@ -35,8 +35,6 @@
 #include "maptime.h"
 #include "mapthread.h"
 
-
-
 #ifdef USE_SDE
 #include <sdetype.h> /* ESRI SDE Client Includes */
 #include <sdeerno.h>
@@ -96,16 +94,12 @@ static layerId *lcache = NULL;
 /* -------------------------------------------------------------------- */
 int msSDELayerIsOpen(layerObj *layer) {
 #ifdef USE_SDE
-
-    if(layer->layerinfo) 
-        return(MS_TRUE); 
-    
-    return MS_FALSE;
-
+  if(layer->layerinfo) 
+    return(MS_TRUE); 
+  return MS_FALSE;
 #else
-    msSetError(MS_MISCERR, "SDE support is not available.",
-             "msSDELayerIsOpen()");
-    return(MS_FALSE);
+  msSetError(MS_MISCERR, "SDE support is not available.",  "msSDELayerIsOpen()");
+  return(MS_FALSE);
 #endif
 } 
 
@@ -1395,17 +1389,14 @@ int msSDELayerOpen(layerObj *layer) {
 /* -------------------------------------------------------------------- */
 int  msSDELayerClose(layerObj *layer) {
 #ifdef USE_SDE
-
-
     msSDELayerInfo *sde=NULL;
-    
     sde = layer->layerinfo;
     
     /* Silently return if layer not opened. */
     if (!msSDELayerIsOpen(layer)) return MS_SUCCESS;  
     
     if(layer->debug) 
-        msDebug("msSDELayerClose(): Closing layer %s.\n", layer->name);
+       msDebug("msSDELayerClose(): Closing layer %s.\n", layer->name);
     
     if (sde->layerinfo) SE_layerinfo_free(sde->layerinfo);
     if (sde->coordref) SE_coordref_free(sde->coordref);
@@ -1423,9 +1414,7 @@ int  msSDELayerClose(layerObj *layer) {
     return MS_SUCCESS;
  
 #else
-    msSetError( MS_MISCERR, 
-              "SDE support is not available.", 
-              "msSDELayerClose()");
+    msSetError( MS_MISCERR, "SDE support is not available.", "msSDELayerClose()");
     return(MS_FALSE);
 #endif
 }
@@ -2081,65 +2070,45 @@ int msSDELayerCreateItems(layerObj *layer, int nt){
 /* -------------------------------------------------------------------- */
 int msSDELayerGetItems(layerObj *layer) {
 #ifdef USE_SDE
-    int status;
-    status = msSDELayerInitItemInfo(layer);
-
-    if (status != MS_SUCCESS) {
-        msSetError( MS_MISCERR,  
-                    "Unable to create SDE column info", 
-                    "msSDELayerGetItems()");
-        return(MS_FAILURE);     
-    }    
-    return (MS_SUCCESS);
-
+  int status;
+  status = msSDELayerInitItemInfo(layer);
+  if (status != MS_SUCCESS) {
+    msSetError( MS_MISCERR, "Unable to create SDE column info", "msSDELayerGetItems()");
+    return(MS_FAILURE);     
+  }    
+  return (MS_SUCCESS);
 #else
-    msSetError( MS_MISCERR, 
-                "SDE support is not available.", 
-                "msSDELayerGetItems()");
-    return(MS_FAILURE);
+  msSetError( MS_MISCERR, "SDE support is not available.", "msSDELayerGetItems()");
+  return(MS_FAILURE);
 #endif
 }
 
 /* -------------------------------------------------------------------- */
 /* msSDELayerFreeItemInfo                                               */
 /* -------------------------------------------------------------------- */
-void msSDELayerFreeItemInfo(layerObj *layer)
-{
+void msSDELayerFreeItemInfo(layerObj *layer) {
 #ifdef USE_SDE
-    msSDELayerInfo *sde = NULL;
-    int i;
-    if (!msSDELayerIsOpen(layer)) {
-        msSetError( MS_SDEERR,
-                    "SDE layer has not been opened.",
-                    "msSDELayerFreeItemInfo()");
-    }
-    sde = layer->layerinfo;
+  msSDELayerInfo *sde = NULL;
+
+  sde = layer->layerinfo;
+  if(sde) {
     if (sde->basedefs) {
-        SE_table_free_descriptions(sde->basedefs);  
-        sde->basedefs = NULL;
+      SE_table_free_descriptions(sde->basedefs);  
+      sde->basedefs = NULL;
     }
     if (sde->joindefs) {
-        SE_table_free_descriptions(sde->joindefs);
-        sde->joindefs = NULL;
-    }
-    if (layer->iteminfo) {
-        msFree(layer->iteminfo);
-        layer->iteminfo = NULL;
+      SE_table_free_descriptions(sde->joindefs);
+      sde->joindefs = NULL;
     }
+  }
 
-     if (layer->items) {
-         for (i=0; i< layer->numitems; i++) {
-             msFree(layer->items[i]);
-         }
-         msFree(layer->items);
-         layer->items = NULL;
-         layer->numitems = 0;
-     }
-
+  if (layer->iteminfo) {
+    msFree(layer->iteminfo);
+    layer->iteminfo = NULL;
+  }
 #else
-    msSetError( MS_MISCERR, 
-                "SDE support is not available.", 
-                "msSDELayerFreeItemInfo()");
+  msSetError( MS_MISCERR, "SDE support is not available.", "msSDELayerFreeItemInfo()");
+  return;
 #endif
 }
 
diff --git a/mapsearch.c b/mapsearch.c
index c613e65..b4abd19 100644
--- a/mapsearch.c
+++ b/mapsearch.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapsearch.c 10535 2010-09-29 18:18:31Z warmerdam $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Various geospatial search operations.
@@ -35,7 +35,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapsearch.c 10535 2010-09-29 18:18:31Z warmerdam $")
+MS_CVSID("$Id$")
 
 #define LASTVERT(v,n)  ((v) == 0 ? n-2 : v-1)
 #define NEXTVERT(v,n)  ((v) == n-2 ? 0 : v+1)
diff --git a/mapserv.c b/mapserv.c
index 8286fc1..34e42bb 100644
--- a/mapserv.c
+++ b/mapserv.c
@@ -39,7 +39,7 @@
 #include <signal.h>
 #endif
 
-MS_CVSID("$Id: mapserv.c 11452 2011-04-04 13:25:43Z aboudreault $")
+MS_CVSID("$Id$")
 
 mapservObj* mapserv;
 
diff --git a/mapserv.h b/mapserv.h
index d451003..a674c54 100644
--- a/mapserv.h
+++ b/mapserv.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapserv.h 11078 2011-03-05 05:20:03Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Declarations supporting mapserv.c.
diff --git a/mapserver.h b/mapserver.h
index 33e114f..b76671e 100644
--- a/mapserver.h
+++ b/mapserver.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapserver.h 11896 2011-07-12 13:17:28Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Primary MapServer include file.
@@ -32,11 +32,11 @@
 /*
 ** MapServer version - to be updated for every release 
 */
-#define MS_VERSION "6.0.1"
+#define MS_VERSION "6.0.3"
 
 #define MS_VERSION_MAJOR    6
 #define MS_VERSION_MINOR    0
-#define MS_VERSION_REV      1
+#define MS_VERSION_REV      3
 
 #define MS_VERSION_NUM (MS_VERSION_MAJOR*10000+MS_VERSION_MINOR*100+MS_VERSION_REV)
 
@@ -367,6 +367,7 @@ extern "C" {
 
 #define MS_INIT_COLOR(color,r,g,b,a) { (color).red = r; (color).green = g; (color).blue = b; (color).pen = MS_PEN_UNSET; (color).alpha=a; }
 #define MS_VALID_COLOR(color) (((color).red==-1 || (color).green==-1 || (color).blue==-1)?MS_FALSE:MS_TRUE)
+#define MS_COMPARE_COLOR(color1, color2) (((color2).red==(color1).red && (color2).green==(color1).green && (color2).blue==(color1).blue)?MS_TRUE:MS_FALSE)
 #define MS_TRANSPARENT_COLOR(color) (((color).alpha==0 || (color).red==-255 || (color).green==-255 || (color).blue==-255)?MS_TRUE:MS_FALSE)
 #define MS_COMPARE_COLORS(a,b) (((a).red!=(b).red || (a).green!=(b).green || (a).blue!=(b).blue)?MS_FALSE:MS_TRUE)
 #define MS_COLOR_GETRGB(color) (MS_VALID_COLOR(color)?((color).red *0x10000 + (color).green *0x100 + (color).blue):-1)
@@ -437,9 +438,17 @@ extern "C" {
 #define MS_ENCRYPTION_KEY_SIZE  16   /* Key size: 128 bits = 16 bytes */
 
 #define GET_LAYER(map, pos) map->layers[pos]
+
+#if defined(USE_THREAD) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) >= 40102
+  // __sync* appeared in GCC 4.1.2
+#define MS_REFCNT_INCR(obj) __sync_fetch_and_add(&obj->refcount, +1)
+#define MS_REFCNT_DECR(obj) __sync_sub_and_fetch(&obj->refcount, +1)
+#define MS_REFCNT_INIT(obj) obj->refcount=1, __sync_synchronize()
+#else
 #define MS_REFCNT_INCR(obj) obj->refcount++
 #define MS_REFCNT_DECR(obj) (--(obj->refcount))
 #define MS_REFCNT_INIT(obj) obj->refcount=1
+#endif
 #define MS_REFCNT_DECR_IS_NOT_ZERO(obj) (MS_REFCNT_DECR(obj))>0
 #define MS_REFCNT_DECR_IS_ZERO(obj) (MS_REFCNT_DECR(obj))<=0
 
@@ -1732,7 +1741,6 @@ MS_DLL_EXPORT void msApplyDefaultSubstitutions(mapObj *map);
 MS_DLL_EXPORT int getClassIndex(layerObj *layer, char *str);
 
 /* For maplabel */
-int labelInImage(int width, int height, shapeObj *lpoly, int buffer);
 int intersectLabelPolygons(shapeObj *p1, shapeObj *p2);
 pointObj get_metrics_line(pointObj *p, int position, rectObj rect, int ox, int oy, double angle, int buffer, lineObj *poly);
 pointObj get_metrics(pointObj *p, int position, rectObj rect, int ox, int oy, double angle, int buffer, shapeObj *poly);
@@ -2303,6 +2311,14 @@ MS_DLL_EXPORT int msInsertStyle(classObj *classo, styleObj *style,
                                 int nStyleIndex);
 MS_DLL_EXPORT styleObj *msRemoveStyle(classObj *classo, int index);
 
+/* maplabel.c */
+MS_DLL_EXPORT int msInsertLabelStyle(labelObj *label, styleObj *style,
+                                     int nStyleIndex);
+MS_DLL_EXPORT int msMoveLabelStyleUp(labelObj *label, int nStyleIndex);
+MS_DLL_EXPORT int msMoveLabelStyleDown(labelObj *label, int nStyleIndex);
+MS_DLL_EXPORT int msDeleteLabelStyle(labelObj *label, int nStyleIndex);
+MS_DLL_EXPORT styleObj *msRemoveLabelStyle(labelObj *label, int nStyleIndex);
+
 /* Measured shape utility functions. */
 MS_DLL_EXPORT pointObj *msGetPointUsingMeasure(shapeObj *shape, double m);
 MS_DLL_EXPORT pointObj *msGetMeasureUsingPoint(shapeObj *shape, pointObj *point);
diff --git a/mapshape.c b/mapshape.c
index df5e6c0..ce98774 100644
--- a/mapshape.c
+++ b/mapshape.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapshape.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implements support for shapefile access.
@@ -38,7 +38,7 @@
 #include <assert.h>
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapshape.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 /* Only use this macro on 32-bit integers! */
 #define SWAP_FOUR_BYTES(data) \
diff --git a/mapshape.h b/mapshape.h
index ed03366..94168d7 100644
--- a/mapshape.h
+++ b/mapshape.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapshape.h 10497 2010-09-02 16:23:37Z warmerdam $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Shapefile access API
diff --git a/mapstring.c b/mapstring.c
index e792123..232d9e3 100644
--- a/mapstring.c
+++ b/mapstring.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapstring.c 11396 2011-03-30 19:57:35Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Various string handling functions.
@@ -33,7 +33,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapstring.c 11396 2011-03-30 19:57:35Z sdlime $")
+MS_CVSID("$Id$")
 
 #include <ctype.h>
 #include <string.h>
@@ -1644,6 +1644,8 @@ char *msGetFriBidiEncodedString(const char *string, const char *encoding)
     outstring[j] = '\0';
 
 #endif
+    
+     free(visual);
      return msStrdup(outstring);
   }
 }
diff --git a/mapsymbol.c b/mapsymbol.c
index 30ccd82..164a0ac 100644
--- a/mapsymbol.c
+++ b/mapsymbol.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapsymbol.c 11882 2011-07-08 04:03:49Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  symbolObj related functions.
@@ -35,7 +35,7 @@
 #include "mapcopy.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: mapsymbol.c 11882 2011-07-08 04:03:49Z sdlime $")
+MS_CVSID("$Id$")
 
 extern int msyylex(void); /* lexer globals */
 extern void msyyrestart(FILE *);
diff --git a/mapsymbol.h b/mapsymbol.h
index 643a41e..1b722ea 100644
--- a/mapsymbol.h
+++ b/mapsymbol.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapsymbol.h 11599 2011-04-19 05:14:17Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  symbolObj related declarations.
diff --git a/maptclutf.c b/maptclutf.c
index de488ea..09c2498 100644
--- a/maptclutf.c
+++ b/maptclutf.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maptclutf.c 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of msUTF8ToUniChar()
@@ -89,7 +89,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: maptclutf.c 11503 2011-04-07 19:56:16Z dmorissette $")
+MS_CVSID("$Id$")
 
 
 /* The source code of Tcl_UtfToUniChar() was borrowed from tclUtf.c
diff --git a/maptemplate.c b/maptemplate.c
index 681cbff..9ded11c 100644
--- a/maptemplate.c
+++ b/maptemplate.c
@@ -37,7 +37,7 @@
 
 #include <ctype.h>
 
-MS_CVSID("$Id: maptemplate.c 11651 2011-05-05 05:05:35Z sdlime $")
+MS_CVSID("$Id$")
 
 static char *olUrl = "http://www.mapserver.org/lib/OpenLayers-ms60.js";
 static char *olTemplate = \
diff --git a/maptemplate.h b/maptemplate.h
index 0e578ba..21e323f 100644
--- a/maptemplate.h
+++ b/maptemplate.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maptemplate.h 11078 2011-03-05 05:20:03Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Template processing related declarations.
diff --git a/mapthread.c b/mapthread.c
index 52cfcd0..ee9137c 100644
--- a/mapthread.c
+++ b/mapthread.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapthread.c 10048 2010-04-06 16:06:21Z warmerdam $
+ * $Id$
  *
  * Project:  UMN MapServer
  * Purpose:  Support code for abstracting thread issues.
@@ -137,7 +137,7 @@ files instead.
 #include "mapserver.h"
 #include "mapthread.h"
 
-MS_CVSID("$Id: mapthread.c 10048 2010-04-06 16:06:21Z warmerdam $")
+MS_CVSID("$Id$")
 
 #if defined(USE_THREAD)
 static int thread_debug = 0;
diff --git a/mapthread.h b/mapthread.h
index fe43b42..c322db9 100644
--- a/mapthread.h
+++ b/mapthread.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapthread.h 7504 2008-04-08 21:13:45Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Multithreading / locking related declarations.
diff --git a/maptile.c b/maptile.c
index 34ea33e..30b2af6 100644
--- a/maptile.c
+++ b/maptile.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maptile.c 11503 2011-04-07 19:56:16Z dmorissette $ 
+ * $Id$ 
  *
  * Project:  MapServer
  * Purpose:  MapServer Tile Access API
diff --git a/maptile.h b/maptile.h
index 2188a54..3f48f08 100644
--- a/maptile.h
+++ b/maptile.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maptile.h 11503 2011-04-07 19:56:16Z dmorissette $ 
+ * $Id$ 
  *
  * Project:  MapServer
  * Purpose:  MapServer Tile Access API
diff --git a/maptime.c b/maptime.c
index 2af8253..2e8b63d 100644
--- a/maptime.c
+++ b/maptime.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maptime.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Date/Time utility functions.
@@ -36,7 +36,7 @@
 #include "maptime.h"
 #include "maperror.h"
 
-MS_CVSID("$Id: maptime.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 typedef struct {
   char pattern[64];
diff --git a/maptime.h b/maptime.h
index 691bfc9..fb89df2 100644
--- a/maptime.h
+++ b/maptime.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maptime.h 7779 2008-07-03 14:20:54Z Assefa $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Time processing related declarations.
diff --git a/maptree.c b/maptree.c
index 8c467d1..6ba081d 100644
--- a/maptree.c
+++ b/maptree.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maptree.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  .qix spatial index implementation.  Derived from shapelib, and 
@@ -31,7 +31,7 @@
 #include "mapserver.h"
 #include "maptree.h"
 
-MS_CVSID("$Id: maptree.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 /* -------------------------------------------------------------------- */
 /*      If the following is 0.5, nodes will be split in half.  If it    */
diff --git a/maptree.h b/maptree.h
index 7e29fd2..3920c6a 100644
--- a/maptree.h
+++ b/maptree.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maptree.h 8741 2009-03-09 21:04:52Z jlacroix $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  .qix spatial index declarations.
diff --git a/mapunion.c b/mapunion.c
index a557389..7a22edb 100644
--- a/mapunion.c
+++ b/mapunion.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapunion.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of the union layer data provider (RFC-68).
@@ -29,11 +29,11 @@
 
 #define _CRT_SECURE_NO_WARNINGS 1
 
-/* $Id: mapunion.c 11881 2011-07-07 19:55:43Z sdlime $ */
+/* $Id$ */
 #include <assert.h>
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapunion.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 #define MSUNION_NUMITEMS        3
 #define MSUNION_SOURCELAYERNAME        "Union:SourceLayerName"
diff --git a/maputil.c b/maputil.c
index 4f2017c..aa739e9 100644
--- a/maputil.c
+++ b/maputil.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: maputil.c 11521 2011-04-11 12:09:16Z tbonfort $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Various utility functions ... a real hodgepodge.
@@ -46,7 +46,7 @@
 #include <process.h>
 #endif
 
-MS_CVSID("$Id: maputil.c 11521 2011-04-11 12:09:16Z tbonfort $")
+MS_CVSID("$Id$")
 
 extern char *msyystring_buffer;
 extern int msyylex_destroy(void);
diff --git a/mapwcs.c b/mapwcs.c
index 723771d..a173997 100644
--- a/mapwcs.c
+++ b/mapwcs.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapwcs.c 11821 2011-06-14 20:49:10Z warmerdam $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OpenGIS Web Coverage Server (WCS) Implementation.
@@ -32,7 +32,7 @@
 #include "mapthread.h"
 #include <assert.h>
 
-MS_CVSID("$Id: mapwcs.c 11821 2011-06-14 20:49:10Z warmerdam $")
+MS_CVSID("$Id$")
 
 #ifdef USE_WCS_SVR
 
@@ -296,7 +296,7 @@ void msWCSSetDefaultBandsRangeSetInfo( wcsParamsObj *params,
         return;
 
     value = strstr(value,"bands");
-    if( value[5] != '\0' && value[5] != ' ' )
+    if( value == NULL || (value[5] != '\0' && value[5] != ' ') )
         return;
 
     /* Are there any w*s_bands_ metadata already? If so, skip out. */
diff --git a/mapwcs.h b/mapwcs.h
index 963c61d..b348185 100644
--- a/mapwcs.h
+++ b/mapwcs.h
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapwcs.h 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OpenGIS Web Coverage Server (WCS) Declarations.
@@ -185,7 +185,6 @@ typedef struct
     int numaxes;        /* number of axes */
     wcs20AxisObjPtr *axes; /* list of axes, NULL if none*/
     char **range_subset;
-    char **invalid_get_parameters; /* NULL terminated list of invalid GET parameters */
 } wcs20ParamsObj;
 typedef wcs20ParamsObj * wcs20ParamsObjPtr;
 
@@ -230,15 +229,14 @@ typedef struct
 typedef wcs20coverageMetadataObj * wcs20coverageMetadataObjPtr;
 
 #define MS_WCS_20_PROFILE_CORE      "http://www.opengis.net/spec/WCS/2.0/conf/core"
-#define MS_WCS_20_PROFILE_KVP       "http://www.opengis.net/spec/WCS_protocol-binding_get-kvp/1.0"
-#define MS_WCS_20_PROFILE_POST      "http://www.opengis.net/spec/WCS_protocol-binding_post-xml/1.0"
-#define MS_WCS_20_PROFILE_GEOTIFF   "http://www.opengis.net/spec/WCS_coverage-encoding_geotiff/1.0/"
+#define MS_WCS_20_PROFILE_KVP       "http://www.opengis.net/spec/WCS_protocol-binding_get-kvp/1.0/conf/get-kvp"
+#define MS_WCS_20_PROFILE_POST      "http://www.opengis.net/spec/WCS_protocol-binding_post-xml/1.0/conf/post-xml"
+#define MS_WCS_20_PROFILE_GEOTIFF   "http://www.opengis.net/spec/WCS_encoding_geotiff/1.0/conf/geotiff"
 #define MS_WCS_20_PROFILE_GML_GEOTIFF "http://www.placeholder.com/GML_and_GeoTIFF"
-#define MS_WCS_20_PROFILE_EPSG      "http://www.placeholder.com/EPSG"
+#define MS_WCS_20_PROFILE_CRS      "http://www.opengis.net/spec/WCS_service-model_crs-predefined/1.0/conf/crs-predefined"
 #define MS_WCS_20_PROFILE_IMAGECRS  "http://www.placeholder.com/IMAGECRS"
-#define MS_WCS_20_PROFILE_SCALING   "http://www.placeholder.com/SCALING"
-#define MS_WCS_20_PROFILE_INTERPOLATION "http://www.placeholder.com/INTERPOLATION"
-#define MS_WCS_20_PROFILE_RANGESUBSET "http://www.placeholder.com/RANGESUBSET"
+#define MS_WCS_20_PROFILE_SCALING   "http://www.opengis.net/spec/WCS_service-model_scaling+interpolation/1.0/conf/scaling+interpolation"
+#define MS_WCS_20_PROFILE_RANGESUBSET "http://www.opengis.net/spec/WCS_service-model_band-subsetting/1.0/conf/band-subsetting"
 
 int msWCSDispatch20(mapObj *map, cgiRequestObj *request, owsRequestObj *ows_request);
 
diff --git a/mapwcs11.c b/mapwcs11.c
index 2674fb9..d67e081 100644
--- a/mapwcs11.c
+++ b/mapwcs11.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapwcs11.c 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OpenGIS Web Coverage Server (WCS) 1.1.0 Implementation.  This
@@ -35,7 +35,7 @@
 #include "mapthread.h"
 #include "mapwcs.h"
 
-MS_CVSID("$Id: mapwcs11.c 11503 2011-04-07 19:56:16Z dmorissette $")
+MS_CVSID("$Id$")
 
 #if defined(USE_WCS_SVR) && defined(USE_LIBXML2)
 
@@ -289,6 +289,30 @@ static int msWCSGetCapabilities11_CoverageSummary(
     }
 
 /* -------------------------------------------------------------------- */
+/*      Metadata Link                                                   */
+/* -------------------------------------------------------------------- */
+    value = msOWSLookupMetadata(&(layer->metadata), "CO", "metadatalink_href");
+
+    if (value)
+    {
+        xmlNodePtr psMetadata = xmlNewChild(psCSummary, psOwsNs, BAD_CAST "Metadata", NULL);
+        xmlNsPtr psXlinkNs = xmlSearchNs( doc, xmlDocGetRootElement(doc), BAD_CAST "xlink" );
+        const char *metadatalink_type = msOWSLookupMetadata(&(layer->metadata), "CO", "metadatalink_type");
+        const char *metadatalink_format = msOWSLookupMetadata(&(layer->metadata), "CO", "metadatalink_format");
+
+        xmlNewNsProp(psMetadata, psXlinkNs, BAD_CAST "type", BAD_CAST "simple");
+        xmlNewNsProp(psMetadata, psXlinkNs, BAD_CAST "href", BAD_CAST value);
+        if (metadatalink_type != NULL)
+        {
+            xmlNewProp(psMetadata, BAD_CAST "about", BAD_CAST metadatalink_type);
+        }
+        if (metadatalink_format != NULL)
+        {
+            xmlNewNsProp(psMetadata, psXlinkNs, BAD_CAST "role", BAD_CAST metadatalink_format);
+        }
+    }
+
+/* -------------------------------------------------------------------- */
 /*      WGS84 bounding box.                                             */
 /* -------------------------------------------------------------------- */
     xmlAddChild( 
@@ -1207,7 +1231,7 @@ int  msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map,
             "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
             "<Coverages\n"
             "     xmlns=\"http://www.opengis.net/wcs/1.1\"\n"
-            "     xmlns:ows=\"http://www.opengis.net/ows\"\n"
+            "     xmlns:ows=\"http://www.opengis.net/ows/1.1\"\n"
             "     xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n"
             "     xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
             "     xsi:schemaLocation=\"http://www.opengis.net/ows/1.1 ../owsCoverages.xsd\">\n"
@@ -1225,7 +1249,7 @@ int  msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map,
             "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
             "<Coverages\n"
             "     xmlns=\"http://www.opengis.net/wcs/1.1\"\n"
-            "     xmlns:ows=\"http://www.opengis.net/ows\"\n"
+            "     xmlns:ows=\"http://www.opengis.net/ows/1.1\"\n"
             "     xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n"
             "     xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
             "     xsi:schemaLocation=\"http://www.opengis.net/ows/1.1 ../owsCoverages.xsd\">\n"
@@ -1241,7 +1265,7 @@ int  msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map,
     {
         msIO_fprintf( 
             stdout,
-            "    <Reference xlink:href=\"cid:coverage/wcs.%s\"/>\n"
+            "    <ows:Reference xlink:href=\"cid:coverage/wcs.%s\"/>\n"
             "  </Coverage>\n"
             "</Coverages>\n"
             "--wcs\n"
@@ -1300,7 +1324,7 @@ int  msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map,
         
         msIO_fprintf( 
             stdout,
-            "    <Reference xlink:href=\"cid:coverage/%s\"/>\n"
+            "    <ows:Reference xlink:href=\"cid:coverage/%s\"/>\n"
             "  </Coverage>\n"
             "</Coverages>\n",
             CPLGetFilename(filename) );
diff --git a/mapwcs20.c b/mapwcs20.c
index 4a350e0..8f40e66 100644
--- a/mapwcs20.c
+++ b/mapwcs20.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapwcs20.c 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OpenGIS Web Coverage Server (WCS) 2.0 implementation.
@@ -44,6 +44,7 @@
 #include "cpl_string.h"
 #include <proj_api.h>
 #include <string.h>
+#include "mapaxisorder.h"
 
 #if defined(USE_LIBXML2)
 
@@ -53,7 +54,7 @@
 
 #endif /* defined(USE_LIBXML2) */
 
-MS_CVSID("$Id: mapwcs20.c 11503 2011-04-07 19:56:16Z dmorissette $")
+MS_CVSID("$Id$")
 
 /************************************************************************/
 /*                   msStringParseInteger()                             */
@@ -317,7 +318,6 @@ wcs20ParamsObjPtr msWCSCreateParamsObj20()
     params->bbox.minx = params->bbox.miny = -DBL_MAX;
     params->bbox.maxx = params->bbox.maxy =  DBL_MAX;
     params->range_subset    = NULL;
-    params->invalid_get_parameters = NULL;
 
     return params;
 }
@@ -354,7 +354,6 @@ void msWCSFreeParamsObj20(wcs20ParamsObjPtr params)
     }
     msFree(params->axes);
     CSLDestroy(params->range_subset);
-    CSLDestroy(params->invalid_get_parameters);
     msFree(params);
 }
 
@@ -461,14 +460,14 @@ static int msWCSParseSubset20(wcs20SubsetObjPtr subset, const char *axis,
         }
 
         if (subset->timeOrScalar == MS_WCS20_TIME_VALUE && subset->min.time
-                >= subset->max.time)
+                > subset->max.time)
         {
             msSetError(MS_WCSERR,
                     "Minimum value of subset axis %s is larger than maximum value",
                     "msWCSParseSubset20()", subset->axis);
             return MS_FAILURE;
         }
-        if (subset->timeOrScalar == MS_WCS20_SCALAR_VALUE && subset->min.scalar >= subset->max.scalar)
+        if (subset->timeOrScalar == MS_WCS20_SCALAR_VALUE && subset->min.scalar > subset->max.scalar)
         {
             msSetError(MS_WCSERR,
                     "Minimum value (%f) of subset axis '%s' is larger than maximum value (%f).",
@@ -1346,17 +1345,7 @@ int msWCSParseRequest20(cgiRequestObj *request, wcs20ParamsObjPtr params)
             }
             msFreeCharArray(tokens, num);
         }
-        /* insert other mapserver internal, to be ignored parameters here */
-        else if(EQUAL(key, "MAP"))
-        {
-            continue;
-        }
-        else
-        {
-            /* append unknown parameter to the list */
-            params->invalid_get_parameters
-                = CSLAddString(params->invalid_get_parameters, key);
-        }
+        /* Ignore all other parameters here */
     }
 
 
@@ -1607,13 +1596,44 @@ static char *msWCSGetFormatsList20( mapObj *map, layerObj *layer )
 }
 
 /************************************************************************/
+/*                   msWCSSwapAxes20                                    */
+/*                                                                      */
+/*      Helper function to determine if a SRS mandates swapped axes.    */
+/************************************************************************/
+
+static int msWCSSwapAxes20(char *srs_uri)
+{
+    int srid = 0, i;
+    /* get SRID from the srs uri */
+    if(srs_uri != NULL && strlen(srs_uri) > 0) {
+        if(sscanf(srs_uri, "http://www.opengis.net/def/crs/EPSG/0/%d", &srid) != EOF)
+            ;
+        else if(sscanf(srs_uri, "http://www.opengis.net/def/crs/%d", &srid) != EOF)
+            ;
+        else
+            srid = 0;
+    }
+    if (srid == 0)
+        return MS_FALSE;
+
+    /*check the static table*/
+    for (i=0; i<AXIS_ORIENTATION_TABLE_SIZE; i++)
+    {
+        if (axisOrientationEpsgCodes[i].code == srid)
+          return MS_TRUE;
+    }
+
+    return MS_FALSE;
+}
+
+/************************************************************************/
 /*                   msWCSCommon20_CreateBoundedBy()                    */
 /*                                                                      */
 /*      Inserts the BoundedBy section into an existing DOM structure.   */
 /************************************************************************/
 
 static void msWCSCommon20_CreateBoundedBy(layerObj *layer, wcs20coverageMetadataObjPtr cm,
-        xmlNsPtr psGmlNs, xmlNodePtr psRoot, projectionObj *projection)
+        xmlNsPtr psGmlNs, xmlNodePtr psRoot, projectionObj *projection, int swapAxes)
 {
     xmlNodePtr psBoundedBy, psEnvelope;
     char lowerCorner[100], upperCorner[100], axisLabels[100], uomLabels[100];
@@ -1626,20 +1646,42 @@ static void msWCSCommon20_CreateBoundedBy(layerObj *layer, wcs20coverageMetadata
 
             if(projection->proj != NULL && pj_is_latlong(projection->proj))
             {
-                strlcpy(axisLabels, "lat long", sizeof(axisLabels));
+                if (swapAxes == MS_FALSE)
+                {
+                    strlcpy(axisLabels, "long lat", sizeof(axisLabels));
+                }
+                else
+                {
+                    strlcpy(axisLabels, "lat long", sizeof(axisLabels));
+                }
                 strlcpy(uomLabels, "deg deg", sizeof(uomLabels));
             }
             else
             {
-                strlcpy(axisLabels, "x y", sizeof(axisLabels));
+                if (swapAxes == MS_FALSE)
+                {
+                    strlcpy(axisLabels, "x y", sizeof(axisLabels));
+                }
+                else
+                {
+                    strlcpy(axisLabels, "y x", sizeof(axisLabels));
+                }
                 strlcpy(uomLabels, "m m", sizeof(uomLabels));
             }
             xmlNewProp(psEnvelope, BAD_CAST "axisLabels", BAD_CAST axisLabels);
             xmlNewProp(psEnvelope, BAD_CAST "uomLabels", BAD_CAST uomLabels);
             xmlNewProp(psEnvelope, BAD_CAST "srsDimension", BAD_CAST "2");
 
-            snprintf(lowerCorner, sizeof(lowerCorner), "%.15g %.15g", cm->extent.minx, cm->extent.miny);
-            snprintf(upperCorner, sizeof(upperCorner), "%.15g %.15g", cm->extent.maxx, cm->extent.maxy);
+            if (swapAxes == MS_FALSE)
+            {
+                snprintf(lowerCorner, sizeof(lowerCorner), "%.15g %.15g", cm->extent.minx, cm->extent.miny);
+                snprintf(upperCorner, sizeof(upperCorner), "%.15g %.15g", cm->extent.maxx, cm->extent.maxy);
+            }
+            else
+            {
+                snprintf(lowerCorner, sizeof(lowerCorner), "%.15g %.15g", cm->extent.miny, cm->extent.minx);
+                snprintf(upperCorner, sizeof(upperCorner), "%.15g %.15g", cm->extent.maxy, cm->extent.maxx);
+            }
 
             xmlNewChild(psEnvelope, psGmlNs, BAD_CAST "lowerCorner", BAD_CAST lowerCorner);
             xmlNewChild(psEnvelope, psGmlNs, BAD_CAST "upperCorner", BAD_CAST upperCorner);
@@ -1654,7 +1696,7 @@ static void msWCSCommon20_CreateBoundedBy(layerObj *layer, wcs20coverageMetadata
 /************************************************************************/
 
 static void msWCSCommon20_CreateDomainSet(layerObj* layer, wcs20coverageMetadataObjPtr cm,
-        xmlNsPtr psGmlNs, xmlNodePtr psRoot, projectionObj *projection)
+        xmlNsPtr psGmlNs, xmlNodePtr psRoot, projectionObj *projection, int swapAxes)
 {
     xmlNodePtr psDomainSet, psGrid, psLimits, psGridEnvelope, psOrigin,
         psPos, psOffsetX, psOffsetY;
@@ -1680,20 +1722,43 @@ static void msWCSCommon20_CreateDomainSet(layerObj* layer, wcs20coverageMetadata
                 }
             }
             
-            if(pj_is_latlong(projection->proj))
+
+
+            if(projection->proj != NULL && pj_is_latlong(projection->proj))
             {
-                strlcpy(axisLabels, "lat long", sizeof(axisLabels));
+                if (swapAxes == MS_FALSE)
+                {
+                    strlcpy(axisLabels, "long lat", sizeof(axisLabels));
+                }
+                else
+                {
+                    strlcpy(axisLabels, "lat long", sizeof(axisLabels));
+                }
             }
             else
             {
-                strlcpy(axisLabels, "x y", sizeof(axisLabels));
+                if (swapAxes == MS_FALSE)
+                {
+                    strlcpy(axisLabels, "x y", sizeof(axisLabels));
+                }
+                else
+                {
+                    strlcpy(axisLabels, "y x", sizeof(axisLabels));
+                }
             }
-
+ 
             xmlNewChild(psGrid, psGmlNs, BAD_CAST "axisLabels", BAD_CAST axisLabels);
-
+ 
             psOrigin = xmlNewChild(psGrid, psGmlNs, BAD_CAST "origin", NULL);
             {
-                snprintf(point, sizeof(point), "%f %f", cm->extent.minx, cm->extent.miny);
+                if (swapAxes == MS_FALSE)
+                {
+                    snprintf(point, sizeof(point), "%f %f", cm->extent.minx, cm->extent.maxy);
+                }
+                else
+                {
+                    snprintf(point, sizeof(point), "%f %f", cm->extent.maxy, cm->extent.minx);
+                }
                 psOrigin = xmlNewChild(psOrigin, psGmlNs, BAD_CAST "Point", NULL);
                 snprintf(id, sizeof(id), "grid_origin_%s", layer->name);
                 xmlNewNsProp(psOrigin, psGmlNs, BAD_CAST "id", BAD_CAST id);
@@ -1701,11 +1766,21 @@ static void msWCSCommon20_CreateDomainSet(layerObj* layer, wcs20coverageMetadata
 
                 psPos = xmlNewChild(psOrigin, psGmlNs, BAD_CAST "pos", BAD_CAST point);
             }
-            snprintf(resx, sizeof(resx), "%f 0", cm->xresolution);
-            snprintf(resy, sizeof(resy), "0 %f", cm->yresolution);
+
+            if (swapAxes == MS_FALSE)
+            {
+                snprintf(resx, sizeof(resx), "%f 0", cm->xresolution);
+                snprintf(resy, sizeof(resy), "0 %f", -fabs(cm->yresolution));
+            }
+            else
+            {
+                snprintf(resx, sizeof(resx), "0 %f", cm->xresolution);
+                snprintf(resy, sizeof(resy), "%f 0", -fabs(cm->yresolution));
+            }
             psOffsetX = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resx);
-            xmlNewProp(psOffsetX, BAD_CAST "srsName", BAD_CAST cm->srs_uri);
             psOffsetY = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resy);
+
+            xmlNewProp(psOffsetX, BAD_CAST "srsName", BAD_CAST cm->srs_uri);
             xmlNewProp(psOffsetY, BAD_CAST "srsName", BAD_CAST cm->srs_uri);
         }
     }
@@ -2788,12 +2863,11 @@ static int msWCSGetCapabilities20_CreateProfiles(
         MS_WCS_20_PROFILE_CORE,     NULL,
         MS_WCS_20_PROFILE_KVP,      NULL,
         MS_WCS_20_PROFILE_POST,     NULL,
-        MS_WCS_20_PROFILE_EPSG,     NULL,
+        MS_WCS_20_PROFILE_CRS,     NULL,
         MS_WCS_20_PROFILE_IMAGECRS, NULL,
         MS_WCS_20_PROFILE_GEOTIFF,  "image/tiff",
         MS_WCS_20_PROFILE_GML_GEOTIFF, NULL,
         MS_WCS_20_PROFILE_SCALING, NULL,
-        MS_WCS_20_PROFILE_INTERPOLATION, NULL,
         MS_WCS_20_PROFILE_RANGESUBSET, NULL,
         NULL, NULL /* guardian */
     };
@@ -2845,9 +2919,13 @@ static int msWCSGetCapabilities20_CoverageSummary(
 {
     wcs20coverageMetadataObj cm;
     int status;
-    xmlNodePtr psCSummary;
+    xmlNodePtr psCSummary, psMetadata;
+    const char *metadatalink_href = msOWSLookupMetadata(&(layer->metadata), "CO", "metadatalink_href");
+
 
     xmlNsPtr psWcsNs = xmlSearchNs( doc, xmlDocGetRootElement(doc), BAD_CAST "wcs" );
+    xmlNsPtr psOwsNs = xmlSearchNs( doc, xmlDocGetRootElement(doc), BAD_CAST "ows" );
+    xmlNsPtr psXlinkNs = xmlSearchNs( doc, xmlDocGetRootElement(doc), BAD_CAST "xlink" );
 
     status = msWCSGetCoverageMetadata20(layer, &cm);
     if(status != MS_SUCCESS) return MS_FAILURE;
@@ -2856,6 +2934,25 @@ static int msWCSGetCapabilities20_CoverageSummary(
     xmlNewChild(psCSummary, psWcsNs, BAD_CAST "CoverageId", BAD_CAST layer->name);
     xmlNewChild(psCSummary, psWcsNs, BAD_CAST "CoverageSubtype", BAD_CAST "RectifiedGridCoverage");
 
+    /* Add references to additional coverage metadata */
+    if (metadatalink_href != NULL)
+    {
+        const char *metadatalink_type = msOWSLookupMetadata(&(layer->metadata), "CO", "metadatalink_type");
+        const char *metadatalink_format = msOWSLookupMetadata(&(layer->metadata), "CO", "metadatalink_format");
+
+        psMetadata = xmlNewChild(psCSummary, psOwsNs, BAD_CAST "Metadata", NULL);
+        xmlNewNsProp(psMetadata, psXlinkNs, BAD_CAST "type", BAD_CAST "simple");
+        xmlNewNsProp(psMetadata, psXlinkNs, BAD_CAST "href", BAD_CAST metadatalink_href);
+        if (metadatalink_type != NULL)
+        {
+            xmlNewProp(psMetadata, BAD_CAST "about", BAD_CAST metadatalink_type);
+        }
+        if (metadatalink_format != NULL)
+        {
+            xmlNewNsProp(psMetadata, psXlinkNs, BAD_CAST "role", BAD_CAST metadatalink_format);
+        }
+    }
+
     msWCSClearCoverageMetadata20(&cm);
 
     return MS_SUCCESS;
@@ -2873,7 +2970,9 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
                            wcs20ParamsObjPtr params, owsRequestObj *ows_request)
 {
     xmlDocPtr psDoc = NULL;       /* document pointer */
-    xmlNodePtr psRootNode, psOperationsNode, psServiceMetadataNode, psNode;
+    xmlNodePtr psRootNode,
+            psOperationsNode,
+            psNode;
     const char *updatesequence = NULL;
     xmlNsPtr psOwsNs = NULL,
             psXLinkNs = NULL,
@@ -2907,8 +3006,6 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
 
     xmlNewProp(psRootNode, BAD_CAST "version", BAD_CAST params->version );
 
-    /* TODO: remove updatesequence? */
-
     updatesequence = msOWSLookupMetadata(&(map->web.metadata), "CO", "updatesequence");
     if (params->updatesequence != NULL)
     {
@@ -2971,6 +3068,10 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
         psNode = msOWSCommonOperationsMetadataOperation(
             psOwsNs, psXLinkNs,
             "GetCapabilities", OWS_METHOD_GETPOST, script_url_encoded);
+        
+        xmlAddChild(psNode->last->last->last,
+            msOWSCommonOperationsMetadataDomainType(OWS_2_0_0, psOwsNs, "Constraint",
+                                                    "PostEncoding", "XML"));
         xmlAddChild(psOperationsNode, psNode);
 
         /* -------------------------------------------------------------------- */
@@ -2981,6 +3082,9 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
             psNode = msOWSCommonOperationsMetadataOperation(
                 psOwsNs, psXLinkNs,
                 "DescribeCoverage", OWS_METHOD_GETPOST, script_url_encoded);
+            xmlAddChild(psNode->last->last->last,
+                msOWSCommonOperationsMetadataDomainType(OWS_2_0_0, psOwsNs, "Constraint",
+                                                        "PostEncoding", "XML"));
             xmlAddChild(psOperationsNode, psNode);
         }
 
@@ -2992,18 +3096,20 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
             psNode = msOWSCommonOperationsMetadataOperation(
                 psOwsNs, psXLinkNs,
                 "GetCoverage", OWS_METHOD_GETPOST, script_url_encoded);
-            xmlAddChild(psOperationsNode, psNode);
             
-            msFree(script_url_encoded);
+            xmlAddChild(psNode->last->last->last,
+                msOWSCommonOperationsMetadataDomainType(OWS_2_0_0, psOwsNs, "Constraint",
+                                                        "PostEncoding", "XML"));
+            xmlAddChild(psOperationsNode, psNode);
         }
+        msFree(script_url_encoded);
     }
 
     /* -------------------------------------------------------------------- */
     /*      Service metadata.                                               */
     /* -------------------------------------------------------------------- */
     /* it is mandatory, but unused for now */
-    psServiceMetadataNode = xmlAddChild(psRootNode, xmlNewNode(psWcsNs, BAD_CAST "ServiceMetadata"));
-    xmlNewProp(psServiceMetadataNode, BAD_CAST "version", BAD_CAST "1.0.0");
+    xmlAddChild(psRootNode, xmlNewNode(psWcsNs, BAD_CAST "ServiceMetadata"));
 
     /* -------------------------------------------------------------------- */
     /*      Contents section.                                               */
@@ -3052,7 +3158,7 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
 static int msWCSDescribeCoverage20_CoverageDescription(mapObj *map,
     layerObj *layer, wcs20ParamsObjPtr params, xmlDocPtr psDoc, xmlNodePtr psRootNode )
 {
-    int status;
+    int status, swapAxes;
     wcs20coverageMetadataObj cm;
     xmlNodePtr psCD;
     xmlNsPtr psWcsNs, psGmlNs, psGmlcovNs, psSweNs, psXLinkNs;
@@ -3080,6 +3186,8 @@ static int msWCSDescribeCoverage20_CoverageDescription(mapObj *map,
     if(status != MS_SUCCESS)
         return status;
 
+    swapAxes = msWCSSwapAxes20(cm.srs_uri);
+
     /* fill in bands rangeset info, if required. */
     /* msWCSSetDefaultBandsRangeSetInfo( NULL, &cm, layer ); */
 
@@ -3092,14 +3200,14 @@ static int msWCSDescribeCoverage20_CoverageDescription(mapObj *map,
     /* -------------------------------------------------------------------- */
     /*      gml:boundedBy                                                   */
     /* -------------------------------------------------------------------- */
-    msWCSCommon20_CreateBoundedBy(layer, &cm, psGmlNs, psCD, &(layer->projection));
+    msWCSCommon20_CreateBoundedBy(layer, &cm, psGmlNs, psCD, &(layer->projection), swapAxes);
 
     xmlNewChild(psCD, psWcsNs, BAD_CAST "CoverageId", BAD_CAST layer->name);
 
     /* -------------------------------------------------------------------- */
     /*      gml:domainSet                                                   */
     /* -------------------------------------------------------------------- */
-    msWCSCommon20_CreateDomainSet(layer, &cm, psGmlNs, psCD, &(layer->projection));
+    msWCSCommon20_CreateDomainSet(layer, &cm, psGmlNs, psCD, &(layer->projection), swapAxes);
 
     /* -------------------------------------------------------------------- */
     /*      gmlcov:rangeType                                                */
@@ -3526,7 +3634,14 @@ int msWCSGetCoverage20(mapObj *map, cgiRequestObj *request,
     /************************************************************************/
 
     msInitProjection(&imageProj);
-    msLoadProjectionString(&imageProj, cm.srs);
+    if (msLoadProjectionString(&imageProj, cm.srs) == -1)
+    {
+        msSetError(MS_WCSERR,
+            "Error loading CRS %s.",
+            "msWCSGetCoverage20()", params->subsetcrs);
+        return msWCSException(map, "InvalidParameterValue",
+            "projection", params->version);
+    }
 
     if(msWCSGetCoverage20_FinalizeParamsObj(params) == MS_FAILURE)
     {
@@ -3548,8 +3663,7 @@ int msWCSGetCoverage20(mapObj *map, cgiRequestObj *request,
             x_1 = cm.geotransform[0]
                 + orig_bbox.minx * cm.geotransform[1]
                 + orig_bbox.miny * cm.geotransform[2];
-            x_2 =
-                    cm.geotransform[0]
+            x_2 = cm.geotransform[0]
                 + (orig_bbox.maxx+1) * cm.geotransform[1]
                 + (orig_bbox.maxy+1) * cm.geotransform[2];
 
@@ -3709,18 +3823,24 @@ int msWCSGetCoverage20(mapObj *map, cgiRequestObj *request,
             msProjectRect(&(map->projection), &outputProj, &bbox);
             msFreeProjection(&(map->projection));
             map->projection = outputProj;
+
+            /* recalculate resolutions, needed if UOM changes (e.g: deg -> m) */
+            params->resolutionX = (bbox.maxx - bbox.minx) / params->width;
+            params->resolutionY = (bbox.maxy - bbox.miny) / params->height;
         }
     }
 
     /* set the bounding box as new map extent */
-    map->extent = layer->extent = bbox;
+    map->extent = bbox;
     map->width = params->width;
     map->height = params->height;
 
     /* Are we exceeding the MAXSIZE limit on result size? */
     if(map->width > map->maxsize || map->height > map->maxsize )
     {
-        msSetError(MS_WCSERR, "Raster size out of range, width and height of resulting coverage must be no more than MAXSIZE=%d.", "msWCSGetCoverage20()", map->maxsize);
+        msSetError(MS_WCSERR, "Raster size out of range, width and height of "
+                              "resulting coverage must be no more than MAXSIZE=%d.",
+                              "msWCSGetCoverage20()", map->maxsize);
 
         return msWCSException(map, "InvalidParameterValue", 
                                    "size", params->version);
@@ -3882,7 +4002,7 @@ int msWCSGetCoverage20(mapObj *map, cgiRequestObj *request,
         char *srs_uri, *default_filename;
         const char *filename;
         char *file_ref;
-        int length = 0;
+        int length = 0, swapAxes;
 
         /* Create Document  */
         psDoc = xmlNewDoc(BAD_CAST "1.0");
@@ -3905,22 +4025,24 @@ int msWCSGetCoverage20(mapObj *map, cgiRequestObj *request,
 
         tmpCm = cm;
         tmpCm.extent = map->extent;
-        tmpCm.xsize = params->width;
-        tmpCm.ysize = params->height;
-        tmpCm.xresolution = params->resolutionX;
-        tmpCm.yresolution = params->resolutionY;
+        tmpCm.xsize = map->width;
+        tmpCm.ysize = map->height;
         strlcpy(tmpCm.srs_uri, srs_uri, sizeof(tmpCm.srs_uri));
-        msFree(srs_uri);
-        /* WCS 2.0 is center of pixel oriented */
-        tmpCm.extent.minx -= params->resolutionX * 0.5;
-        tmpCm.extent.maxx += params->resolutionX * 0.5;
-        tmpCm.extent.miny -= params->resolutionY * 0.5;
-        tmpCm.extent.maxy += params->resolutionY * 0.5;
+        
+        tmpCm.xresolution = map->gt.geotransform[1];
+        tmpCm.yresolution = map->gt.geotransform[5];
+        
+        tmpCm.extent.minx = MIN(map->gt.geotransform[0], map->gt.geotransform[0] + map->width * tmpCm.xresolution);
+        tmpCm.extent.miny = MIN(map->gt.geotransform[3], map->gt.geotransform[3] + map->height * tmpCm.yresolution);
+        tmpCm.extent.maxx = MAX(map->gt.geotransform[0], map->gt.geotransform[0] + map->width * tmpCm.xresolution);
+        tmpCm.extent.maxy = MAX(map->gt.geotransform[3], map->gt.geotransform[3] + map->height * tmpCm.yresolution);
 
+        swapAxes = msWCSSwapAxes20(srs_uri);
+        msFree(srs_uri);
 
         /* Setup layer information  */
-        msWCSCommon20_CreateBoundedBy(layer, &tmpCm, psGmlNs, psRootNode, &(map->projection));
-        msWCSCommon20_CreateDomainSet(layer, &tmpCm, psGmlNs, psRootNode, &(map->projection));
+        msWCSCommon20_CreateBoundedBy(layer, &tmpCm, psGmlNs, psRootNode, &(map->projection), swapAxes);
+        msWCSCommon20_CreateDomainSet(layer, &tmpCm, psGmlNs, psRootNode, &(map->projection), swapAxes);
 
         psRangeSet = xmlNewChild(psRootNode, psGmlNs, BAD_CAST "rangeSet", NULL);
         psFile     = xmlNewChild(psRangeSet, psGmlNs, BAD_CAST "File", NULL);
@@ -4076,29 +4198,6 @@ int msWCSDispatch20(mapObj *map, cgiRequestObj *request, owsRequestObj *ows_requ
         return MS_FAILURE;
     }
 
-    /* check if any unknown parameters are present              */
-    /* create an error message, containing all unknown params   */
-    if (params->invalid_get_parameters != NULL)
-    {
-        char *concat = NULL;
-        int i, count = CSLCount(params->invalid_get_parameters);
-        for(i = 0; i < count; ++i)
-        {
-            concat = msStringConcatenate(concat, (char *)"'");
-            concat = msStringConcatenate(concat, params->invalid_get_parameters[i]);
-            concat = msStringConcatenate(concat, (char *)"'");
-            if(i + 1 != count)
-            {
-                concat = msStringConcatenate(concat, ", ");
-            }
-        }
-        msSetError(MS_WCSERR, "Unknown parameter%s: %s.",
-                "msWCSParseRequest20()", (count > 1) ? "s" : "", concat);
-        msFree(concat);
-        msWCSFreeParamsObj20(params);
-        return msWCSException(map, "InvalidParameterValue", "request", "2.0.0");
-    }
-
     /* check if all layer names are valid NCNames */
     {
         int i;
diff --git a/mapwfs.c b/mapwfs.c
index d25c5d4..4c6f87a 100644
--- a/mapwfs.c
+++ b/mapwfs.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapwfs.c 11544 2011-04-12 12:38:18Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  WFS server implementation
@@ -28,7 +28,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: mapwfs.c 11544 2011-04-12 12:38:18Z aboudreault $")
+MS_CVSID("$Id$")
 
 #if defined(USE_WFS_SVR)
 
@@ -2637,7 +2637,6 @@ int msWFSGetFeature(mapObj *map, wfsParamsObj *paramsObj, cgiRequestObj *req, ow
                         if( to_allow < 0 )
                             to_allow = 0;
 
-                        lp->resultcache->numresults = 0;
                     }
                 }
             }
@@ -3205,7 +3204,11 @@ int msWFSParseRequest(mapObj *map, cgiRequestObj *request, owsRequestObj *ows_re
             if (pszValue)
               wfsparams->nStartIndex = atoi(pszValue);
             
-             /* free typname and filter. There may have been */
+            pszValue = xmlGetProp(rootnode, (xmlChar *)"outputFormat");
+            if (pszValue)
+              wfsparams->pszOutputFormat = msStrdup(pszValue);            
+
+            /* free typename and filter. There may have been */
             /* values if they were passed in the URL */
             if (wfsparams->pszTypeName)    
               free(wfsparams->pszTypeName);
@@ -3412,11 +3415,16 @@ int msWFSParseRequest(mapObj *map, cgiRequestObj *request, owsRequestObj *ows_re
                 if (pszValue)
                   wfsparams->nMaxFeatures = atoi(pszValue);
 
-                 pszValue = CPLGetXMLValue(psGetFeature,  "startIndex",
+                pszValue = CPLGetXMLValue(psGetFeature,  "startIndex",
                                                  NULL);
                 if (pszValue)
                   wfsparams->nStartIndex = atoi(pszValue);
 
+                pszValue = CPLGetXMLValue(psGetFeature, "outputFormat", 
+                                                 NULL);
+                if (pszValue)
+                  wfsparams->pszOutputFormat = msStrdup(pszValue);
+
                 psQuery = CPLGetXMLNode(psGetFeature, "Query");
                 if (psQuery)
                 {
diff --git a/mapwfs11.c b/mapwfs11.c
index f09f2ff..1b4fe9b 100644
--- a/mapwfs11.c
+++ b/mapwfs11.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapwfs11.c 11503 2011-04-07 19:56:16Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OGC WFS 1.1.0 implementation. This file holds some WFS 1.1.0 
@@ -30,7 +30,7 @@
 #include "mapserver.h"
 #include "mapows.h"
 
-MS_CVSID("$Id: mapwfs11.c 11503 2011-04-07 19:56:16Z dmorissette $")
+MS_CVSID("$Id$")
 
 #if defined(USE_WFS_SVR) && defined(USE_LIBXML2)
 #include "maplibxml2.h"
diff --git a/mapwfslayer.c b/mapwfslayer.c
index 9a4ff9f..4617976 100644
--- a/mapwfslayer.c
+++ b/mapwfslayer.c
@@ -1,5 +1,5 @@
 /**********************************************************************
- * $Id: mapwfslayer.c 11881 2011-07-07 19:55:43Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of WFS CONNECTIONTYPE - client to WFS servers
@@ -37,7 +37,7 @@
 #include <process.h>
 #endif
 
-MS_CVSID("$Id: mapwfslayer.c 11881 2011-07-07 19:55:43Z sdlime $")
+MS_CVSID("$Id$")
 
 #define WFS_V_0_0_14  14
 #define WFS_V_1_0_0  100
diff --git a/mapwms.c b/mapwms.c
index ab123a5..060fb8e 100644
--- a/mapwms.c
+++ b/mapwms.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapwms.c 11768 2011-05-30 13:15:57Z dmorissette $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  OpenGIS Web Mapping Service support implementation.
@@ -48,7 +48,7 @@
 #include <process.h>
 #endif
 
-MS_CVSID("$Id: mapwms.c 11768 2011-05-30 13:15:57Z dmorissette $")
+MS_CVSID("$Id$")
 
 /* ==================================================================
  * WMS Server stuff.
diff --git a/mapwmslayer.c b/mapwmslayer.c
index d14870b..499901f 100644
--- a/mapwmslayer.c
+++ b/mapwmslayer.c
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * $Id: mapwmslayer.c 10883 2011-01-21 19:38:21Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of WMS CONNECTIONTYPE - client to WMS servers
diff --git a/mapxbase.c b/mapxbase.c
index 5eca947..2b01b3c 100644
--- a/mapxbase.c
+++ b/mapxbase.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: mapxbase.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  .dbf access API.  Derived from shapelib, and relicensed with 
@@ -34,7 +34,7 @@
 #include <stdlib.h> /* for atof() and atoi() */
 #include <math.h>
 
-MS_CVSID("$Id: mapxbase.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 /* try to use a large file version of fseek for files up to 4GB (#3514) */
 #if _MSC_VER > 1310
diff --git a/msencrypt.c b/msencrypt.c
index 3ceec31..c77efda 100644
--- a/msencrypt.c
+++ b/msencrypt.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: msencrypt.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Command-line encryption utility (see MS-RFC-18)
@@ -29,7 +29,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: msencrypt.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 void PrintUsage()
 {
diff --git a/nmake.opt b/nmake.opt
index 5768afe..d0f3f25 100644
--- a/nmake.opt
+++ b/nmake.opt
@@ -11,7 +11,7 @@
 #  - Run the VCVARS32.BAT script to initialize the VC++ environment variables
 #  - Start the build with:  nmake /f makefile.vc
 #
-# $Id: nmake.opt 11228 2011-03-18 14:57:22Z tbonfort $
+# $Id$
 #
 # Contents:
 #   Section I:   Mapserver Compilation Options
diff --git a/scalebar.c b/scalebar.c
index 4ec8cc3..29dbc46 100644
--- a/scalebar.c
+++ b/scalebar.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: scalebar.c 11397 2011-03-30 20:09:01Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Commandline scalebar generating utility, mostly for testing.
@@ -29,7 +29,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: scalebar.c 11397 2011-03-30 20:09:01Z sdlime $")
+MS_CVSID("$Id$")
 
 int main(int argc, char *argv[])
 {
diff --git a/shp2img.c b/shp2img.c
index e19c521..0b067aa 100644
--- a/shp2img.c
+++ b/shp2img.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: shp2img.c 11400 2011-03-30 21:20:20Z warmerdam $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Commandline .map rendering utility, mostly for testing.
@@ -30,7 +30,7 @@
 #include "mapserver.h"
 #include "maptime.h"
 
-MS_CVSID("$Id: shp2img.c 11400 2011-03-30 21:20:20Z warmerdam $")
+MS_CVSID("$Id$")
 
 int main(int argc, char *argv[])
 {
diff --git a/shptree.c b/shptree.c
index 4171224..a9bb4d3 100644
--- a/shptree.c
+++ b/shptree.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: shptree.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Commandline utility to generate .qix shapefile spatial indexes.
@@ -31,7 +31,7 @@
 #include "maptree.h"
 #include <string.h>
 
-MS_CVSID("$Id: shptree.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 char* AddFileSuffix ( const char * Filename, const char * Suffix ) {
   char	*pszFullname, *pszBasename;
diff --git a/shptreetst.c b/shptreetst.c
index cb1d1cd..4a8e7d4 100644
--- a/shptreetst.c
+++ b/shptreetst.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: shptreetst.c 10881 2011-01-21 18:21:22Z jmckenna $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Utility program to visualize a quadtree search
@@ -34,7 +34,7 @@
 #endif
 #include <stdlib.h>
 
-MS_CVSID("$Id: shptreetst.c 10881 2011-01-21 18:21:22Z jmckenna $")
+MS_CVSID("$Id$")
 
 #ifdef SHPT_POLYGON
    #undef MAPSERVER
diff --git a/shptreevis.c b/shptreevis.c
index 7fd902c..b2277d6 100644
--- a/shptreevis.c
+++ b/shptreevis.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: shptreevis.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Utility program to visualize a quadtree
@@ -35,7 +35,7 @@
 #endif
 #include <stdlib.h>
 
-MS_CVSID("$Id: shptreevis.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 #ifdef SHPT_POLYGON
    #undef MAPSERVER
diff --git a/sortshp.c b/sortshp.c
index 79cdddd..e6e6fe0 100644
--- a/sortshp.c
+++ b/sortshp.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: sortshp.c 11397 2011-03-30 20:09:01Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Command line utility to sort a shapefile based on a single 
@@ -36,7 +36,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: sortshp.c 11397 2011-03-30 20:09:01Z sdlime $")
+MS_CVSID("$Id$")
 
 typedef struct {
   double number;
diff --git a/stablemerge.sh b/stablemerge.sh
new file mode 100644
index 0000000..9dd107a
--- /dev/null
+++ b/stablemerge.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+git checkout branch-5-0
+if test $? -ne 0; then exit; fi
+git merge branch-4-10
+if test $? -ne 0; then exit; fi
+git checkout branch-5-2
+if test $? -ne 0; then exit; fi
+git merge branch-5-0
+if test $? -ne 0; then exit; fi
+git checkout branch-5-4
+if test $? -ne 0; then exit; fi
+git merge branch-5-2
+if test $? -ne 0; then exit; fi
+git checkout branch-5-6
+if test $? -ne 0; then exit; fi
+git merge branch-5-4
+if test $? -ne 0; then exit; fi
+git checkout branch-6-0
+if test $? -ne 0; then exit; fi
+git merge branch-5-6
+if test $? -ne 0; then exit; fi
+git checkout master
+if test $? -ne 0; then exit; fi
+git merge branch-6-0
diff --git a/sym2img.c b/sym2img.c
index 70bba64..49985ca 100644
--- a/sym2img.c
+++ b/sym2img.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: sym2img.c 11397 2011-03-30 20:09:01Z sdlime $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Commandline utility to render symbols to a raster.
@@ -32,7 +32,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: sym2img.c 11397 2011-03-30 20:09:01Z sdlime $")
+MS_CVSID("$Id$")
 
 #define MAXCOLORS 256
 #define CELLSIZE 100
diff --git a/testcopy.c b/testcopy.c
index bebc7c0..c22bcf4 100644
--- a/testcopy.c
+++ b/testcopy.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: testcopy.c 7418 2008-02-29 00:02:49Z nsavard $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Test of msCopyMap()
@@ -29,7 +29,7 @@
 
 #include "mapserver.h"
 
-MS_CVSID("$Id: testcopy.c 7418 2008-02-29 00:02:49Z nsavard $")
+MS_CVSID("$Id$")
 
 void printAtts(mapObj*, const char*);
 
diff --git a/testexpr.c b/testexpr.c
index b31f4d4..2d1d32b 100644
--- a/testexpr.c
+++ b/testexpr.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: testexpr.c 11194 2011-03-17 15:01:46Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Commandline tester for expression evaluation
@@ -33,7 +33,7 @@
 #include "mapparser.h"
 #include "mapfile.h"
 
-MS_CVSID("$Id: testexpr.c 11194 2011-03-17 15:01:46Z aboudreault $")
+MS_CVSID("$Id$")
 
 extern int msyyparse();
 extern int msyylex();
diff --git a/tests/makefile_postgis b/tests/makefile_postgis
index 6db22d8..c6cc149 100644
--- a/tests/makefile_postgis
+++ b/tests/makefile_postgis
@@ -1,5 +1,5 @@
 # ===========================================================================
-# $Id: makefile_postgis 7418 2008-02-29 00:02:49Z nsavard $
+# $Id$
 #
 # Project:  MapServer
 # Purpose:  Make and populate a PostGIS testing database
diff --git a/tile4ms.c b/tile4ms.c
index 6268b75..df78577 100644
--- a/tile4ms.c
+++ b/tile4ms.c
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: tile4ms.c 10772 2010-11-29 18:27:02Z aboudreault $
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Create shapefile of rectangles from extents of several shapefiles 
@@ -43,7 +43,7 @@
 #include "mapserver.h"
 #include <string.h>
 
-MS_CVSID("$Id: tile4ms.c 10772 2010-11-29 18:27:02Z aboudreault $")
+MS_CVSID("$Id$")
 
 /***********************************************************************/
 int process_shapefiles(char *metaFileNameP, char *tileFileNameP, 
diff --git a/xmlmapfile/mapfile.xsd b/xmlmapfile/mapfile.xsd
index d7ea20e..e2df4c1 100644
--- a/xmlmapfile/mapfile.xsd
+++ b/xmlmapfile/mapfile.xsd
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ms="http://www.mapserver.org/mapserver" targetNamespace="http://www.mapserver.org/mapserver" elementFormDefault="qualified" attributeFormDefault="unqualified" version="5.6.3">
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ms="http://www.mapserver.org/mapserver" targetNamespace="http://www.mapserver.org/mapserver" elementFormDefault="qualified" attributeFormDefault="unqualified" version="6.0.1">
 	<!-- Definition of types -->
 	<xs:simpleType name="rgbColorValueType">
 		<xs:restriction base="xs:integer">
@@ -278,10 +278,10 @@
 				<xs:element name="colorAttribute" type="ms:attributeType"/>
 			</xs:choice>
 			<xs:element name="encoding" minOccurs="0"/>
-			<xs:element name="maxoverlapangle" minOccurs="0"/>
 			<xs:element name="font" type="xs:string" minOccurs="0"/>
 			<xs:element name="force" type="ms:booleanEnum" default="FALSE" minOccurs="0"/>
 			<xs:element name="maxLength" type="xs:integer" default="0" minOccurs="0"/>
+			<xs:element name="maxOverlapAngle" type="xs:float" minOccurs="0"/>
 			<xs:element name="maxSize" type="xs:integer" default="256" minOccurs="0"/>
 			<xs:element name="minDistance" type="xs:integer" minOccurs="0"/>
 			<xs:element name="minFeatureSize" minOccurs="0">
@@ -344,6 +344,7 @@
 					</xs:union>
 				</xs:simpleType>
 			</xs:element>
+			<xs:element name="Style" type="ms:Style" minOccurs="0"/>
 			<xs:element name="wrap" type="xs:string" minOccurs="0"/>
 		</xs:sequence>
 		<xs:attribute name="type" use="required">
@@ -369,31 +370,61 @@
 					</xs:union>
 				</xs:simpleType>
 			</xs:element>
-			<xs:element name="antialias" type="ms:booleanEnum"/>
+			<xs:element name="antialias" type="ms:booleanEnum" minOccurs="0"/>
 			<xs:element name="backgroundColor" type="ms:rgbColorType" minOccurs="0"/>
 			<xs:choice minOccurs="0">
 				<xs:element name="color" type="ms:rgbColorType"/>
 				<xs:element name="colorAttribute" type="ms:attributeType"/>
 			</xs:choice>
+			<xs:element name="gap" type="xs:integer" default="0" minOccurs="0"/>
 			<xs:element name="geomTransform" minOccurs="0">
 				<xs:simpleType>
 					<xs:restriction base="xs:string">
-						<xs:enumeration value="START"/>
+						<xs:enumeration value="BBOX"/>
 						<xs:enumeration value="END"/>
+						<xs:enumeration value="LABELPNT"/>
+						<xs:enumeration value="LABELPOLY"/>
+						<xs:enumeration value="START"/>
 						<xs:enumeration value="VERTICES"/>
-						<xs:enumeration value="BBOX"/>
 					</xs:restriction>
 				</xs:simpleType>
 			</xs:element>
-			<xs:element name="maxSize" type="xs:integer" default="50" minOccurs="0"/>
-			<xs:element name="minSize" type="xs:integer" default="0" minOccurs="0"/>
-			<xs:element name="minWidth" type="xs:integer" minOccurs="0"/>
+			<xs:element name="lineCap" default="BUTT" minOccurs="0">
+				<xs:simpleType>
+					<xs:restriction base="xs:string">
+						<xs:enumeration value="BUTT"/>
+						<xs:enumeration value="ROUND"/>
+						<xs:enumeration value="SQUARE"/>
+						<xs:enumeration value="TRIANGLE"/>
+				                <xs:enumeration value="SVG"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:element>
+			<xs:element name="lineJoin" minOccurs="0">
+				<xs:simpleType>
+					<xs:restriction base="xs:string">
+						<xs:enumeration value="ROUND"/>
+						<xs:enumeration value="MITER"/>
+						<xs:enumeration value="BEVEL"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:element>
+			<xs:element name="lineJoinMaxSize" type="xs:integer" default="3" minOccurs="0"/>
+			<xs:element name="maxSize" type="xs:float" default="500" minOccurs="0"/>
+			<xs:element name="maxWidth" type="xs:float" default="32" minOccurs="0"/>
+			<xs:element name="minSize" type="xs:float" default="0" minOccurs="0"/>
+			<xs:element name="minWidth" type="xs:float" default="0" minOccurs="0"/>
 			<xs:element name="offset" type="ms:sizeType" minOccurs="0"/>
 			<xs:element name="opacity" type="xs:integer" default="0" minOccurs="0"/>
 			<xs:choice minOccurs="0">
 				<xs:element name="outlineColor" type="ms:rgbColorType"/>
 				<xs:element name="outlineColorAttribute" type="ms:attributeType"/>
 			</xs:choice>
+			<xs:element name="pattern" minOccurs="0">
+				<xs:simpleType>
+					<xs:list itemType="xs:float"/>
+				</xs:simpleType>
+			</xs:element>
 			<xs:element name="size" default="1" minOccurs="0">
 				<xs:simpleType>
 					<xs:union memberTypes="xs:positiveInteger ms:attributeType"/>
@@ -441,34 +472,7 @@
 			<xs:element name="character" type="xs:string" minOccurs="0"/>
 			<xs:element name="filled" type="ms:booleanEnum" minOccurs="0"/>
 			<xs:element name="font" type="xs:string" minOccurs="0"/>
-			<xs:element name="gap" type="xs:integer" default="0" minOccurs="0"/>
 			<xs:element name="image" type="xs:string" minOccurs="0"/>
-			<xs:element name="lineCap" default="BUTT" minOccurs="0">
-				<xs:simpleType>
-					<xs:restriction base="xs:string">
-						<xs:enumeration value="BUTT"/>
-						<xs:enumeration value="ROUND"/>
-						<xs:enumeration value="SQUARE"/>
-						<xs:enumeration value="TRIANGLE"/>
-				                <xs:enumeration value="SVG"/>
-					</xs:restriction>
-				</xs:simpleType>
-			</xs:element>
-			<xs:element name="lineJoin" minOccurs="0">
-				<xs:simpleType>
-					<xs:restriction base="xs:string">
-						<xs:enumeration value="ROUND"/>
-						<xs:enumeration value="MITER"/>
-						<xs:enumeration value="BEVEL"/>
-					</xs:restriction>
-				</xs:simpleType>
-			</xs:element>
-			<xs:element name="lineJoinMaxSize" type="xs:integer" default="3" minOccurs="0"/>
-			<xs:element name="pattern" minOccurs="0">
-				<xs:simpleType>
-					<xs:list itemType="xs:integer"/>
-				</xs:simpleType>
-			</xs:element>
 			<xs:element name="Points" minOccurs="0">
 				<xs:complexType>
 					<xs:sequence>
@@ -478,7 +482,7 @@
 			</xs:element>
 			<xs:element name="transparent" type="xs:integer" minOccurs="0"/>
 		</xs:sequence>
-		<xs:attribute name="name" type="xs:string"/>
+	        <xs:attribute name="name" type="xs:string"/>
 		<xs:attribute name="type" use="required">
 			<xs:simpleType>
 				<xs:restriction base="xs:string">
@@ -486,7 +490,6 @@
 					<xs:enumeration value="ELLIPSE"/>
 					<xs:enumeration value="PIXMAP"/>
 					<xs:enumeration value="TRUETYPE"/>
-					<xs:enumeration value="CARTOLINE"/>
 					<xs:enumeration value="HATCH"/>
 					<xs:enumeration value="SIMPLE"/>
 				</xs:restriction>
@@ -576,7 +579,7 @@
         <!-- CLUSTER Definition -->
 	<xs:complexType name="Cluster">
 		<xs:sequence>
-			<xs:element name="buffer" type="xs:positiveInteger" minOccurs="0"/>
+			<xs:element name="buffer" type="xs:float" minOccurs="0"/>
 			<xs:element name="filter" type="ms:expressionType" minOccurs="0"/>
 			<xs:element name="group" type="ms:expressionType" minOccurs="0"/>
 			<xs:element name="maxdistance" type="xs:positiveInteger" minOccurs="0"/>
@@ -594,6 +597,7 @@
 			<xs:element name="connectionType" minOccurs="0">
 				<xs:simpleType>
 					<xs:restriction base="xs:string">
+						<xs:enumeration value="LOCAL"/>
 						<xs:enumeration value="SDE"/>
 						<xs:enumeration value="OGR"/>
 						<xs:enumeration value="WFS"/>
diff --git a/xmlmapfile/mapfile.xsl b/xmlmapfile/mapfile.xsl
index c07d73c..f5fe594 100644
--- a/xmlmapfile/mapfile.xsl
+++ b/xmlmapfile/mapfile.xsl
@@ -595,7 +595,7 @@
     </xsl:call-template>
     <xsl:call-template name="print">
       <xsl:with-param name="indent" select="$indent"/>
-      <xsl:with-param name="node" select="'ms:maxoverlapangle'"/>
+      <xsl:with-param name="node" select="'ms:maxOverlapAngle'"/>
     </xsl:call-template>
     <xsl:apply-templates select="ms:color">
       <xsl:with-param name="indent" select="$indent"/>
@@ -677,6 +677,9 @@
       <xsl:with-param name="indent" select="$indent"/>
       <xsl:with-param name="node" select="'ms:size'"/>
     </xsl:call-template>
+    <xsl:apply-templates select="ms:Style">
+      <xsl:with-param name="indent" select="$indent + 1"/>
+    </xsl:apply-templates>
     <xsl:call-template name="print">
       <xsl:with-param name="indent" select="$indent"/>
       <xsl:with-param name="node" select="'ms:wrap'"/>
@@ -786,12 +789,35 @@
     </xsl:call-template>
     <xsl:call-template name="print">
       <xsl:with-param name="indent" select="$indent"/>
+      <xsl:with-param name="node" select="'ms:maxWidth'"/>
+    </xsl:call-template>
+    <xsl:call-template name="print">
+      <xsl:with-param name="indent" select="$indent"/>
       <xsl:with-param name="node" select="'ms:minSize'"/>
     </xsl:call-template>
     <xsl:call-template name="print">
       <xsl:with-param name="indent" select="$indent"/>
       <xsl:with-param name="node" select="'ms:minWidth'"/>
     </xsl:call-template>
+    <xsl:call-template name="print">
+      <xsl:with-param name="indent" select="$indent"/>
+      <xsl:with-param name="node" select="'ms:gap'"/>
+    </xsl:call-template>
+    <xsl:call-template name="print">
+      <xsl:with-param name="indent" select="$indent"/>
+      <xsl:with-param name="node" select="'ms:lineCap'"/>
+    </xsl:call-template>
+    <xsl:call-template name="print">
+      <xsl:with-param name="indent" select="$indent"/>
+      <xsl:with-param name="node" select="'ms:lineJoin'"/>
+    </xsl:call-template>
+    <xsl:call-template name="print">
+      <xsl:with-param name="indent" select="$indent"/>
+      <xsl:with-param name="node" select="'ms:lineJoinMaxSize'"/>
+    </xsl:call-template>
+    <xsl:apply-templates select="ms:pattern">
+      <xsl:with-param name="indent" select="$indent"/>
+    </xsl:apply-templates>
     <xsl:apply-templates select="ms:offset">
       <xsl:with-param name="indent" select="$indent"/>
     </xsl:apply-templates>
@@ -957,28 +983,9 @@
     </xsl:call-template>
     <xsl:call-template name="print">
       <xsl:with-param name="indent" select="$indent"/>
-      <xsl:with-param name="node" select="'ms:gap'"/>
-    </xsl:call-template>
-    <xsl:call-template name="print">
-      <xsl:with-param name="indent" select="$indent"/>
       <xsl:with-param name="node" select="'ms:image'"/>
       <xsl:with-param name="quote" select="1"/>
     </xsl:call-template>
-    <xsl:call-template name="print">
-      <xsl:with-param name="indent" select="$indent"/>
-      <xsl:with-param name="node" select="'ms:lineCap'"/>
-    </xsl:call-template>
-    <xsl:call-template name="print">
-      <xsl:with-param name="indent" select="$indent"/>
-      <xsl:with-param name="node" select="'ms:lineJoin'"/>
-    </xsl:call-template>
-    <xsl:call-template name="print">
-      <xsl:with-param name="indent" select="$indent"/>
-      <xsl:with-param name="node" select="'ms:lineJoinMaxSize'"/>
-    </xsl:call-template>
-    <xsl:apply-templates select="ms:pattern">
-      <xsl:with-param name="indent" select="$indent"/>
-    </xsl:apply-templates>
     <xsl:apply-templates select="ms:Points">
       <xsl:with-param name="indent" select="$indent + 1"/>
     </xsl:apply-templates>
@@ -1367,10 +1374,6 @@
     </xsl:call-template>
     <xsl:call-template name="print">
       <xsl:with-param name="indent" select="$indent"/>
-      <xsl:with-param name="node" select="'ms:buffer'"/>
-    </xsl:call-template>
-    <xsl:call-template name="print">
-      <xsl:with-param name="indent" select="$indent"/>
       <xsl:with-param name="node" select="'ms:region'"/>
       <xsl:with-param name="quote" select="1"/>
     </xsl:call-template>
diff --git a/xmlmapfile/tests/layerset.xml b/xmlmapfile/tests/layerset.xml
index ae17362..93cb967 100644
--- a/xmlmapfile/tests/layerset.xml
+++ b/xmlmapfile/tests/layerset.xml
@@ -45,13 +45,19 @@
         <antialias>TRUE</antialias>
         <backgroundColor red="244" green="43" blue="22"/>
         <color red="244" green="43" blue="22"/>
+        <gap>13</gap>
         <geomTransform>VERTICES</geomTransform>
+        <lineCap>ROUND</lineCap>
+        <lineJoin>BEVEL</lineJoin>
+        <lineJoinMaxSize>3</lineJoinMaxSize>
         <maxSize>244</maxSize>
+        <maxWidth>28</maxWidth>
         <minSize>6</minSize>
         <minWidth>24</minWidth>
         <offset x="12" y="33"/>
         <opacity>1253</opacity>
         <outlineColorAttribute>[myOulineColorAttribute]</outlineColorAttribute>
+        <pattern>2 3</pattern>
         <size>[mySize]</size>
         <symbol type="NAME">star.gif</symbol>
         <width>[myWidth]</width>
@@ -63,7 +69,7 @@
     <classGroup>group1</classGroup>
     <classItem>population</classItem>
     <Cluster>
-      <buffer>2</buffer>
+      <buffer>3.3</buffer>
       <filter type="MSEXPR">(type=’road’ and size < 2)</filter>
       <group type="REGEX">/ddea/i</group>
       <maxdistance>20</maxdistance>
@@ -94,7 +100,7 @@
     <header>http://mapgears.com/templates/myHeader1.html</header>
     <Join name="myJoin1" type="ONE-TO-MANY">
       <connection>user=nobody password=****** dbname=dbname host=localhost port=5432</connection>
-      <connectionType>OGR</connectionType>
+      <connectionType>POSTGRESQL</connectionType>
       <from>ID</from>
       <table>./data/lookup.dbf</table>
       <template>http://mapgears.com/templates/myJoin1.html</template>
diff --git a/xmlmapfile/tests/mapfile-test.xml b/xmlmapfile/tests/mapfile-test.xml
index dd35704..ecf5c6b 100644
--- a/xmlmapfile/tests/mapfile-test.xml
+++ b/xmlmapfile/tests/mapfile-test.xml
@@ -23,15 +23,13 @@
 			<align>CENTER</align>
 			<angle>FOLLOW</angle>
 			<antialias>TRUE</antialias>
-			<backgroundColor red="244" green="43" blue="22"/>
-			<backgroundShadowColor red="244" green="43" blue="22"/>
-			<backgroundShadowSize x="2" y="2"/>
 			<buffer>2</buffer>
 			<colorAttribute>[myColor]</colorAttribute>
 			<encoding>ISO 8859-1</encoding>
 			<font>serif</font>
 			<force>TRUE</force>
 			<maxLength>244</maxLength>
+			<maxOverlapAngle>30</maxOverlapAngle>
 			<maxSize>244</maxSize>
 			<minDistance>24</minDistance>
 			<minFeatureSize>AUTO</minFeatureSize>
@@ -107,9 +105,6 @@
 			<align>CENTER</align>
 			<angle>[myAngle]</angle>
 			<antialias>FALSE</antialias>
-			<backgroundColor red="244" green="43" blue="22"/>
-			<backgroundShadowColor red="244" green="43" blue="22"/>
-			<backgroundShadowSize x="2" y="2"/>
 			<buffer>2</buffer>
 			<colorAttribute>[myColor]</colorAttribute>
 			<encoding>ISO 8859-1</encoding>
@@ -129,6 +124,9 @@
 			<shadowColor red="244" green="43" blue="22"/>
 			<shadowSize x="15" y="14"/>
 			<size>SMALL</size>
+                        <Style>
+                          <geomTransform>VERTICES</geomTransform>
+                        </Style>
 			<wrap>\n</wrap>
 		</Label>
 		<outlineColor red="12" green="45" blue="12"/>
@@ -142,33 +140,23 @@
 	<shapePath>../data</shapePath>
 	<size x="600" y="400"/>
 	<symbolSet>/tmp/mySymbolSet.sym</symbolSet>
-	<Symbol name="mySymbol2-test2" type="CARTOLINE">
+	<Symbol name="mySymbol2-test2" type="SIMPLE">
 		<antialias>FALSE</antialias>
 		<character>C</character>
 		<filled>TRUE</filled>
 		<font>serif</font>
-		<gap>13</gap>
 		<image>/tmp/test.gif</image>
-		<lineCap>ROUND</lineCap>
-		<lineJoin>BEVEL</lineJoin>
-		<lineJoinMaxSize>3</lineJoinMaxSize>
-		<pattern>2 3</pattern>
 		<Points>
 			<point x="2" y="-3"/>
 		</Points>
 		<transparent>123</transparent>
 	</Symbol>
-        <Symbol name="mySymbol222-test1" type="CARTOLINE">
+        <Symbol name="mySymbol222-test1" type="SIMPLE">
           <antialias>FALSE</antialias>
           <character>C</character>
           <filled>TRUE</filled>
           <font>serif</font>
-          <gap>13</gap>
           <image>/tmp/test.gif</image>
-          <lineCap>ROUND</lineCap>
-          <lineJoin>BEVEL</lineJoin>
-          <lineJoinMaxSize>3</lineJoinMaxSize>
-          <pattern>2 3</pattern>
           <Points>
             <point x="2" y="-3"/>
           </Points>
diff --git a/xmlmapfile/tests/symbolset.xml b/xmlmapfile/tests/symbolset.xml
index d91b138..e4a2a17 100644
--- a/xmlmapfile/tests/symbolset.xml
+++ b/xmlmapfile/tests/symbolset.xml
@@ -1,32 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <SymbolSet xmlns="http://www.mapserver.org/mapserver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mapserver.org/mapserver ../mapfile.xsd">
-	<Symbol name="mySymbol2" type="CARTOLINE">
+	<Symbol name="mySymbol2" type="SIMPLE">
 		<antialias>FALSE</antialias>
 		<character>C</character>
 		<filled>TRUE</filled>
 		<font>serif</font>
-		<gap>13</gap>
 		<image>/tmp/test.gif</image>
-		<lineCap>ROUND</lineCap>
-		<lineJoin>BEVEL</lineJoin>
-		<lineJoinMaxSize>3</lineJoinMaxSize>
-		<pattern>2 3</pattern>
 		<Points>
 			<point x="2" y="-3"/>
 		</Points>
 		<transparent>0</transparent>
 	</Symbol>
-        <Symbol name="mySymbol222" type="CARTOLINE">
+        <Symbol name="mySymbol222" type="SIMPLE">
           <antialias>FALSE</antialias>
           <character>C</character>
           <filled>TRUE</filled>
           <font>serif</font>
-          <gap>13</gap>
           <image>/tmp/test.gif</image>
-          <lineCap>ROUND</lineCap>
-          <lineJoin>BEVEL</lineJoin>
-          <lineJoinMaxSize>3</lineJoinMaxSize>
-          <pattern>2 3</pattern>
           <Points>
             <point x="2" y="-3"/>
           </Points>

-- 
Mapserver



More information about the Pkg-grass-devel mailing list