]> git.imager.perl.org - imager.git/blob - typemap.oldperl
Support tied/layered fh parameters for read()/write()
[imager.git] / typemap.oldperl
1 # typemaps for perl before 5.8
2 # STRLEN isn't in the default typemap in older perls
3 STRLEN                  T_UV
4 PerlIO *                T_INOUT
5
6 #############################################################################
7 INPUT
8 # the pre-5.8.0 T_AVREF input map was fixed in 5.8.0
9 T_AVREF
10         STMT_START {
11             SV *const xsub_tmp_sv = $arg;
12             SvGETMAGIC(xsub_tmp_sv);
13             if (SvROK(xsub_tmp_sv) && SvTYPE(SvRV(xsub_tmp_sv))==SVt_PVAV)
14                 $var = (AV*)SvRV(xsub_tmp_sv);
15             else
16                 Perl_croak(aTHX_ \"$var is not an array reference\");
17         } STMT_END
18
19 # the pre-5.8.0 T_HVREF input map was fixed in 5.8.0
20 T_HVREF
21         STMT_START {
22             SV *const xsub_tmp_sv = $arg;
23             SvGETMAGIC(xsub_tmp_sv);
24             if (SvROK(xsub_tmp_sv) && SvTYPE(SvRV(xsub_tmp_sv))==SVt_PVHV)
25                 $var = (HV*)SvRV(xsub_tmp_sv);
26             else
27                 Perl_croak(aTHX_ \"$var is not a hash reference\");
28         } STMT_END
29