This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
45a9fc7cdcf5bb411f1c201e64b89e0386b7fcb9
[perl5.git] / ext / POSIX / typemap
1 Mode_t                  T_NV
2 pid_t                   T_NV
3 Uid_t                   T_NV
4 Time_t                  T_NV
5 Gid_t                   T_NV
6 Uid_t                   T_NV
7 Off_t                   T_NV
8 Dev_t                   T_NV
9 NV                      T_NV
10 fd                      T_IV
11 speed_t                 T_IV
12 tcflag_t                T_IV
13 cc_t                    T_IV
14 POSIX::SigSet           T_OPAQUEPTROBJ
15 POSIX::Termios          T_OPAQUEPTROBJ
16 POSIX::SigAction        T_HVREF
17 POSIX::SigNo            T_SIGNO
18
19 INPUT
20 T_OPAQUEPTROBJ
21         {
22             SV * sv = $arg;
23             if (SvROK(sv) && sv_derived_from(sv, \"${ntype}\"))
24                 $var = ($type)SvPV_nolen(SvRV(sv));
25             else
26                 croak(\"%s: %s is not of type %s\",
27                             ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
28                         \"$var\", \"$ntype\");
29         }
30
31 T_SIGNO
32         if ((sig = SvIV($arg)) < 0) {
33            croak(\"%s: Negative signals are not allowed %d\",
34                 ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
35                                    sig);
36         }
37
38 OUTPUT
39 T_OPAQUEPTROBJ
40         sv_setref_pvn($arg, \"${ntype}\", (const char*)$var, sizeof(*$var));