This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Spelling correction.
[perl5.git] / dist / Devel-PPPort / typemap
CommitLineData
adfe19db
MHM
1################################################################################
2#
3# typemap -- XS type mappings not present in early perls
4#
5################################################################################
6#
b2049988 7# Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz.
adfe19db
MHM
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
b2049988 16UV T_UV
adfe19db 17NV T_NV
b2049988 18HV * T_HVREF
77f7a5f4 19STRLEN T_UV
adfe19db
MHM
20
21INPUT
22T_UV
b2049988 23 $var = ($type)SvUV($arg)
adfe19db 24T_NV
b2049988 25 $var = ($type)SvNV($arg)
8565c31a 26T_HVREF
b2049988
MHM
27 if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVHV)
28 $var = (HV*)SvRV($arg);
29 else
30 Perl_croak(aTHX_ \"$var is not a hash reference\")
adfe19db
MHM
31
32OUTPUT
33T_UV
b2049988 34 sv_setuv($arg, (UV)$var);
adfe19db 35T_NV
b2049988 36 sv_setnv($arg, (NV)$var);