.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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::Typemaps::OutputMap 3perl" .TH ExtUtils::Typemaps::OutputMap 3perl 2024-01-12 "perl v5.38.2" "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::Typemaps::OutputMap \- Entry in the OUTPUT section of a typemap .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 5 \& use ExtUtils::Typemaps; \& ... \& my $output = $typemap\->get_output_map(\*(AqT_NV\*(Aq); \& my $code = $output\->code(); \& $output\->code("..."); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Refer to ExtUtils::Typemaps for details. .SH METHODS .IX Header "METHODS" .SS new .IX Subsection "new" Requires \f(CW\*(C`xstype\*(C'\fR and \f(CW\*(C`code\*(C'\fR parameters. .SS code .IX Subsection "code" Returns or sets the OUTPUT mapping code for this entry. .SS xstype .IX Subsection "xstype" Returns the name of the XS type of the OUTPUT map. .SS cleaned_code .IX Subsection "cleaned_code" Returns a cleaned-up copy of the code to which certain transformations have been applied to make it more ANSI compliant. .SS targetable .IX Subsection "targetable" This is an obscure but effective optimization that used to live in \f(CW\*(C`ExtUtils::ParseXS\*(C'\fR directly. Not implementing it should never result in incorrect use of typemaps, just less efficient code. .PP In a nutshell, this will check whether the output code involves calling \f(CW\*(C`sv_setiv\*(C'\fR, \f(CW\*(C`sv_setuv\*(C'\fR, \f(CW\*(C`sv_setnv\*(C'\fR, \f(CW\*(C`sv_setpv\*(C'\fR or \&\f(CW\*(C`sv_setpvn\*(C'\fR to set the special \f(CW$arg\fR placeholder to a new value \&\fBAT THE END OF THE OUTPUT CODE\fR. If that is the case, the code is eligible for using the \f(CW\*(C`TARG\*(C'\fR\-related macros to optimize this. Thus the name of the method: \f(CW\*(C`targetable\*(C'\fR. .PP If this optimization is applicable, \f(CW\*(C`ExtUtils::ParseXS\*(C'\fR will emit a \f(CW\*(C`dXSTARG;\*(C'\fR definition at the start of the generated XSUB code, and type (see below) dependent code to set \f(CW\*(C`TARG\*(C'\fR and push it on the stack at the end of the generated XSUB code. .PP If the optimization can not be applied, this returns undef. If it can be applied, this method returns a hash reference containing the following information: .PP .Vb 5 \& type: Any of the characters i, u, n, p \& with_size: Bool indicating whether this is the sv_setpvn variant \& what: The code that actually evaluates to the output scalar \& what_size: If "with_size", this has the string length (as code, \& not constant, including leading comma) .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" ExtUtils::Typemaps .SH AUTHOR .IX Header "AUTHOR" Steffen Mueller \f(CW\*(C` .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2009, 2010, 2011, 2012 Steffen Mueller .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.