Mailing List Archive

r3713 - trunk/boilerplater/lib/Boilerplater/Binding/Perl
Author: creamyg
Date: 2008-08-04 15:34:21 -0700 (Mon, 04 Aug 2008)
New Revision: 3713

Modified:
trunk/boilerplater/lib/Boilerplater/Binding/Perl/TypeMap.pm
Log:
Add void* as a typemap item, and assume (questionably, but it works for Doc)
that it refers to a reference SV -- either a hashref or an arrayref.


Modified: trunk/boilerplater/lib/Boilerplater/Binding/Perl/TypeMap.pm
===================================================================
--- trunk/boilerplater/lib/Boilerplater/Binding/Perl/TypeMap.pm 2008-08-04 19:23:35 UTC (rev 3712)
+++ trunk/boilerplater/lib/Boilerplater/Binding/Perl/TypeMap.pm 2008-08-04 22:34:21 UTC (rev 3713)
@@ -26,6 +26,16 @@
chy_i16_t => sub {"$_[0] = (chy_i16_t)SvIV( $_[1] );"},
chy_i8_t => sub {"$_[0] = (chy_i8_t)SvIV( $_[1] );"},
chy_bool_t => sub {"$_[0] = SvTRUE( $_[1] ) ? 1 : 0;"},
+ # Assume that void* is a reference SV -- either a hashref or an arrayref.
+ 'void*' => sub {
+ qq|if (SvROK($_[1])) {
+ $_[0] = SvRV($_[1]);
+ }
+ else {
+ $_[0] = NULL; /* avoid uninitialized compiler warning */
+ CONFESS("$_[0] is not a reference");
+ }\n|;
+ },
);

my %to_perl = (
@@ -48,6 +58,8 @@
chy_i16_t => sub {"$_[0] = newSViv( $_[1] );"},
chy_i8_t => sub {"$_[0] = newSViv( $_[1] );"},
chy_bool_t => sub {"$_[0] = newSViv( $_[1] );"},
+ # Assume that void* is a reference SV -- either a hashref or an arrayref.
+ 'void*' => sub {"$_[0] = newRV_inc( (SV*)($_[1]) );"},
);

sub _from_bp {


_______________________________________________
kinosearch-commits mailing list
kinosearch-commits@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch-commits