From 1e127dd1b9110e025f43a1dfe21d5ae1b248baa4 Mon Sep 17 00:00:00 2001 From: Tyge Lovset Date: Sun, 9 Apr 2023 11:08:42 +0200 Subject: Fixed coroutine docs. --- docs/ccommon_api.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index bc0a39ba..a2337161 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -351,14 +351,15 @@ To resume the coroutine from where it was suspended with *cco_yield()*, simply c |:----------|:-------------------------------------|:----------------------------------------| | | `cco_final:` | Obligatory label in coroutine | | | `cco_return;` | Early return from the coroutine | +| `bool` | `cco_alive(ctx)` | Is coroutine in initial or suspended state? | | `bool` | `cco_suspended(ctx)` | Is coroutine in suspended state? | -| `bool` | `cco_alive(ctx)` | Is coroutine still alive? | | `void` | `cco_begin(ctx)` | Begin coroutine block | | `rettype` | `cco_end(retval)` | End coroutine block with return value | -| `rettype` | `cco_end()` | End coroutine block with (void) | -| `rettype` | `cco_yield(retval)` | Return a value and suspend execution | +| `void` | `cco_end()` | End coroutine block | +| `rettype` | `cco_yield(retval)` | Suspend execution and return a value | +| `void` | `cco_yield()` | Suspend execution | | `rettype` | `cco_yield(corocall2, ctx2, retval)` | Yield from another coroutine and return val | -| `rettype` | `cco_yield(corocall2, ctx2)` | Yield from another coroutine (void) | +| `void` | `cco_yield(corocall2, ctx2)` | Yield from another coroutine | | | From the caller side: | | | `void` | `cco_stop(ctx)` | Next call of coroutine returns `cco_end()` | | `void` | `cco_reset(ctx)` | Reset state to initial (for reuse) | -- cgit v1.2.3