3 ExtUtils::ParseXS - converts Perl XS code into C code
7 use ExtUtils::ParseXS qw(process_file);
9 process_file( filename => 'foo.xs' );
11 process_file( filename => 'foo.xs',
14 typemap => 'path/to/typemap',
26 C<ExtUtils::ParseXS> will compile XS code into C code by embedding the constructs
27 necessary to let C functions manipulate Perl values and creates the glue
28 necessary to let Perl access those functions. The compiler uses typemaps to
29 determine how to map C function parameters and variables to Perl values.
31 The compiler will search for typemap files called I<typemap>. It will use
32 the following search path to find default typemaps, with the rightmost
33 typemap taking precedence.
35 ../../../typemap:../../typemap:../typemap:typemap
39 None by default. C<process_file()> may be exported upon request.
47 This function processes an XS file and sends output to a C file.
48 Named parameters control how the processing is done. The following
49 parameters are accepted:
55 Adds C<extern "C"> to the C code. Default is false.
59 Retains C<::> in type names so that C++ hierarchical types can be
60 mapped. Default is false.
64 Adds exception handling stubs to the C code. Default is false.
68 Indicates that a user-supplied typemap should take precedence over the
69 default typemaps. A single typemap may be specified as a string, or
70 multiple typemaps can be specified in an array reference, with the
71 last typemap having the highest precedence.
75 Generates prototype code for all xsubs. Default is false.
79 Makes sure at run time that the object file (derived from the C<.xs>
80 file) and the C<.pm> files have the same version number. Default is
85 Adds C<#line> directives to the C output so error messages will look
86 like they came from the original XS file. Default is true.
90 Enables certain optimizations. The only optimization that is currently
91 affected is the use of I<target>s by the output C code (see L<perlguts>).
92 Not optimizing may significantly slow down the generated code, but this is the way
93 B<xsubpp> of 5.005 and earlier operated. Default is to optimize.
97 Enable recognition of C<IN>, C<OUT_LIST> and C<INOUT_LIST>
98 declarations. Default is true.
102 Enable recognition of ANSI-like descriptions of function signature.
107 I<Maintainer note:> I have no clue what this does. Strips function prefixes?
113 This function returns the number of [a certain kind of] errors
114 encountered during processing of the XS file.
120 Based on xsubpp code, written by Larry Wall.
128 Ken Williams, <ken@mathforum.org>
132 David Golden, <dagolden@cpan.org>
136 James Keenan, <jkeenan@cpan.org>
140 Steffen Mueller, <smueller@cpan.org>
146 Copyright 2002-2011 by Ken Williams, David Golden and other contributors. All
149 This library is free software; you can redistribute it and/or
150 modify it under the same terms as Perl itself.
152 Based on the C<ExtUtils::xsubpp> code by Larry Wall and the Perl 5
153 Porters, which was released under the same license terms.
157 L<perl>, ExtUtils::xsubpp, ExtUtils::MakeMaker, L<perlxs>, L<perlxstut>.