.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
.\"
.\" 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
.\"
.\" Required to disable full justification in groff 1.23.0.
.if n .ds AD l
.\" ========================================================================
.\"
.IX Title "ExtUtils::Typemaps::OutputMap 3"
.TH ExtUtils::Typemaps::OutputMap 3 2026-01-18 "perl v5.42.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_legacy
.IX Subsection "targetable_legacy"
Do not use for new code.
.PP
This is the original version of the \fBtargetable()\fR method, whose behaviour
has been frozen for backwards compatibility. It is used to determine
whether to emit an early \f(CW\*(C`dXSTARG\*(C'\fR, which will be in scope for most of
the XSUB. More recent XSUB code generation emits a \f(CW\*(C`dXSTARG\*(C'\fR in a tighter
scope if one has not already been emitted. Some XS code assumes that
\&\f(CW\*(C`TARG\*(C'\fR has been declared, so continue to declare it under the same
conditions as before. The newer \f(CW\*(C`targetable\*(C'\fR method may be true under
additional circumstances.
.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
.SS targetable
.IX Subsection "targetable"
Class method.
.PP
Return a boolean indicating whether the supplied code snippet is suitable
for using TARG as the destination SV rather than an new mortal.
.PP
In principle most things are, except expressions which would set the SV
to a ref value. That can cause the referred value to never be freed, as
targs aren\*(Aqt freed (at least for the lifetime of their CV). So in
practice, we restrict it to an approved list of \fBsv_setfoo()\fR forms, and
only where there is no extra code following the \fBsv_setfoo()\fR (so we have to
match the closing bracket, allowing for nested brackets etc within).
.SH "SEE ALSO"
.IX Header "SEE ALSO"
ExtUtils::Typemaps
.SH AUTHOR
.IX Header "AUTHOR"
Steffen Mueller \f(CW\*(C`<smueller@cpan.org\*(C'\fR>
.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.
