#ifndef CCORO_H #define CCORO_H 1 #ifdef __cplusplus extern "C" { #endif #define coro_pad 8192 #define coro_code_done -1 #define coro_code_alloc -2 #define coro_code_dead -3 #include struct coro; typedef struct coro coro; typedef void noret; typedef void (*coro_func)(coro *caller); struct coro { coro *next; coro *prev; jmp_buf j; }; noret new_coro_2(coro_func f, coro *caller); void coro_init(void); int yield_val_2(coro *c, int val); int yield_val(coro **c, int val); int yield(coro **c); noret new_coro_3(coro_func f, coro *caller); coro *new_coro(coro_func f); extern int coro_init_done; extern coro *coro_top; extern coro *current_coro; extern coro main_coro; extern coro_func new_coro_f; extern jmp_buf alloc_ret; extern coro yielder; #ifdef __cplusplus } #endif #endif