ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/typemap
Revision: 1.3
Committed: Mon Jul 23 23:48:05 2001 UTC (23 years, 8 months ago) by root
Branch: MAIN
Changes since 1.2: +10 -7 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 Coro::State T_PTROBJ
2     Coro::State_or_hashref T_STATE_OR_HASHREF
3    
4     INPUT
5    
6     T_STATE_OR_HASHREF
7     {
8     SV *arg = $arg;
9 root 1.3
10     if (SvROK(arg) && SvTYPE(SvRV(arg)) == SVt_PVHV)
11 root 1.1 {
12 root 1.3 HE *he = hv_fetch_ent((HV *)SvRV(arg), ucoro_state_sv, 0, ucoro_state_hash);
13    
14     if (!he)
15     croak (\"${Package}::$func_name() -- $var is a hashref but lacks the \" UCORO_STATE \" key\");
16    
17     arg = HeVAL(he);
18 root 1.1 }
19    
20 root 1.3 /* must also be changed inside Coro::Cont::yield */
21     if (SvROK(arg) && SvSTASH(SvRV(arg)) == coro_state_stash)
22 root 1.1 $var = ($type) SvIV((SV*)SvRV(arg));
23     else
24     croak (\"${Package}::$func_name() -- $var is not (and contains not) a Coro::State object\");
25     }
26