⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coro.h

📁 Fax and soft modem source code. - Slow modem You can use this code to build a soft modem function
💻 H
字号:
//Lorcan. no coro.h file found with this package. Found this at http://www.goron.de/~froese/coro/coro-1.1.0.pre2.tar.gz
#ifndef CORO_H
#define CORO_H

struct coroutine
{
    void *sp;			/* saved stack pointer while coro is inactive */
    struct coroutine *caller;	/* PUBLIC who has called this coroutine */
    struct coroutine *resumeto;	/* PUBLIC who to resume to */
    void *user;			/* PUBLIC user data.  for whatever you want. */

    void *(*func)(void *);	/* coroutines main function */
    int to_free;		/* how much memory to free on co_delete */
};

extern struct coroutine *co_current;	/* currently active coroutine */
extern struct coroutine co_main[];	/* automagically generated main coro. */

struct coroutine *co_create(void *func, void *stack, int stacksize);
void *co_call(struct coroutine *co, void *data);
void *co_resume(void *data);
void co_delete(struct coroutine *co);
void co_exit_to(struct coroutine *co, void *data) __attribute__((noreturn));
void co_exit(void *data) __attribute__((noreturn));

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -