diff options
| author | Tyge Løvset <[email protected]> | 2022-09-21 14:54:47 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-09-21 14:54:47 +0200 |
| commit | 307c0a111c8f063032ba90b2a7ae07122e2a2b1a (patch) | |
| tree | 0c989b52d7fe4a87d11dc593df5b16579dd1bd22 /docs/csview_api.md | |
| parent | a1d6c85b72027c9cd09d6bf0b1e0f7c3942e4aee (diff) | |
| download | STC-modified-307c0a111c8f063032ba90b2a7ae07122e2a2b1a.tar.gz STC-modified-307c0a111c8f063032ba90b2a7ae07122e2a2b1a.zip | |
Recent macro renames:
c_foreach_token() => c_fortoken()
c_foreach_match() => c_formatch()
Added:
c_forfiltered()
c_forpred()
Diffstat (limited to 'docs/csview_api.md')
| -rw-r--r-- | docs/csview_api.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/csview_api.md b/docs/csview_api.md index 6597d192..5cc05c02 100644 --- a/docs/csview_api.md +++ b/docs/csview_api.md @@ -79,11 +79,11 @@ csview cstr_u8_substr(const cstr* self, size_t bytepos, size_t u8len); csview cstr_slice(const cstr* self, size_t p1, size_t p2); csview cstr_slice_ex(const cstr* s, intptr_t p, intptr_t q); // negative p or q count from end ``` -#### Iterate tokens with *c_foreach_token*, *c_foreach_token_sv* +#### Iterate tokens with *c_fortoken*, *c_fortoken_sv* To iterate tokens in an input string separated by a string: ```c -c_foreach_token (i, "hello, one, two, three", ", ") +c_fortoken (i, "hello, one, two, three", ", ") printf("token: %.*s\n", c_ARGsv(i.token)); ``` @@ -174,7 +174,7 @@ and does not depend on null-terminated strings. *string_split()* function return void print_split(csview input, csview sep) { - c_foreach_token_sv (i, input, sep) + c_fortoken_sv (i, input, sep) printf("[%.*s]\n", c_ARGsv(i.token)); } @@ -186,7 +186,7 @@ cstack_str string_split(csview input, csview sep) { cstack_str out = cstack_str_init(); - c_foreach_token_sv (i, input, sep) + c_fortoken_sv (i, input, sep) cstack_str_push(&out, cstr_from_sv(i.token)); return out; |
