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 |
if (SvROK (arg) && SvTYPE(SvRV(arg)) == SVt_PVHV) |
10 |
{ |
11 |
SV **state = hv_fetch((HV *)SvRV(arg), \"_coro_state\", 11, 0); |
12 |
if (!state) |
13 |
croak (\"${Package}::$func_name() -- $var is a hashref but lacks the _coro_state key\"); |
14 |
arg = *state; |
15 |
} |
16 |
|
17 |
if (sv_derived_from (arg, \"Coro::State\")) |
18 |
$var = ($type) SvIV((SV*)SvRV(arg)); |
19 |
else |
20 |
croak (\"${Package}::$func_name() -- $var is not (and contains not) a Coro::State object\"); |
21 |
} |
22 |
|