diff options
| author | Tyge Lovset <[email protected]> | 2022-08-17 22:08:15 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2022-08-18 09:05:24 +0200 |
| commit | c5144785aaac11a30439064decabef62968b00a4 (patch) | |
| tree | e0f17c82ac1c529261d4a414158bae17c380060f /docs | |
| parent | a06463c2f0747bc142a9d5b2bf455c64aaf39890 (diff) | |
| download | STC-modified-c5144785aaac11a30439064decabef62968b00a4.tar.gz STC-modified-c5144785aaac11a30439064decabef62968b00a4.zip | |
Some API updates cstr, csview with utf8. Added front()/back() to cstack.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/cstr_api.md | 2 | ||||
| -rw-r--r-- | docs/csview_api.md | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/docs/cstr_api.md b/docs/cstr_api.md index d4e292cd..8c28a601 100644 --- a/docs/cstr_api.md +++ b/docs/cstr_api.md @@ -99,7 +99,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 pos, size_t u8len, csview repl); // replace u8len utf8 chars +void cstr_u8_replace(cstr* self, size_t bytepos, size_t u8len, csview repl); // replace u8len utf8 chars // iterate utf8 codepoints cstr_iter cstr_begin(const cstr* self); diff --git a/docs/csview_api.md b/docs/csview_api.md index 128a1c9d..65e9a066 100644 --- a/docs/csview_api.md +++ b/docs/csview_api.md @@ -49,8 +49,7 @@ csview csview_token(csview sv, csview sep, size_t* start); // *start #### UTF8 methods ```c size_t csview_u8_size(csview sv); -csview csview_u8_substr(csview sv, size_t u8pos, size_t u8len); -csview csview_u8_slice(csview sv, size_t u8p1, size_t u8p2); +csview csview_u8_substr(csview sv, size_t bytepos, size_t u8len); bool csview_valid_utf8(csview sv); // requires linking with src/utf8code.c csview_iter csview_begin(const csview* self); @@ -75,11 +74,10 @@ uint32_t utf8_peek(const char* s, int pos); // codepoint ```c csview cstr_substr(const cstr* self, size_t pos, size_t n); csview cstr_substr_ex(const cstr* s, intptr_t pos, size_t n); // negative pos count from end -csview cstr_u8_substr(const cstr* self, size_t u8pos, size_t u8len); +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 -csview cstr_u8_slice(const cstr* self, size_t u8p1, size_t u8p2); ``` #### Helper methods |
