diff options
| author | Tyge Løvset <[email protected]> | 2023-05-24 16:21:22 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-05-24 16:21:22 +0200 |
| commit | 276b8110033aa275f58ce60d096f220ca050738c (patch) | |
| tree | 76f5e2c069ecbe268c5497fafafb3b4cb7e66a51 /misc/examples/coread.c | |
| parent | 8a19b4d6ff098ec014244c86569a7bea2db65514 (diff) | |
| download | STC-modified-276b8110033aa275f58ce60d096f220ca050738c.tar.gz STC-modified-276b8110033aa275f58ce60d096f220ca050738c.zip | |
coroutine.h:
- Renamed Liigo's coroutine macro cco(x) => cco_routine(x).
- Removed cco_begin(x), cco_end() macros. Replaced by cco_routine(x).
- Replaced csleep_ms() with csleep_us(), using select() which is portable.
- Updated all coroutine examples.
Diffstat (limited to 'misc/examples/coread.c')
| -rw-r--r-- | misc/examples/coread.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/misc/examples/coread.c b/misc/examples/coread.c index 1976231f..ef6cd6ee 100644 --- a/misc/examples/coread.c +++ b/misc/examples/coread.c @@ -1,3 +1,4 @@ +#define i_static #include <stc/cstr.h> #include <stc/algo/coroutine.h> #include <errno.h> @@ -13,7 +14,7 @@ struct file_read { void file_read(struct file_read* g) { - cco(g) { + cco_routine(g) { g->fp = fopen(g->filename, "r"); g->line = cstr_init(); |
