.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "ExtUtils::ParseXS 3perl" .TH ExtUtils::ParseXS 3perl "2023-11-25" "perl v5.36.0" "Perl Programmers Reference Guide" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" ExtUtils::ParseXS \- converts Perl XS code into C code .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use ExtUtils::ParseXS; \& \& my $pxs = ExtUtils::ParseXS\->new; \& $pxs\->process_file( filename => \*(Aqfoo.xs\*(Aq ); \& \& $pxs\->process_file( filename => \*(Aqfoo.xs\*(Aq, \& output => \*(Aqbar.c\*(Aq, \& \*(AqC++\*(Aq => 1, \& typemap => \*(Aqpath/to/typemap\*(Aq, \& hiertype => 1, \& except => 1, \& versioncheck => 1, \& linenumbers => 1, \& optimize => 1, \& prototypes => 1, \& ); \& \& # Legacy non\-OO interface using a singleton: \& use ExtUtils::ParseXS qw(process_file); \& process_file( filename => \*(Aqfoo.xs\*(Aq ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`ExtUtils::ParseXS\*(C'\fR will compile \s-1XS\s0 code into C code by embedding the constructs necessary to let C functions manipulate Perl values and creates the glue necessary to let Perl access those functions. The compiler uses typemaps to determine how to map C function parameters and variables to Perl values. .PP The compiler will search for typemap files called \fItypemap\fR. It will use the following search path to find default typemaps, with the rightmost typemap taking precedence. .PP .Vb 1 \& ../../../typemap:../../typemap:../typemap:typemap .Ve .SH "EXPORT" .IX Header "EXPORT" None by default. \f(CW\*(C`process_file()\*(C'\fR and/or \f(CW\*(C`report_error_count()\*(C'\fR may be exported upon request. Using the functional interface is discouraged. .SH "METHODS" .IX Header "METHODS" .ie n .IP "$pxs\->\fBnew()\fR" 4 .el .IP "\f(CW$pxs\fR\->\fBnew()\fR" 4 .IX Item "$pxs->new()" Returns a new, empty \s-1XS\s0 parser/compiler object. .ie n .IP "$pxs\->\fBprocess_file()\fR" 4 .el .IP "\f(CW$pxs\fR\->\fBprocess_file()\fR" 4 .IX Item "$pxs->process_file()" This method processes an \s-1XS\s0 file and sends output to a C file. The method may be called as a function (this is the legacy interface) and will then use a singleton as invocant. .Sp Named parameters control how the processing is done. The following parameters are accepted: .RS 4 .IP "\fB\*(C+\fR" 4 .IX Item "" Adds \f(CW\*(C`extern "C"\*(C'\fR to the C code. Default is false. .IP "\fBhiertype\fR" 4 .IX Item "hiertype" Retains \f(CW\*(C`::\*(C'\fR in type names so that \*(C+ hierarchical types can be mapped. Default is false. .IP "\fBexcept\fR" 4 .IX Item "except" Adds exception handling stubs to the C code. Default is false. .IP "\fBtypemap\fR" 4 .IX Item "typemap" Indicates that a user-supplied typemap should take precedence over the default typemaps. A single typemap may be specified as a string, or multiple typemaps can be specified in an array reference, with the last typemap having the highest precedence. .IP "\fBprototypes\fR" 4 .IX Item "prototypes" Generates prototype code for all xsubs. Default is false. .IP "\fBversioncheck\fR" 4 .IX Item "versioncheck" Makes sure at run time that the object file (derived from the \f(CW\*(C`.xs\*(C'\fR file) and the \f(CW\*(C`.pm\*(C'\fR files have the same version number. Default is true. .IP "\fBlinenumbers\fR" 4 .IX Item "linenumbers" Adds \f(CW\*(C`#line\*(C'\fR directives to the C output so error messages will look like they came from the original \s-1XS\s0 file. Default is true. .IP "\fBoptimize\fR" 4 .IX Item "optimize" Enables certain optimizations. The only optimization that is currently affected is the use of \fItarget\fRs by the output C code (see perlguts). Not optimizing may significantly slow down the generated code, but this is the way \&\fBxsubpp\fR of 5.005 and earlier operated. Default is to optimize. .IP "\fBinout\fR" 4 .IX Item "inout" Enable recognition of \f(CW\*(C`IN\*(C'\fR, \f(CW\*(C`OUT_LIST\*(C'\fR and \f(CW\*(C`INOUT_LIST\*(C'\fR declarations. Default is true. .IP "\fBargtypes\fR" 4 .IX Item "argtypes" Enable recognition of ANSI-like descriptions of function signature. Default is true. .IP "\fBs\fR" 4 .IX Item "s" \&\fIMaintainer note:\fR I have no clue what this does. Strips function prefixes? .RE .RS 4 .RE .ie n .IP "$pxs\->\fBreport_error_count()\fR" 4 .el .IP "\f(CW$pxs\fR\->\fBreport_error_count()\fR" 4 .IX Item "$pxs->report_error_count()" This method returns the number of [a certain kind of] errors encountered during processing of the \s-1XS\s0 file. .Sp The method may be called as a function (this is the legacy interface) and will then use a singleton as invocant. .SH "AUTHOR" .IX Header "AUTHOR" Based on xsubpp code, written by Larry Wall. .PP Maintained by: .IP "\(bu" 4 Ken Williams, .IP "\(bu" 4 David Golden, .IP "\(bu" 4 James Keenan, .IP "\(bu" 4 Steffen Mueller, .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2002\-2014 by Ken Williams, David Golden and other contributors. All rights reserved. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP Based on the \f(CW\*(C`ExtUtils::xsubpp\*(C'\fR code by Larry Wall and the Perl 5 Porters, which was released under the same license terms. .SH "SEE ALSO" .IX Header "SEE ALSO" perl, ExtUtils::xsubpp, ExtUtils::MakeMaker, perlxs, perlxstut.