summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-06-06 18:13:18 +0200
committerTyge Løvset <[email protected]>2023-06-06 18:20:57 +0200
commit7c57f4fb7edf33d030975a04160f183f71c48ecd (patch)
tree51073f15240641f2220462be02ee4cbca8d4cf54 /docs
parent8e6e1d2b266e46e3920edf7cc6eaad33c1312880 (diff)
downloadSTC-modified-7c57f4fb7edf33d030975a04160f183f71c48ecd.tar.gz
STC-modified-7c57f4fb7edf33d030975a04160f183f71c48ecd.zip
Fixed some logic in coroutines.
Changed API in c11/print.h (not officially part of STC as it is C11).
Diffstat (limited to 'docs')
-rw-r--r--docs/ccommon_api.md3
-rw-r--r--docs/cspan_api.md13
2 files changed, 9 insertions, 7 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md
index 7aa94c50..1fd8af75 100644
--- a/docs/ccommon_api.md
+++ b/docs/ccommon_api.md
@@ -372,13 +372,14 @@ To resume the coroutine from where it was suspended with *cco_yield()*, simply c
| | Function / operator | Description |
|:----------|:-------------------------------------|:----------------------------------------|
| | `cco_final:` | Label for cleanup in coroutine |
-| | `cco_return` | Early return from the coroutine (no arg) |
| `bool` | `cco_done(co)` | Is coroutine done? |
| | `cco_routine(co) { ... }` | The coroutine closure |
| | `cco_yield()` | Yield/suspend execution |
| | `cco_yield(ret)` | Yield/suspend execution and return ret |
| | `cco_await(promise)` | Await/suspend until promise is true |
| | `cco_await(promise, ret)` | Await/suspend with ret value |
+| | `cco_return` | Execute final cleanup, enter done-state |
+| | `cco_return_v(val)` | Yield final value, enter final-state |
| | Semaphores: | |
| | `cco_sem` | Semaphore type |
| | `cco_sem_await(sem)` | Await for the semaphore count > 0 |
diff --git a/docs/cspan_api.md b/docs/cspan_api.md
index ec203460..f0c6babd 100644
--- a/docs/cspan_api.md
+++ b/docs/cspan_api.md
@@ -136,6 +136,7 @@ int main() {
## Example 2
Slicing cspan without and with reducing the rank:
```c
+#define i_implement
#include <c11/print.h>
#include <stc/cspan.h>
@@ -154,7 +155,7 @@ int main()
puts("\niterate span2 flat:");
c_foreach (i, Span2, span2)
- print(" {}", *i.ref);
+ fmt_print(" {}", *i.ref);
puts("");
// slice without reducing rank:
@@ -164,8 +165,8 @@ int main()
c_forrange (i, ss3.shape[0]) {
c_forrange (j, ss3.shape[1]) {
c_forrange (k, ss3.shape[2])
- print(" {:2}", *cspan_at(&ss3, i, j, k));
- print(" |");
+ fmt_print(" {:2}", *cspan_at(&ss3, i, j, k));
+ fmt_print(" |");
}
}
// slice and reduce rank:
@@ -174,13 +175,13 @@ int main()
puts("\niterate ss2 by dimensions:");
c_forrange (i, ss2.shape[0]) {
c_forrange (j, ss2.shape[1])
- print(" {:2}", *cspan_at(&ss2, i, j));
- print(" |");
+ fmt_print(" {:2}", *cspan_at(&ss2, i, j));
+ fmt_print(" |");
}
puts("\niterate ss2 flat:");
c_foreach (i, Span2, ss2)
- print(" {:2}", *i.ref);
+ fmt_print(" {:2}", *i.ref);
puts("");
}
```