1 | #include "EXTERN.h" |
1 | #include "EXTERN.h" |
2 | #include "perl.h" |
2 | #include "perl.h" |
3 | #include "XSUB.h" |
3 | #include "XSUB.h" |
|
|
4 | |
|
|
5 | #include "patchlevel.h" |
|
|
6 | |
|
|
7 | #if PATCHLEVEL < 6 |
|
|
8 | # ifndef PL_ppaddr |
|
|
9 | # define PL_ppaddr ppaddr |
|
|
10 | # endif |
|
|
11 | # ifndef call_sv |
|
|
12 | # define call_sv perl_call_sv |
|
|
13 | # endif |
|
|
14 | # ifndef get_sv |
|
|
15 | # define get_sv perl_get_sv |
|
|
16 | # endif |
|
|
17 | # ifndef get_cv |
|
|
18 | # define get_cv perl_get_cv |
|
|
19 | # endif |
|
|
20 | # ifndef IS_PADGV |
|
|
21 | # define IS_PADGV(v) 0 |
|
|
22 | # endif |
|
|
23 | # ifndef IS_PADCONST |
|
|
24 | # define IS_PADCONST(v) 0 |
|
|
25 | # endif |
|
|
26 | #endif |
4 | |
27 | |
5 | #include "libcoro/coro.c" |
28 | #include "libcoro/coro.c" |
6 | |
29 | |
7 | #include <signal.h> |
30 | #include <signal.h> |
8 | |
31 | |
… | |
… | |
392 | PUSHs ((SV *)cv); |
415 | PUSHs ((SV *)cv); |
393 | |
416 | |
394 | get_padlist (cv); /* this is a monster */ |
417 | get_padlist (cv); /* this is a monster */ |
395 | } |
418 | } |
396 | } |
419 | } |
|
|
420 | #ifdef CXt_FORMAT |
397 | else if (CxTYPE(cx) == CXt_FORMAT) |
421 | else if (CxTYPE(cx) == CXt_FORMAT) |
398 | { |
422 | { |
399 | /* I never used formats, so how should I know how these are implemented? */ |
423 | /* I never used formats, so how should I know how these are implemented? */ |
400 | /* my bold guess is as a simple, plain sub... */ |
424 | /* my bold guess is as a simple, plain sub... */ |
401 | croak ("CXt_FORMAT not yet handled. Don't switch coroutines from within formats"); |
425 | croak ("CXt_FORMAT not yet handled. Don't switch coroutines from within formats"); |
402 | } |
426 | } |
|
|
427 | #endif |
403 | } |
428 | } |
404 | |
429 | |
405 | if (top_si->si_type == PERLSI_MAIN) |
430 | if (top_si->si_type == PERLSI_MAIN) |
406 | break; |
431 | break; |
407 | |
432 | |
… | |
… | |
474 | |
499 | |
475 | New(54,PL_markstack,16,I32); |
500 | New(54,PL_markstack,16,I32); |
476 | PL_markstack_ptr = PL_markstack; |
501 | PL_markstack_ptr = PL_markstack; |
477 | PL_markstack_max = PL_markstack + 16; |
502 | PL_markstack_max = PL_markstack + 16; |
478 | |
503 | |
|
|
504 | #ifdef SET_MARK_OFFSET |
479 | SET_MARK_OFFSET; |
505 | SET_MARK_OFFSET; |
|
|
506 | #endif |
480 | |
507 | |
481 | New(54,PL_scopestack,16,I32); |
508 | New(54,PL_scopestack,16,I32); |
482 | PL_scopestack_ix = 0; |
509 | PL_scopestack_ix = 0; |
483 | PL_scopestack_max = 16; |
510 | PL_scopestack_max = 16; |
484 | |
511 | |
… | |
… | |
1014 | SV *sv; |
1041 | SV *sv; |
1015 | AV *defav = GvAV (PL_defgv); |
1042 | AV *defav = GvAV (PL_defgv); |
1016 | struct coro *prev, *next; |
1043 | struct coro *prev, *next; |
1017 | |
1044 | |
1018 | if (!returnstk) |
1045 | if (!returnstk) |
1019 | returnstk = SvRV (get_sv ("Coro::Cont::return", FALSE)); |
1046 | returnstk = SvRV ((SV *)get_sv ("Coro::Cont::return", FALSE)); |
1020 | |
1047 | |
1021 | /* set up @_ -- ugly */ |
1048 | /* set up @_ -- ugly */ |
1022 | av_clear (defav); |
1049 | av_clear (defav); |
1023 | av_fill (defav, items - 1); |
1050 | av_fill (defav, items - 1); |
1024 | while (items--) |
1051 | while (items--) |