libco.h 442 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. libco v20 (2019-10-16)
  3. author: byuu
  4. license: ISC
  5. */
  6. #ifndef LIBCO_H
  7. #define LIBCO_H
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. typedef void* cothread_t;
  12. cothread_t co_active(void);
  13. cothread_t co_derive(void*, unsigned int, void (*)(void));
  14. cothread_t co_create(unsigned int, void (*)(void));
  15. void co_delete(cothread_t);
  16. void co_switch(cothread_t);
  17. int co_serializable(void);
  18. #ifdef __cplusplus
  19. }
  20. #endif
  21. /* ifndef LIBCO_H */
  22. #endif