summaryrefslogtreecommitdiffhomepage
path: root/docs/cset_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-08 16:16:49 +0100
committerTyge Løvset <[email protected]>2023-02-08 17:18:24 +0100
commitc4441f5fc665194fbd7a894a67a64a08c3beac42 (patch)
tree82f231b6e8fcb75625166f98aa785baaa265a3d6 /docs/cset_api.md
parent673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff)
downloadSTC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.tar.gz
STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.zip
Changed to use lowercase flow-control macros in examples (uppercase will still be supported). Improved many examples to use c_make() to init containers.
Diffstat (limited to 'docs/cset_api.md')
-rw-r--r--docs/cset_api.md17
1 files changed, 8 insertions, 9 deletions
diff --git a/docs/cset_api.md b/docs/cset_api.md
index ef4df63b..1c38d000 100644
--- a/docs/cset_api.md
+++ b/docs/cset_api.md
@@ -86,15 +86,14 @@ cset_X_value cset_X_value_clone(cset_X_value val);
int main ()
{
- c_AUTO (cset_str, fifth)
+ c_auto (cset_str, fifth)
{
- c_AUTO (cset_str, first, second)
- c_AUTO (cset_str, third, fourth)
+ c_auto (cset_str, first, second)
+ c_auto (cset_str, third, fourth)
{
- c_FORLIST (i, const char*, {"red", "green", "blue"})
- cset_str_emplace(&second, *i.ref);
+ second = c_make(cset_str, {"red", "green", "blue"});
- c_FORLIST (i, const char*, {"orange", "pink", "yellow"})
+ c_forlist (i, const char*, {"orange", "pink", "yellow"})
cset_str_emplace(&third, *i.ref);
cset_str_emplace(&fourth, "potatoes");
@@ -102,14 +101,14 @@ int main ()
cset_str_emplace(&fourth, "flour");
fifth = cset_str_clone(second);
- c_FOREACH (i, cset_str, third)
+ c_foreach (i, cset_str, third)
cset_str_emplace(&fifth, cstr_str(i.ref));
- c_FOREACH (i, cset_str, fourth)
+ c_foreach (i, cset_str, fourth)
cset_str_emplace(&fifth, cstr_str(i.ref));
}
printf("fifth contains:\n\n");
- c_FOREACH (i, cset_str, fifth)
+ c_foreach (i, cset_str, fifth)
printf("%s\n", cstr_str(i.ref));
}
}