1ExtUtils::Typemaps::OutUpsuetrMaCpo(n3t)ributed Perl DocEuxmteUnttialtsi:o:nTypemaps::OutputMap(3)
2
3
4

NAME

6       ExtUtils::Typemaps::OutputMap - Entry in the OUTPUT section of a
7       typemap
8

SYNOPSIS

10         use ExtUtils::Typemaps;
11         ...
12         my $output = $typemap->get_output_map('T_NV');
13         my $code = $output->code();
14         $output->code("...");
15

DESCRIPTION

17       Refer to ExtUtils::Typemaps for details.
18

METHODS

20   new
21       Requires "xstype" and "code" parameters.
22
23   code
24       Returns or sets the OUTPUT mapping code for this entry.
25
26   xstype
27       Returns the name of the XS type of the OUTPUT map.
28
29   cleaned_code
30       Returns a cleaned-up copy of the code to which certain transformations
31       have been applied to make it more ANSI compliant.
32
33   targetable
34       This is an obscure but effective optimization that used to live in
35       "ExtUtils::ParseXS" directly. Not implementing it should never result
36       in incorrect use of typemaps, just less efficient code.
37
38       In a nutshell, this will check whether the output code involves calling
39       "sv_setiv", "sv_setuv", "sv_setnv", "sv_setpv" or "sv_setpvn" to set
40       the special $arg placeholder to a new value AT THE END OF THE OUTPUT
41       CODE. If that is the case, the code is eligible for using the
42       "TARG"-related macros to optimize this.  Thus the name of the method:
43       "targetable".
44
45       If this optimization is applicable, "ExtUtils::ParseXS" will emit a
46       "dXSTARG;" definition at the start of the generated XSUB code, and type
47       (see below) dependent code to set "TARG" and push it on the stack at
48       the end of the generated XSUB code.
49
50       If the optimization can not be applied, this returns undef.  If it can
51       be applied, this method returns a hash reference containing the
52       following information:
53
54         type:      Any of the characters i, u, n, p
55         with_size: Bool indicating whether this is the sv_setpvn variant
56         what:      The code that actually evaluates to the output scalar
57         what_size: If "with_size", this has the string length (as code,
58                    not constant, including leading comma)
59

SEE ALSO

61       ExtUtils::Typemaps
62

AUTHOR

64       Steffen Mueller "<smueller@cpan.org">
65
67       Copyright 2009, 2010, 2011, 2012 Steffen Mueller
68
69       This program is free software; you can redistribute it and/or modify it
70       under the same terms as Perl itself.
71
72
73
74perl v5.32.0                      2020-07-28  ExtUtils::Typemaps::OutputMap(3)
Impressum