-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtypemap
31 lines (28 loc) · 993 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
################################################################################
#
# Copyright (c) 2002-2024 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
const char * T_PV
CBC * T_CBC_OBJECT
INPUT
T_CBC_OBJECT
if (sv_isobject($arg) && SvTYPE(SvRV($arg)) == SVt_PVHV) {
HV *hv = (HV *) SvRV($arg);
SV **sv = hv_fetch(hv, \"\", 0, 0);
if (sv) {
IV tmp = SvIV(*sv);
$var = INT2PTR($type, tmp);
if ($var == NULL)
Perl_croak(aTHX_ \"${Package}::$func_name(): $var is NULL\");
if ($var->hv != hv)
Perl_croak(aTHX_ \"${Package}::$func_name(): $var->hv is corrupt\");
}
else
Perl_croak(aTHX_ \"${Package}::$func_name(): $var is corrupt\");
}
else
Perl_croak(aTHX_ \"${Package}::$func_name(): $var is not a blessed hash reference\");