-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypemap
33 lines (29 loc) · 884 Bytes
/
typemap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
################################################################################
#
# $Project: /Tie-Hash-Indexed $
# $Author: mhx $
# $Date: 2006/01/21 12:06:58 +0100 $
# $Revision: 3 $
# $Source: /typemap $
#
################################################################################
#
# Copyright (c) 2002-2003 Marcus Holland-Moritz. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
################################################################################
TYPEMAP
IXHV * T_OBJECT
OUTPUT
T_OBJECT
sv_setref_pv($arg, CLASS, (void*)$var);
INPUT
T_OBJECT
if (sv_isobject($arg) && SvTYPE(SvRV($arg)) == SVt_PVMG)
{
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else
Perl_croak(aTHX_ \"${Package}::$func_name(): $var is not a blessed SV reference\");