[mapserver-commits] r8847 - in trunk/mapserver: . mapscript/perl

svn at osgeo.org svn at osgeo.org
Mon Mar 30 13:48:25 EDT 2009


Author: aboudreault
Date: 2009-03-30 13:48:25 -0400 (Mon, 30 Mar 2009)
New Revision: 8847

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapscript/perl/plmodule.i
Log:
Perl Mapscript: improvement of imageObj wrapper (#2962)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-03-30 13:32:06 UTC (rev 8846)
+++ trunk/mapserver/HISTORY.TXT	2009-03-30 17:48:25 UTC (rev 8847)
@@ -12,6 +12,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Perl Mapscript: improvement of imageObj wrapper (#2962)
+
 - Improve control of output resolution (RFC 55, #2948)
 
 - mapraster.c: use GDALOpenShared(), and CLOSE_CONNECTION=DEFERRED (#2815)

Modified: trunk/mapserver/mapscript/perl/plmodule.i
===================================================================
--- trunk/mapserver/mapscript/perl/plmodule.i	2009-03-30 13:32:06 UTC (rev 8846)
+++ trunk/mapserver/mapscript/perl/plmodule.i	2009-03-30 17:48:25 UTC (rev 8847)
@@ -24,6 +24,26 @@
   }
 %}
 
+/* Translate Perl's built-in file object to FILE * */
+%typemap(in) FILE * {
+  $1 = PerlIO_exportFILE (IoIFP (sv_2io ($input)), NULL);
+}
+
+/* To support imageObj::getBytes */
+%typemap(out) gdBuffer {
+        SV *mysv;
+        mysv = sv_newmortal();
+        if ($1.data == NULL)
+            sv_setpv(mysv,"");
+        else
+            sv_setpvn(mysv,(const char*)$1.data,$1.size);
+        $result = newRV(mysv);
+        sv_2mortal($result);
+        argvi++;
+        if( $1.owns_data )
+            gdFree($1.data);
+}
+
 /*
 ===============================================================================
 RFC-24 implementation follows



More information about the mapserver-commits mailing list