This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deprecate lexical $_
[perl5.git] / cpan / Devel-PPPort / typemap
1 ################################################################################
2 #
3 #  typemap -- XS type mappings not present in early perls
4 #
5 ################################################################################
6 #
7 #  $Revision: 10 $
8 #  $Author: mhx $
9 #  $Date: 2010/03/07 13:15:40 +0100 $
10 #
11 ################################################################################
12 #
13 #  Version 3.x, Copyright (C) 2004-2010, Marcus Holland-Moritz.
14 #  Version 2.x, Copyright (C) 2001, Paul Marquess.
15 #  Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
16 #
17 #  This program is free software; you can redistribute it and/or
18 #  modify it under the same terms as Perl itself.
19 #
20 ################################################################################
21
22 UV                      T_UV
23 NV                      T_NV
24 HV *                    T_HVREF
25
26 INPUT
27 T_UV
28         $var = ($type)SvUV($arg)
29 T_NV
30         $var = ($type)SvNV($arg)
31 T_HVREF
32         if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVHV)
33             $var = (HV*)SvRV($arg);
34         else
35             Perl_croak(aTHX_ \"$var is not a hash reference\")
36
37 OUTPUT
38 T_UV
39         sv_setuv($arg, (UV)$var);
40 T_NV
41         sv_setnv($arg, (NV)$var);