Initial checkin.
[catacomb-perl] / typemap
CommitLineData
660b443c 1TYPEMAP
2mp * T_MP
3gccipher * T_GCALG
4gchash * T_GCALG
5gcMAC * T_GCALG
6gcipher * T_GALG
7ghash * T_GALG
8gMAC * T_GALG
9grand * T_GALG
10keysize * T_KEYSZ
11
12Rand_True * T_CATSTRUCT
13Rand_DSA * T_CATSTRUCT
14
15MP_Mont * T_CATSTRUCT
16MP_Barrett * T_CATSTRUCT
17MP_Mul * T_CATSTRUCT
18MP_CRT * T_CATSTRUCT
19MP_Prime_Filter * T_CATSTRUCT
20MP_Prime_Rabin * T_CATSTRUCT
21MP_Prime_Gen_Event * T_CATSTRUCT
22MP_Prime_Gen_Proc * T_PGENPROC
23MP_Prime_Gen_NullProc * T_NULLPGENPROC
24MP_Prime_Gen_MagicProc * T_CATSTRUCT
25MP_Prime_Gen_FilterStepper * T_CATSTRUCT
26MP_Prime_Gen_JumpStepper * T_CATSTRUCT
27MP_Prime_Gen_RabinTester * T_CATSTRUCT
28
29Key_File * T_CATSTRUCT
30Key_Data * T_CATSTRUCT
31Key * T_CATSTRUCT
32
33KeyErr T_KEYERR
34
35INPUT
36T_MP
37 $var = mp_fromsv($arg, \"$var\", 0, 0)
38T_CATSTRUCT
39 if (sv_derived_from($arg, \"${my $ntt = $ntype; $ntt =~ s/^(.*)Ptr$/Catacomb::$1/; $ntt =~ s/_/::/g; \$ntt}\"))
40 $var = ($type)SvIV((SV *)SvRV($arg));
41 else
42 croak(\"$var is not of type ${my $ntt = $ntype; $ntt =~ s/^(.*)Ptr$/Catacomb::$1/; $ntt =~ s/_/::/g; \$ntt}\")
43T_GALG
44 if (sv_derived_from($arg, \"${my $ntt = $ntype; $ntt =~ s/^g(.*)Ptr$/Catacomb::\u$1/; \$ntt}\"))
45 $var = ($type)SvIV((SV *)SvRV($arg));
46 else
47 croak(\"$var is not of type ${my $ntt = $ntype; $ntt =~ s/^g(.*)Ptr$/Catacomb::\u$1/; \$ntt}\")
48T_GCALG
49 if (sv_derived_from($arg, \"${my $ntt = $ntype; $ntt =~ s/^gc(.*)Ptr$/Catacomb::\u$1Class/; \$ntt}\"))
50 $var = ($type)SvIV((SV *)SvRV($arg));
51 else
52 croak(\"$var is not of type ${my $ntt = $ntype; $ntt =~ s/^gc(.*)Ptr$/Catacomb::\u$1Class/; \$ntt}\")
53T_KEYSZ
54 if (sv_derived_from($arg, \"Catacomb::KeySize\"))
55 $var = (keysize *)SvIV((SV *)SvRV($arg));
56 else
57 croak(\"$var is not of type Catacomb::KeySize\")
58T_PGENPROC
59 if (sv_derived_from($arg, \"Catacomb::MP::Prime::Gen::Proc\"))
60 $var = $arg;
61 else
62 croak(\"$var is not of type Catacomb::MP::Prime::Gen::Proc\")
63T_NULLPGENPROC
64 if (!SvOK($arg) ||
65 sv_derived_from($arg, \"Catacomb::MP::Prime::Gen::Proc\"))
66 $var = $arg;
67 else
68 croak(\"$var is not of type Catacomb::MP::Prime::Gen::Proc\")
69
70OUTPUT
71T_MP
72 if ($var)
73 sv_setref_pv($arg, \"Catacomb::MP\", (void*)$var);
74 else
75 $arg = &PL_sv_undef;
76T_CATSTRUCT
77 if ($var)
78 sv_setref_pv($arg, \"${my $ntt = $ntype; $ntt =~ s/^(.*)Ptr$/Catacomb::$1/; $ntt =~ s/_/::/g; \$ntt}\", (void *)$var);
79 else
80 $arg = &PL_sv_undef;
81T_GALG
82 if ($var)
83 sv_setref_pv($arg, \"${my $ntt = $ntype; $ntt =~ s/^g(.*)Ptr$/Catacomb::\u$1/; \$ntt}\", (void *)$var);
84 else
85 $arg = &PL_sv_undef;
86T_GCALG
87 if ($var)
88 sv_setref_pv($arg, \"${my $ntt = $ntype; $ntt =~ s/^gc(.*)Ptr$/Catacomb::\u$1Class/; \$ntt}\", (void *)$var);
89 else
90 $arg = &PL_sv_undef;
91T_KEYSZ
92 if ($var)
93 sv_setref_pv($arg, \"Catacomb::KeySize\", (void *)$var);
94 else
95 $arg = &PL_sv_undef;
96T_PGENPROC
97 $arg = $var;
98
99T_KEYERR
100 $arg = keyerr($var);