summaryrefslogtreecommitdiffhomepage
path: root/docs/cset_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-08-06 17:48:06 +0200
committerTyge Løvset <[email protected]>2022-08-06 17:48:06 +0200
commit618b5704e6f85cfe1b6e5c9c9373abe76a8bb628 (patch)
tree4e25a538c8ba3fd58bb25b90ff6dc54adfb31aa4 /docs/cset_api.md
parent927fa8093ea0bc1e25586e60c47cf1dd8a311d9e (diff)
downloadSTC-modified-618b5704e6f85cfe1b6e5c9c9373abe76a8bb628.tar.gz
STC-modified-618b5704e6f85cfe1b6e5c9c9373abe76a8bb628.zip
c_apply() deprecated: replaced with c_forarray() macro. Updated and improved README.md docs.
Diffstat (limited to 'docs/cset_api.md')
-rw-r--r--docs/cset_api.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/cset_api.md b/docs/cset_api.md
index 95a236b1..2d3ab6e7 100644
--- a/docs/cset_api.md
+++ b/docs/cset_api.md
@@ -86,10 +86,11 @@ int main ()
c_auto (cset_str, first, second)
c_auto (cset_str, third, fourth)
{
- c_apply(v, cset_str_emplace(&second, *v), const char*,
- {"red", "green", "blue"});
- c_apply(v, cset_str_emplace(&third, *v), const char*,
- {"orange", "pink", "yellow"});
+ c_forarray_p (const char*, v, {"red", "green", "blue"})
+ cset_str_emplace(&second, *v);
+
+ c_forarray_p (const char*, v, {"orange", "pink", "yellow"})
+ cset_str_emplace(&third, *v);
cset_str_emplace(&fourth, "potatoes");
cset_str_emplace(&fourth, "milk");
@@ -98,6 +99,7 @@ int main ()
fifth = cset_str_clone(second);
c_foreach (i, cset_str, third)
cset_str_emplace(&fifth, cstr_str(i.ref));
+
c_foreach (i, cset_str, fourth)
cset_str_emplace(&fifth, cstr_str(i.ref));
}