From 3dacda72505c4d9fdc70b8ee00788e2afed98a1d Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Tue, 18 May 2021 15:40:18 +0200 Subject: Update ccommon_api.md Final cleanups, getting ready for V2.0 RC and freeze API. --- docs/ccommon_api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index eb7918b9..27bbf589 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -50,11 +50,11 @@ c_foreach (i, csset_x, it, csset_x_end(&set)) printf(" %d", *i.ref); ``` ### c_with, c_withbuffer, c_breakwith -General defer in block mechanics. **c_withbuffer** is special for buffers, uses stack memory if buf is up to 256 bytes, +General ***defer*** mechanics. **c_withbuffer** is special for buffers, uses stack memory if buf is up to 256 bytes, and heap memory otherwise. -***NB***: Use only **c_breakwith** to break out of the block if needed, never use **return**, **break**, -or **goto** inside a with-block. +***NB***: Use ***only*** **c_breakwith** to break out of the block if needed, ***never*** use `return`, `break`, +or `goto` inside a **c_with**-block. | Usage | Description | |:-------------------------------|:-------------------------------------| -- cgit v1.2.3 From 9e0d78dbc9a2aace17f3b0e883771663921cb00b Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Tue, 18 May 2021 15:47:56 +0200 Subject: Update ccommon_api.md --- docs/ccommon_api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index 27bbf589..4d4e2f5e 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -76,11 +76,11 @@ cvec_str readFile(const char* name) // receiver should check errno variable cvec_str vec = cvec_str_init(); - c_with (FILE* fp = fopen(name, "r"), fclose(fp)) + c_with (FILE* fp = fopen(name, "r"), fclose(fp)) { c_with (cstr line = cstr_null, cstr_del(&line)) while (cstr_getline(&line, fp)) cvec_str_emplace_back(&vec, line.str); - + } return vec; } -- cgit v1.2.3 From 1b64fc2f92e2e63f68f63c4bf745df5ba75f5629 Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Tue, 18 May 2021 15:56:09 +0200 Subject: Update csview_api.md --- docs/csview_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/csview_api.md b/docs/csview_api.md index a76eb262..3a965565 100644 --- a/docs/csview_api.md +++ b/docs/csview_api.md @@ -121,7 +121,7 @@ using_cvec_sv(); int main() { - csview text = c_sv("A long and winded literal string"); + csview text = c_sv("The length of this literal is evaluated at compile time and stored in csview text."); printf("%s\nLength: %zu\n\n", text.str, text.size); // cvec of cstr elements, using csview as "emplace" type -- cgit v1.2.3