1 package ExtUtils::Typemaps::InputMap;
9 ExtUtils::Typemaps::InputMap - Entry in the INPUT section of a typemap
13 use ExtUtils::Typemaps;
15 my $input = $typemap->get_input_map('T_NV');
16 my $code = $input->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 croak("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 INPUT mapping code for this entry.
63 $_[0]->{code} = $_[1] if @_ > 1;
69 Returns the name of the XS type of the INPUT 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;
90 # Move C pre-processor instructions to column 1 to be strictly ANSI
91 # conformant. Some pre-processors are fussy about this.
92 $code =~ s/^\s+#/#/mg;
103 Steffen Mueller C<<smueller@cpan.org>>
105 =head1 COPYRIGHT & LICENSE
107 Copyright 2009-2011 Steffen Mueller
109 This program is free software; you can redistribute it and/or
110 modify it under the same terms as Perl itself.