diff options
| author | Tyge Løvset <[email protected]> | 2022-08-08 16:13:05 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-08-08 16:29:43 +0200 |
| commit | fea47e9b0b1f1137944a446d0d7e4b413f7bc2dd (patch) | |
| tree | e62f48c37a87a732e83f1dc336ba697b47443f9d /include/stc | |
| parent | 1954c6aa34aae6301f90e81e546db6fb666c517a (diff) | |
| download | STC-modified-fea47e9b0b1f1137944a446d0d7e4b413f7bc2dd.tar.gz STC-modified-fea47e9b0b1f1137944a446d0d7e4b413f7bc2dd.zip | |
Changed *cstr_tolower*/*cstr_toupper* arg from `const cstr*` to `csview`.
Diffstat (limited to 'include/stc')
| -rw-r--r-- | include/stc/cstr.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/stc/cstr.h b/include/stc/cstr.h index 68f35674..d7e5dcd4 100644 --- a/include/stc/cstr.h +++ b/include/stc/cstr.h @@ -172,12 +172,15 @@ STC_INLINE size_t cstr_capacity(cstr s) // utf8 methods defined in/depending on src/utf8code.c: -extern cstr cstr_tofold(const cstr* self); -extern cstr cstr_tolower(const cstr* self); -extern cstr cstr_toupper(const cstr* self); -extern void cstr_casefold(cstr* self); -extern void cstr_lowercase(cstr* self); -extern void cstr_uppercase(cstr* self); +extern cstr cstr_casefold_sv(csview sv); +extern cstr cstr_tolower_sv(csview sv); +extern cstr cstr_toupper_sv(csview sv); + +STC_INLINE void cstr_lowercase(cstr* self) + { cstr_take(self, cstr_tolower_sv(cstr_sv(self))); } + +STC_INLINE void cstr_uppercase(cstr* self) + { cstr_take(self, cstr_toupper_sv(cstr_sv(self))); } STC_INLINE bool cstr_valid_utf8(const cstr* self) { return utf8_valid(cstr_str(self)); } |
