ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/CoroAPI.h
(Generate patch)

Comparing Coro/Coro/CoroAPI.h (file contents):
Revision 1.5 by pcg, Wed Nov 5 20:02:46 2003 UTC vs.
Revision 1.8 by root, Sun Nov 26 02:16:19 2006 UTC

14 14
15/* perl-related */ 15/* perl-related */
16#define TRANSFER_SAVE_DEFAV 0x00000001 /* @_ */ 16#define TRANSFER_SAVE_DEFAV 0x00000001 /* @_ */
17#define TRANSFER_SAVE_DEFSV 0x00000002 /* $_ */ 17#define TRANSFER_SAVE_DEFSV 0x00000002 /* $_ */
18#define TRANSFER_SAVE_ERRSV 0x00000004 /* $@ */ 18#define TRANSFER_SAVE_ERRSV 0x00000004 /* $@ */
19/* c-related */
20#define TRANSFER_SAVE_CCTXT 0x00000100
21#ifdef CORO_LAZY_STACK
22# define TRANSFER_LAZY_STACK 0x00000200
23#else
24# define TRANSFER_LAZY_STACK 0x00000000
25#endif
26 19
27#define TRANSFER_SAVE_ALL (TRANSFER_SAVE_DEFAV|TRANSFER_SAVE_DEFSV \ 20#define TRANSFER_SAVE_ALL ( TRANSFER_SAVE_DEFAV \
21 | TRANSFER_SAVE_DEFSV \
28 |TRANSFER_SAVE_ERRSV|TRANSFER_SAVE_CCTXT) 22 | TRANSFER_SAVE_ERRSV )
29 23
30struct coro; /* opaque */ 24struct coro; /* opaque */
31 25
32struct CoroAPI { 26struct CoroAPI {
33 I32 ver; 27 I32 ver;
35 29
36 /* internal */ 30 /* internal */
37 /*struct coro *(*sv_to_coro)(SV *arg, const char *funcname, const char *varname);*/ 31 /*struct coro *(*sv_to_coro)(SV *arg, const char *funcname, const char *varname);*/
38 32
39 /* public, state */ 33 /* public, state */
40 void (*transfer)(pTHX_ SV *prev, SV *next, int flags); 34 void (*transfer)(SV *prev, SV *next, int flags);
41 35
42 /* public, coro */ 36 /* public, coro */
43 void (*schedule)(void); 37 void (*schedule)(void);
44 void (*cede)(void); 38 void (*cede)(void);
45 void (*ready)(SV *sv); 39 void (*ready)(SV *sv);
47 GV *current; 41 GV *current;
48}; 42};
49 43
50static struct CoroAPI *GCoroAPI; 44static struct CoroAPI *GCoroAPI;
51 45
52#define CORO_TRANSFER(prev,next) GCoroAPI->transfer(aTHX_ (prev),(next)) 46#define CORO_TRANSFER(prev,next,flags) GCoroAPI->transfer(aTHX_ (prev), (next), (flags))
53#define CORO_SCHEDULE GCoroAPI->schedule() 47#define CORO_SCHEDULE GCoroAPI->schedule ()
54#define CORO_CEDE GCoroAPI->cede() 48#define CORO_CEDE GCoroAPI->cede ()
55#define CORO_READY(coro) GCoroAPI->ready(coro) 49#define CORO_READY(coro) GCoroAPI->ready (coro)
56#define CORO_NREADY (*GCoroAPI->nready) 50#define CORO_NREADY (*GCoroAPI->nready)
57#define CORO_CURRENT SvRV(GvSV(GCoroAPI->current)) 51#define CORO_CURRENT SvRV(GvSV(GCoroAPI->current))
58 52
59#define I_CORO_API(YourName) \ 53#define I_CORO_API(YourName) \
60STMT_START { \ 54STMT_START { \

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines