summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-12-23 12:21:19 +0000
committerNicholas Clark <nick@ccl4.org>2005-12-23 12:21:19 +0000
commit49657794b700c5b56b92eaf38a24c952564ee7db (patch)
tree64ea0aa5b0db021c3522db369925ff93e7bfc7a3 /lib
parent70e590749aafa6e0e67a2220f53f1568bf4e16de (diff)
downloadperl-49657794b700c5b56b92eaf38a24c952564ee7db.tar.gz
Add support for PV to ExtUtils::Constant::ProxySubs, and enable its
use in Sys::Syslog p4raw-id: //depot/perl@26472
Diffstat (limited to 'lib')
-rw-r--r--lib/ExtUtils/Constant/ProxySubs.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ExtUtils/Constant/ProxySubs.pm b/lib/ExtUtils/Constant/ProxySubs.pm
index b69c14ee21..06712b94a9 100644
--- a/lib/ExtUtils/Constant/ProxySubs.pm
+++ b/lib/ExtUtils/Constant/ProxySubs.pm
@@ -17,6 +17,7 @@ $VERSION = '0.01';
IV => '{const char *name; I32 namelen; IV value;}',
NV => '{const char *name; I32 namelen; NV value;}',
UV => '{const char *name; I32 namelen; UV value;}',
+ PV => '{const char *name; I32 namelen; const char *value;}',
YES => '{const char *name; I32 namelen;}',
NO => '{const char *name; I32 namelen;}',
'' => '{const char *name; I32 namelen;} ',
@@ -27,6 +28,7 @@ $VERSION = '0.01';
IV => sub { $_[0] . '->value' },
NV => sub { $_[0] . '->value' },
UV => sub { $_[0] . '->value' },
+ PV => sub { $_[0] . '->value' },
YES => sub {},
NO => sub {},
'' => sub {},
@@ -37,6 +39,7 @@ $VERSION = '0.01';
IV => sub { "newSViv($_[0])" },
NV => sub { "newSVnv($_[0])" },
UV => sub { "newSVuv($_[0])" },
+ PV => sub { "newSVpv($_[0], 0)" },
YES => sub { '&PL_sv_yes' },
NO => sub { '&PL_sv_no' },
'' => sub { '&PL_sv_yes' },
@@ -55,13 +58,20 @@ sub type_to_C_value {
return $type_to_C_value{$type} || sub {return map {ref $_ ? @$_ : $_} @_};
}
+# TODO - figure out if there is a clean way for the type_to_sv code to
+# attempt s/sv_2mortal// and if it succeeds tell type_to_sv not to add
+# SvREFCNT_inc
%type_is_a_problem =
(
# The documentation says *mortal SV*, but we now need a non-mortal copy.
SV => 1,
);
-$type_temporary{SV} = 'SV *';
+%type_temporary =
+ (
+ SV => 'SV *',
+ PV => 'const char *',
+ );
$type_temporary{$_} = $_ foreach qw(IV UV NV);
while (my ($type, $value) = each %XS_TypeSet) {