… | |
… | |
36 | */ |
36 | */ |
37 | |
37 | |
38 | /* |
38 | /* |
39 | * 2006-10-26 Include stddef.h on OS X to work around one of its bugs. |
39 | * 2006-10-26 Include stddef.h on OS X to work around one of its bugs. |
40 | * Reported by Michael_G_Schwern. |
40 | * Reported by Michael_G_Schwern. |
|
|
41 | * 2006-11-25 Use _setjmp instead of setjmp on GNU/Linux. |
41 | */ |
42 | */ |
42 | |
43 | |
43 | #ifndef CORO_H |
44 | #ifndef CORO_H |
44 | #define CORO_H |
45 | #define CORO_H |
45 | |
46 | |
… | |
… | |
100 | typedef void (*coro_func)(void *); |
101 | typedef void (*coro_func)(void *); |
101 | |
102 | |
102 | /* |
103 | /* |
103 | * A coroutine state is saved in the following structure. Treat it as a |
104 | * A coroutine state is saved in the following structure. Treat it as a |
104 | * opaque type. errno and sigmask might be saved, but don't rely on it, |
105 | * opaque type. errno and sigmask might be saved, but don't rely on it, |
105 | * implement your own switching primitive. |
106 | * implement your own switching primitive if you need it. |
106 | */ |
107 | */ |
107 | typedef struct coro_context coro_context; |
108 | typedef struct coro_context coro_context; |
108 | |
109 | |
109 | /* |
110 | /* |
110 | * This function creates a new coroutine. Apart from a pointer to an |
111 | * This function creates a new coroutine. Apart from a pointer to an |