diff options
| author | Tyge Løvset <[email protected]> | 2022-12-29 00:28:50 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-12-29 00:28:50 +0100 |
| commit | 0761c13f316cc98ae7756f3527931aa86bed5016 (patch) | |
| tree | e90777558956fcf91d6b1c958e0c3a6fb0ab007f /docs | |
| parent | d623c6c85071b9af5d607bb5d9aceceaea05220a (diff) | |
| download | STC-modified-0761c13f316cc98ae7756f3527931aa86bed5016.tar.gz STC-modified-0761c13f316cc98ae7756f3527931aa86bed5016.zip | |
Restructuring of some headers into include/algo folder. Some API changes *_replace*() functions have been renamed, and a few minor API changes.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ccommon_api.md | 4 | ||||
| -rw-r--r-- | docs/cregex_api.md | 4 | ||||
| -rw-r--r-- | docs/cstr_api.md | 7 | ||||
| -rw-r--r-- | docs/csview_api.md | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index a9961002..474c80ac 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -288,13 +288,13 @@ c_FORFILTER (i, crange, r1 // 2. The 11 first primes: printf("2"); -c_FORFILTER (i, crange, crange_literal(3, crange_MAX, 2) +c_FORFILTER (i, crange, crange_LITERAL(3, INT64_MAX, 2) , isPrime(*i.ref) , c_FLT_TAKE(10)) printf(" %lld", *i.ref); // 2 3 5 7 11 13 17 19 23 29 31 ``` -### c_FIND_IF, c_find_in, c_ERASE_IF +### c_FIND_IF, c_ERASE_IF Find or erase linearily in containers using a predicate ```c // Search vec for first value > 2: diff --git a/docs/cregex_api.md b/docs/cregex_api.md index 1b3c03d6..3197a59e 100644 --- a/docs/cregex_api.md +++ b/docs/cregex_api.md @@ -48,8 +48,8 @@ cstr cregex_replace_sv(const cregex* re, csview input, const char* replac /* All-in-one replacement (compile + find/replace + drop) */ cstr cregex_replace_pattern(const char* pattern, const char* input, const char* replace); -cstr cregex_replace_pattern_n(const char* pattern, const char* input, const char* replace, unsigned count, - bool(*mfun)(int capgrp, csview match, cstr* mstr), int rflags); +cstr cregex_replace_pattern_ex(const char* pattern, const char* input, const char* replace, unsigned count, + bool(*mfun)(int capgrp, csview match, cstr* mstr), int rflags); void cregex_drop(cregex* self); /* destroy */ ``` diff --git a/docs/cstr_api.md b/docs/cstr_api.md index 3857633a..0ee8b2cb 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -68,7 +68,8 @@ void cstr_insert_s(cstr* self, size_t pos, cstr ins); void cstr_erase(cstr* self, size_t pos, size_t len); // erase len bytes from pos -void cstr_replace(cstr* self, const char* search, const char* repl, unsigned count); // count==0: replace all. +void cstr_replace(cstr* self, const char* search, const char* repl); +void cstr_replace_ex(cstr* self, const char* search, const char* repl, unsigned count); cstr cstr_replace_sv(csview in, csview search, csview repl, unsigned count); void cstr_replace_at(cstr* self, size_t pos, size_t len, const char* repl); // replace at a position void cstr_replace_at_sv(cstr* self, size_t pos, size_t len, const csview repl); @@ -101,7 +102,7 @@ size_t cstr_u8_size_n(const cstr self, size_t nbytes); // utf8 si size_t cstr_u8_to_pos(const cstr* self, size_t u8idx); // byte pos offset at utf8 codepoint index const char* cstr_u8_at(const cstr* self, size_t u8idx); // char* position at utf8 codepoint index csview cstr_u8_chr(const cstr* self, size_t u8idx); // get utf8 character as a csview -void cstr_u8_replace(cstr* self, size_t bytepos, size_t u8len, csview repl); // replace u8len utf8 chars +void cstr_u8_replace_at(cstr* self, size_t bytepos, size_t u8len, csview repl); // replace u8len utf8 chars void cstr_u8_erase(cstr* self, size_t bytepos, size_t u8len); // erase u8len codepoints from pos // iterate utf8 codepoints @@ -173,7 +174,7 @@ int main() { cstr_erase(&s1, 7, 5); // -nine printf("%s\n", cstr_str(&s1)); - cstr_replace(&s1, "seven", "four", 1); + cstr_replace_ex(&s1, "seven", "four", 1); printf("%s\n", cstr_str(&s1)); // reassign: diff --git a/docs/csview_api.md b/docs/csview_api.md index 05348745..b5508ace 100644 --- a/docs/csview_api.md +++ b/docs/csview_api.md @@ -153,7 +153,7 @@ int main() { c_AUTO (cstr, s1) { s1 = cstr_lit("hell😀 w😀rld"); - cstr_u8_replace(&s1, cstr_find(&s1, "😀rld"), 1, c_SV("ø")); + cstr_u8_replace_at(&s1, cstr_find(&s1, "😀rld"), 1, c_SV("ø")); printf("%s\n", cstr_str(&s1)); c_FOREACH (i, cstr, s1) |
