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