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.14 by root, Wed Oct 3 01:48:06 2007 UTC vs.
Revision 1.15 by root, Tue Oct 9 22:29:26 2007 UTC

15/*struct coro;*/ /* opaque */ 15/*struct coro;*/ /* opaque */
16 16
17/* private structure, always use the provided macros below */ 17/* private structure, always use the provided macros below */
18struct CoroAPI { 18struct CoroAPI {
19 I32 ver; 19 I32 ver;
20 I32 rev;
20#define CORO_API_VERSION 5 21#define CORO_API_VERSION 6
21#define CORO_API_REVISION 0 22#define CORO_API_REVISION 0
22 23
23 /* internal */ 24 /* internal */
24 /*struct coro *(*sv_to_coro)(SV *arg, const char *funcname, const char *varname);*/ 25 /*struct coro *(*sv_to_coro)(SV *arg, const char *funcname, const char *varname);*/
25 26
32 int (*cede_notself) (void); 33 int (*cede_notself) (void);
33 int (*ready) (SV *coro_sv); 34 int (*ready) (SV *coro_sv);
34 int (*is_ready) (SV *coro_sv); 35 int (*is_ready) (SV *coro_sv);
35 int *nready; 36 int *nready;
36 SV *current; 37 SV *current;
38
39 SV *(*coro_event_next)(SV *watcher, int cancel, int wantev);
37}; 40};
38 41
39static struct CoroAPI *GCoroAPI; 42static struct CoroAPI *GCoroAPI;
40 43
41/* public API macros */ 44/* public API macros */
51#define I_CORO_API(YourName) \ 54#define I_CORO_API(YourName) \
52STMT_START { \ 55STMT_START { \
53 SV *sv = perl_get_sv("Coro::API",0); \ 56 SV *sv = perl_get_sv("Coro::API",0); \
54 if (!sv) croak("Coro::API not found"); \ 57 if (!sv) croak("Coro::API not found"); \
55 GCoroAPI = (struct CoroAPI*) SvIV(sv); \ 58 GCoroAPI = (struct CoroAPI*) SvIV(sv); \
56 if (GCoroAPI->ver != CORO_API_VERSION) { \ 59 if (GCoroAPI->ver != CORO_API_VERSION) \
57 croak("Coro::API version mismatch (%d != %d) -- please recompile %s", \ 60 croak("Coro::API version mismatch (%d != %d) -- please recompile %s", \
58 GCoroAPI->ver, CORO_API_VERSION, YourName); \ 61 GCoroAPI->ver, CORO_API_VERSION, YourName); \
59 } \ 62 if (GCoroAPI->rev < CORO_API_REVISION) \
63 croak("Coro::API revision outdated (%d != %d) -- please recompile %s", \
64 GCoroAPI->rev, CORO_API_REVISION, YourName); \
60} STMT_END 65} STMT_END
61 66
62#endif 67#endif
63 68

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines