summaryrefslogtreecommitdiffhomepage
path: root/docs/ccommon_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-05-01 23:11:45 +0200
committerTyge Løvset <[email protected]>2023-05-01 23:11:45 +0200
commit399eb8d0e1de2839d826a9e0cf123d90d00b0018 (patch)
treea8731f86aa779af8412ba77e4d27fa5e66b94cab /docs/ccommon_api.md
parentf916573e2b3652d9b3f6fb82aadd5f2cfb3ce2fe (diff)
downloadSTC-modified-399eb8d0e1de2839d826a9e0cf123d90d00b0018.tar.gz
STC-modified-399eb8d0e1de2839d826a9e0cf123d90d00b0018.zip
Replaced cco_yield(corocall, ctx, retval) with cco_await(cond) and cco_await_while(cond).
Diffstat (limited to 'docs/ccommon_api.md')
-rw-r--r--docs/ccommon_api.md15
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md
index 7a3c3196..549eff4e 100644
--- a/docs/ccommon_api.md
+++ b/docs/ccommon_api.md
@@ -355,15 +355,16 @@ 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_done(ctx)` | Is coroutine not alive? |
| `bool` | `cco_suspended(ctx)` | Is coroutine in suspended state? |
| `void` | `cco_begin(ctx)` | Begin coroutine block |
-| `rettype` | `cco_end(retval)` | End coroutine block with return value |
-| `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 |
-| `void` | `cco_yield(corocall2, ctx2)` | Yield from another coroutine |
-| | From the caller side: | |
+| `rettype` | `cco_end(retval)` | End coroutine block and return retval |
+| `void` | `cco_end()` | End coroutine block (return void) |
+| `rettype` | `cco_yield(retval)` | Suspend execution and return retval |
+| `void` | `cco_yield()` | Suspend execution (return void) |
+| `rettype` | `cco_await_while(cond, retval)` | If cond, suspend execution and return retval |
+| `bool` | `cco_await(cond)` | If not cond, suspend execution and return true |
+| | From caller side: | |
| `void` | `cco_stop(ctx)` | Next call of coroutine returns `cco_end()` |
| `void` | `cco_reset(ctx)` | Reset state to initial (for reuse) |