1 %typemap
(in
) double const
[] {
7 croak
("$input is not a reference!");
8 if
(SvTYPE
(SvRV
($input
)) != SVt_PVAV
)
9 croak
("$input is not an array!");
11 tempav
= (AV
*)SvRV
($input
);
13 $
1 = (double
*) malloc
((len
+1)*sizeof
(double
));
14 for
(i
= 0; i
<= len
; i
++) {
15 tv
= av_fetch
(tempav
, i
, 0);
16 $
1[i
] = (double
) SvNV
(*tv
);
21 %typemap
(freearg
) double const
[] {
25 %typemap
(in
) double
* (double dvalue
) {
28 croak
("$input is not a reference!\n");
30 tempsv
= SvRV
($input
);
31 if
((!SvNOK
(tempsv
)) && (!SvIOK(tempsv))) {
32 croak
("$input is not a reference!\n");
34 dvalue
= SvNV
(tempsv
);
38 %typemap
(argout
) double
* {
40 tempsv
= SvRV
($input
);
41 sv_setnv
(tempsv
, *$
1);