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 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

DESCRIPTION

27       "ExtUtils::ParseXS" will compile XS code into C code by embedding the
28       constructs necessary to let C functions manipulate Perl values and
29       creates the glue necessary to let Perl access those functions.  The
30       compiler uses typemaps to determine how to map C function parameters
31       and 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

EXPORT

40       None by default.  "process_file()" may be exported upon request.
41

FUNCTIONS

43       process_file()
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++ hierarchical types can
52               be 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"
85               declarations.  Default is true.
86
87           argtypes
88               Enable recognition of ANSI-like descriptions of function
89               signature.  Default is true.
90
91           s   Maintainer note: I have no clue what this does.  Strips
92               function prefixes?
93
94       errors()
95           This function returns the number of [a certain kind of] errors
96           encountered during processing of the XS file.
97

AUTHOR

99       Based on xsubpp code, written by Larry Wall.
100
101       Maintained by:
102
103       ·   Ken Williams, <ken@mathforum.org>
104
105       ·   David Golden, <dagolden@cpan.org>
106
107       ·   James Keenan, <jkeenan@cpan.org>
108
109       ·   Steffen Mueller, <smueller@cpan.org>
110
112       Copyright 2002-2012 by Ken Williams, David Golden and other
113       contributors.  All rights reserved.
114
115       This library is free software; you can redistribute it and/or modify it
116       under the same terms as Perl itself.
117
118       Based on the "ExtUtils::xsubpp" code by Larry Wall and the Perl 5
119       Porters, which was released under the same license terms.
120

SEE ALSO

122       perl, ExtUtils::xsubpp, ExtUtils::MakeMaker, perlxs, perlxstut.
123
124
125
126perl v5.16.3                      2012-01-28              ExtUtils::ParseXS(3)
Impressum