1 package ExtUtils::Typemaps::OutputMap;
9 ExtUtils::Typemaps::OutputMap - Entry in the OUTPUT section of a typemap
13 use ExtUtils::Typemaps;
15 my $output = $typemap->get_output_map('T_NV');
16 my $code = $output->code();
21 Refer to L<ExtUtils::Typemaps> for details.
29 Requires C<xstype> and C<code> parameters.
35 my $class = ref($prot)||$prot;
39 if (not defined $args{xstype} or not defined $args{code}) {
40 die("Need xstype and code parameters");
45 (ref($prot) ? {%$prot} : {})
49 $self->{xstype} = $args{xstype} if defined $args{xstype};
50 $self->{code} = $args{code} if defined $args{code};
51 $self->{code} =~ s/^(?=\S)/\t/mg;
58 Returns or sets the OUTPUT mapping code for this entry.
63 $_[0]->{code} = $_[1] if @_ > 1;
69 Returns the name of the XS type of the OUTPUT map.
74 return $_[0]->{xstype};
79 Returns a cleaned-up copy of the code to which certain transformations
80 have been applied to make it more ANSI compliant.
86 my $code = $self->code;
88 # Move C pre-processor instructions to column 1 to be strictly ANSI
89 # conformant. Some pre-processors are fussy about this.
90 $code =~ s/^\s+#/#/mg;
101 Steffen Mueller C<<smueller@cpan.org>>
103 =head1 COPYRIGHT & LICENSE
105 Copyright 2009-2011 Steffen Mueller
107 This program is free software; you can redistribute it and/or
108 modify it under the same terms as Perl itself.