1ExtUtils::ParseXS(3) User Contributed Perl Documentation ExtUtils::ParseXS(3)
2
3
4
6 ExtUtils::ParseXS - converts Perl XS code into C code
7
9 use ExtUtils::ParseXS qw(process_file);
10
11 process_file( filename => 'foo.xs' );
12
13 process_file( filename => 'foo.xs',
14 output => 'bar.c',
15 'C++' => 1,
16 typemap => 'path/to/typemap',
17 hiertype => 1,
18 except => 1,
19 prototypes => 1,
20 versioncheck => 1,
21 linenumbers => 1,
22 optimize => 1,
23 prototypes => 1,
24 );
25 =head1 DESCRIPTION
26
27 "ExtUtils::ParseXS" will compile XS code into C code by embedding the
28 constructs necessary to let C functions manipulate Perl values and cre‐
29 ates the glue necessary to let Perl access those functions. The com‐
30 piler uses typemaps to determine how to map C function parameters and
31 variables to Perl values.
32
33 The compiler will search for typemap files called typemap. It will use
34 the following search path to find default typemaps, with the rightmost
35 typemap taking precedence.
36
37 ../../../typemap:../../typemap:../typemap:typemap
38
40 None by default. "process_file()" may be exported upon request.
41
43 process_xs()
44 This function processes an XS file and sends output to a C file.
45 Named parameters control how the processing is done. The following
46 parameters are accepted:
47
48 C++ Adds "extern "C"" to the C code. Default is false.
49
50 hiertype
51 Retains "::" in type names so that C++ hierachical types can be
52 mapped. Default is false.
53
54 except
55 Adds exception handling stubs to the C code. Default is false.
56
57 typemap
58 Indicates that a user-supplied typemap should take precedence
59 over the default typemaps. A single typemap may be specified
60 as a string, or multiple typemaps can be specified in an array
61 reference, with the last typemap having the highest precedence.
62
63 prototypes
64 Generates prototype code for all xsubs. Default is false.
65
66 versioncheck
67 Makes sure at run time that the object file (derived from the
68 ".xs" file) and the ".pm" files have the same version number.
69 Default is true.
70
71 linenumbers
72 Adds "#line" directives to the C output so error messages will
73 look like they came from the original XS file. Default is
74 true.
75
76 optimize
77 Enables certain optimizations. The only optimization that is
78 currently affected is the use of targets by the output C code
79 (see perlguts). Not optimizing may significantly slow down the
80 generated code, but this is the way xsubpp of 5.005 and earlier
81 operated. Default is to optimize.
82
83 inout
84 Enable recognition of "IN", "OUT_LIST" and "INOUT_LIST" decla‐
85 rations. Default is true.
86
87 argtypes
88 Enable recognition of ANSI-like descriptions of function signa‐
89 ture. Default is true.
90
91 s I have no clue what this does. Strips function prefixes?
92
93 errors()
94 This function returns the number of [a certain kind of] errors
95 encountered during processing of the XS file.
96
98 Based on xsubpp code, written by Larry Wall.
99
100 Maintained by Ken Williams, <ken@mathforum.org>
101
103 Copyright 2002-2003 Ken Williams. All rights reserved.
104
105 This library is free software; you can redistribute it and/or modify it
106 under the same terms as Perl itself.
107
108 Based on the ExtUtils::xsubpp code by Larry Wall and the Perl 5
109 Porters, which was released under the same license terms.
110
112 perl, ExtUtils::xsubpp, ExtUtils::MakeMaker, perlxs, perlxstut.
113
114
115
116perl v5.8.8 2007-01-29 ExtUtils::ParseXS(3)