-
Notifications
You must be signed in to change notification settings - Fork 0
/
typemap
49 lines (45 loc) · 1.18 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
TYPEMAP
ndfint * T_INTP
ndffloat T_NV
ndffloat * T_FLOATP
Logical T_IV
ndfdouble * T_DOUBLEP
ndfint T_IV
ndfdouble T_DOUBLE
hdsdim * T_HDSDIMP
hdsbool_t T_IV
int * T_INTP
HDSLoc * T_PTROBJ_NULLABLE
NdgProvenance * T_PTROBJ
Ary* T_PTROBJ
constchar ** T_PACKEDARRAY
INPUT
T_INTP
$var = ($type)pack1D($arg,'i')
T_HDSDIMP
$var = ($type)pack1D($arg,'H')
T_FLOATP
$var = ($type)pack1D($arg,'f')
T_DOUBLEP
$var = ($type)pack1D($arg,'d')
T_PTROBJ_NULLABLE
if (SvROK($arg) && sv_derived_from($arg, \"${ntype}\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type,tmp);
}
else {
Perl_croak_nocontext(\"%s: %s is not of type %s\",
${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
\"$var\", \"$ntype\");
}
OUTPUT
T_INTP
sv_setpv((SV*)$arg, (char *)$var);
T_HDSDIMP
sv_setpv((SV*)$arg, (char *)$var);
T_FLOATP
sv_setpv((SV*)$arg, (char *)$var);
T_DOUBLEP
sv_setpv((SV*)$arg, (char *)$var);
T_PTROBJ_NULLABLE
sv_setiv(newSVrv($arg, \"${ntype}\"), PTR2IV((void*)$var));