[mapserver-commits] r10808 - branches/branch-5-6/mapserver/mapscript/csharp

svn at osgeo.org svn at osgeo.org
Mon Dec 20 11:03:35 EST 2010


Author: tamas
Date: 2010-12-20 08:03:35 -0800 (Mon, 20 Dec 2010)
New Revision: 10808

Modified:
   branches/branch-5-6/mapserver/mapscript/csharp/swig_csharp_extensions.i
Log:
Support for setting environment variables at run time (C#) (#3638)

Modified: branches/branch-5-6/mapserver/mapscript/csharp/swig_csharp_extensions.i
===================================================================
--- branches/branch-5-6/mapserver/mapscript/csharp/swig_csharp_extensions.i	2010-12-20 15:58:22 UTC (rev 10807)
+++ branches/branch-5-6/mapserver/mapscript/csharp/swig_csharp_extensions.i	2010-12-20 16:03:35 UTC (rev 10808)
@@ -208,5 +208,22 @@
   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