1ExtUtils::ParseXS(3)  User Contributed Perl Documentation ExtUtils::ParseXS(3)
2
3
4

NAME

6       ExtUtils::ParseXS - converts Perl XS code into C code
7

SYNOPSIS

9         use ExtUtils::ParseXS;
10
11         my $pxs = ExtUtils::ParseXS->new;
12         $pxs->process_file( filename => 'foo.xs' );
13
14         $pxs->process_file( filename => 'foo.xs',
15                             output => 'bar.c',
16                             'C++' => 1,
17                             typemap => 'path/to/typemap',
18                             hiertype => 1,
19                             except => 1,
20                             versioncheck => 1,
21                             linenumbers => 1,
22                             optimize => 1,
23                             prototypes => 1,
24                           );
25
26         # Legacy non-OO interface using a singleton:
27         use ExtUtils::ParseXS qw(process_file);
28         process_file( filename => 'foo.xs' );
29

DESCRIPTION

31       "ExtUtils::ParseXS" will compile XS code into C code by embedding the
32       constructs necessary to let C functions manipulate Perl values and
33       creates the glue necessary to let Perl access those functions.  The
34       compiler uses typemaps to determine how to map C function parameters
35       and variables to Perl values.
36
37       The compiler will search for typemap files called typemap.  It will use
38       the following search path to find default typemaps, with the rightmost
39       typemap taking precedence.
40
41           ../../../typemap:../../typemap:../typemap:typemap
42

EXPORT

44       None by default.  "process_file()" and/or "report_error_count()" may be
45       exported upon request. Using the functional interface is discouraged.
46

METHODS

48       $pxs->new()
49           Returns a new, empty XS parser/compiler object.
50
51       $pxs->process_file()
52           This method processes an XS file and sends output to a C file.  The
53           method may be called as a function (this is the legacy interface)
54           and will then use a singleton as invocant.
55
56           Named parameters control how the processing is done.  The following
57           parameters are accepted:
58
59           C++ Adds "extern "C"" to the C code.  Default is false.
60
61           hiertype
62               Retains "::" in type names so that C++ hierarchical types can
63               be mapped.  Default is false.
64
65           except
66               Adds exception handling stubs to the C code.  Default is false.
67
68           typemap
69               Indicates that a user-supplied typemap should take precedence
70               over the default typemaps.  A single typemap may be specified
71               as a string, or multiple typemaps can be specified in an array
72               reference, with the last typemap having the highest precedence.
73
74           prototypes
75               Generates prototype code for all xsubs.  Default is false.
76
77           versioncheck
78               Makes sure at run time that the object file (derived from the
79               ".xs" file) and the ".pm" files have the same version number.
80               Default is true.
81
82           linenumbers
83               Adds "#line" directives to the C output so error messages will
84               look like they came from the original XS file.  Default is
85               true.
86
87           optimize
88               Enables certain optimizations.  The only optimization that is
89               currently affected is the use of targets by the output C code
90               (see perlguts).  Not optimizing may significantly slow down the
91               generated code, but this is the way xsubpp of 5.005 and earlier
92               operated.  Default is to optimize.
93
94           inout
95               Enable recognition of "IN", "OUT_LIST" and "INOUT_LIST"
96               declarations.  Default is true.
97
98           argtypes
99               Enable recognition of ANSI-like descriptions of function
100               signature.  Default is true.
101
102           s   Maintainer note: I have no clue what this does.  Strips
103               function prefixes?
104
105       $pxs->report_error_count()
106           This method returns the number of [a certain kind of] errors
107           encountered during processing of the XS file.
108
109           The method may be called as a function (this is the legacy
110           interface) and will then use a singleton as invocant.
111

AUTHOR

113       Based on xsubpp code, written by Larry Wall.
114
115       Maintained by:
116
117       ·   Ken Williams, <ken@mathforum.org>
118
119       ·   David Golden, <dagolden@cpan.org>
120
121       ·   James Keenan, <jkeenan@cpan.org>
122
123       ·   Steffen Mueller, <smueller@cpan.org>
124
126       Copyright 2002-2014 by Ken Williams, David Golden and other
127       contributors.  All rights reserved.
128
129       This library is free software; you can redistribute it and/or modify it
130       under the same terms as Perl itself.
131
132       Based on the "ExtUtils::xsubpp" code by Larry Wall and the Perl 5
133       Porters, which was released under the same license terms.
134

SEE ALSO

136       perl, ExtUtils::xsubpp, ExtUtils::MakeMaker, perlxs, perlxstut.
137
138
139
140perl v5.30.0                      2019-07-26              ExtUtils::ParseXS(3)
Impressum