Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 41 lines (35 sloc) 1.285 kB
b526638 @jtpalmer OO constructor/destructor.
authored
1 TYPEMAP
769c53d @jtpalmer Refactor XS
authored
2 Math_Fractal_Julia * O_JULIA
baff871 @jtpalmer More OO Changes.
authored
3
4 INPUT
769c53d @jtpalmer Refactor XS
authored
5
0fc745f @jtpalmer Add comments
authored
6 # If the perl argument is a blessed reference cast it to a
7 # Math_Fractal_Julia *. If the argument is "Math::Fractal::Julia" or
8 # the name of a class derived from Math::Fractal::Julia use the default
9 # julia struct.
769c53d @jtpalmer Refactor XS
authored
10 O_JULIA
11 if (SvROK($arg)) {
12 if (sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG)) {
13 $var = ($type)SvIV((SV *)SvRV($arg));
14 } else {
15 Perl_croak(aTHX_ \"%s -- %s is not a blessed SV reference\",
16 \"${Package}::$func_name()\", \"$var\");
17 XSRETURN_UNDEF;
18 }
19 } else if (SvPOK($arg)) {
20 if (sv_derived_from($arg, \"$Package\")) {
21 /* julia is defined in Julia.xs */
22 $var = &julia;
23 } else {
24 Perl_croak(aTHX_ \"%s -- %s is not derived from %s\",
25 \"${Package}::$func_name()\", \"$var\", \"$Package\");
26 XSRETURN_UNDEF;
27 }
28 } else {
29 Perl_croak(aTHX_ \"%s -- %s is not the correct type\",
30 \"${Package}::$func_name()\", \"$var\");
31 XSRETURN_UNDEF;
d8c1276 @jtpalmer Code style change
authored
32 }
baff871 @jtpalmer More OO Changes.
authored
33
34 OUTPUT
769c53d @jtpalmer Refactor XS
authored
35
0fc745f @jtpalmer Add comments
authored
36 # The Perl object is blessed into "CLASS", which should be a char *
37 # having the name of the package for the blessing.
769c53d @jtpalmer Refactor XS
authored
38 O_JULIA
39 sv_setref_pv($arg, CLASS, (void *)$var);
d8c1276 @jtpalmer Code style change
authored
40
Something went wrong with that request. Please try again.