[mapserver-commits] r10807 - trunk/mapserver/mapscript/csharp

svn at osgeo.org svn at osgeo.org
Mon Dec 20 10:58:22 EST 2010


Author: tamas
Date: 2010-12-20 07:58:22 -0800 (Mon, 20 Dec 2010)
New Revision: 10807

Modified:
   trunk/mapserver/mapscript/csharp/swig_csharp_extensions.i
Log:
Support for setting environment variables at run time (C#) (#3638)

Modified: trunk/mapserver/mapscript/csharp/swig_csharp_extensions.i
===================================================================
--- trunk/mapserver/mapscript/csharp/swig_csharp_extensions.i	2010-12-17 20:59:07 UTC (rev 10806)
+++ trunk/mapserver/mapscript/csharp/swig_csharp_extensions.i	2010-12-20 15:58:22 UTC (rev 10807)
@@ -208,5 +208,23 @@
   internal static $moduleObject the$moduleObject = new $moduleObject();
   protected static object ThisOwn_true() { return null; }
   protected static object ThisOwn_false() { return the$moduleObject; }
+  
+  [DllImport("$dllimport", EntryPoint="SetEnvironmentVariable")]
+  public static extern int SetEnvironmentVariable(string envstring);
 %}
 
+
+%insert(runtime) %{
+#ifdef __cplusplus
+extern "C" 
+#endif
+#ifdef SWIGEXPORT
+SWIGEXPORT int SWIGSTDCALL SetEnvironmentVariable(const char *envstring) {
+  return putenv(envstring);
+}
+#else
+DllExport int SWIGSTDCALL SetEnvironmentVariable(const char *envstring) {
+  return putenv(envstring);
+}
+#endif
+%}



More information about the mapserver-commits mailing list